Read a single neuron from a file
Path to file. This can be a URL, in which case the file is downloaded to a temporary location before reading.
The file format of the neuron. When
The class of the returned object - presently either
additional arguments passed to format-specific readers
This function will handle
saved in R .rds or .rda format by default. Additional file formats can be
At the moment the following formats are supported using file readers already included with the nat package:
read.neuron.swc. SWC files can also
ngraph object containing the neuron structure in a
(permissive) general graph format that also contains the 3D positions for
read.neuron.fiji. The file format
used by the Simple Neurite
Tracer plugin of Fiji/ImageJ.
hxlineset,hxskel Two distinct fileformats used by Amira.
hxlineset is the generic one,
hxskel is used by the
hxskeletonize extension of Schmitt and Evers (see refs).
rda,rds Native R cross-platform binary formats (see
load, readRDS). Note that RDS only contains a single
unnamed neuron, whereas rda contains one or more named neurons.
Schmitt, S. and Evers, J. F. and Duch, C. and Scholz, M. and Obermayer, K. (2004). New methods for the computer-assisted 3-D reconstruction of neurons from confocal image stacks. Neuroimage 4, 1283–98. doi: 10.1016/j.neuroimage.2004.06.047
1 2 3 4 5 6 7 8 9 10 11
## Not run: # note that we override the default NeuronName field n=read.neuron(system.file("tests/testthat/testdata","neuron","EBT7R.CNG.swc",package='nat'), NeuronName="EBT7R") # use a function to set the NeuronName field n3=read.neuron(system.file("tests/testthat/testdata","neuron","EBT7R.CNG.swc",package='nat'), NeuronName=function(x) sub("\\..*","",x)) # show the currently registered file formats that we can read fileformats(class='neuron', read=TRUE) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.