Recent innovations in 3d nanoscale imaging are expected to produce teravoxel and petavoxel-sized images of the brain's neural networks. These datasets will only become useful for neuroscience if computer scientists can develop algorithms for automated image analysis. Chief among the challenges is accurate tracing of the "wires" of the brain, its axons and dendrites, through the 3d images. Achieving the necessary accuracy will require the use of machine learning, rather than hand-designed algorithms. If the tracing problem is solved, it will become possible to create automated systems that take a sample of brain tissue as input and generate its "wiring diagram" or "connectome". Such systems would revolutionize neuroscience by giving rise to a new field called "connectomics," defined by the high-throughput generation of data about neural connectivity, and the subsequent mining of that data for knowledge about the brain. I will discuss the impact that connectomics could have on our understanding of how the brain wires and rewires itself, the dynamics of activity in neural networks, and the neuropathological basis of mental disorders.