Difference between revisions of "SNT: Python Notebooks"

(Getting Started)
Line 6: Line 6:
 
import imagej
 
import imagej
 
ij = imagej.init('sc.fiji:fiji')
 
ij = imagej.init('sc.fiji:fiji')
 +
</source>
 +
Then, import the SNT classes you will need. For example, to download a neuron reconstruction from the MouseLight database, you would import the MouseLightLoader class:
 +
<source lang="python">
 +
MouseLightLoader = autoclass('tracing.io.MouseLightLoader')
 
</source>
 
</source>

Revision as of 18:07, 11 April 2019

Python Notebooks

Direct access to the SNT API from the Python programming language is made possible with the pyimagej module. This enables full integration between SNT and any library in the Python ecosystem.

Getting Started

To initialize Fiji from Python:

import imagej
ij = imagej.init('sc.fiji:fiji')

Then, import the SNT classes you will need. For example, to download a neuron reconstruction from the MouseLight database, you would import the MouseLightLoader class:

MouseLightLoader = autoclass('tracing.io.MouseLightLoader')