Package: nat 1.10.4

Gregory Jefferis

nat: NeuroAnatomy Toolbox for Analysis of 3D Image Data

NeuroAnatomy Toolbox (nat) enables analysis and visualisation of 3D biological image data, especially traced neurons. Reads and writes 3D images in NRRD and 'Amira' AmiraMesh formats and reads surfaces in 'Amira' hxsurf format. Traced neurons can be imported from and written to SWC and 'Amira' LineSet and SkeletonGraph formats. These data can then be visualised in 3D via 'rgl', manipulated including applying calculated registrations, e.g. using the 'CMTK' registration suite, and analysed. There is also a simple representation for neurons that have been subjected to 3D skeletonisation but not formally traced; this allows morphological comparison between neurons including searches and clustering (via the 'nat.nblast' extension package).

Authors:Gregory Jefferis [aut, cre], James Manton [aut], Sridhar Jagannathan [aut], Dominik Krzeminski [ctb]

nat_1.10.4.tar.gz
nat_1.10.4.zip(r-4.5)nat_1.10.4.zip(r-4.4)nat_1.10.4.zip(r-4.3)
nat_1.10.4.tgz(r-4.4-any)nat_1.10.4.tgz(r-4.3-any)
nat_1.10.4.tar.gz(r-4.5-noble)nat_1.10.4.tar.gz(r-4.4-noble)
nat_1.10.4.tgz(r-4.4-emscripten)nat_1.10.4.tgz(r-4.3-emscripten)
nat.pdf |nat.html
nat/json (API)
NEWS

# Install 'nat' in R:
install.packages('nat', repos = c('https://natverse.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/natverse/nat/issues

Datasets:
  • Cell07PNs - Cell07PNs: 40 Sample Projection Neurons from Jefferis, Potter et al 2007
  • MBL.surf - Surface object (hxsurf) for the left mushroom body in FCWB template space
  • dl1neuron - Olfactory Projection Neuron reconstructed from EM data
  • kcs20 - List of 20 Kenyon Cells from Chiang et al 2011 converted to dotprops objects

On CRAN:

3dconnectomicsimage-analysisneuroanatomyneuroanatomy-toolboxneuronneuron-morphologyneurosciencevisualisation

166 exports 64 stars 3.94 score 52 dependencies 2 dependents 2 mentions 426 scripts 560 downloads

Last updated 7 months agofrom:2538b4c5b8. Checks:OK: 2 NOTE: 2 ERROR: 3. Indexed: yes.

TargetResultDate
Doc / VignettesOKSep 16 2024
R-4.5-winERRORSep 16 2024
R-4.5-linuxNOTESep 16 2024
R-4.4-winERRORSep 16 2024
R-4.4-macNOTESep 16 2024
R-4.3-winERRORSep 16 2024
R-4.3-macOKSep 16 2024

Exports:affmat2cmtkparamsamiratypeas.cmtkregas.dotpropsas.hxsurfas.im3das.neuronas.neuronlistas.neuronlistfhas.ngraphas.seglistboundingboxboundingbox<-branchpointsclampmaxcmtk.bindircmtk.callcmtk.dof2matcmtk.extract_affinecmtk.mat2dofcmtk.reformatxcmtk.statisticscmtk.system2cmtk.targetvolumecmtk.versioncmtkparams2affmatcmtkregcmtkreglistcoord2indcorrect_rootdata.frame<-distal_todotpropsendpointsfileformatsfind.neuronfind.somaflipget_distance_to_somaget_topo_featuresgetformatreadergetformatwritergraph.nodesijkposim3dimexpand.gridimscalebarimsliceind2coordintersectintersect_planeinvert_reglistis.amirameshis.cmtkregis.dotpropsis.fijitracesis.im3dis.neuronis.neuronlistis.nrrdis.swcis.vaa3drawmake_modelmakeboundingboxmaskmaterialsmirrornclear3dndigestneuronneuronlistneuronlistfhneuronlistzngraphnlapplynlscannmapplynopen3dnormalise_swcnpop3dnrrd.datafilesnrrd.voxdimsnverticesnview3doriginoverlap_scorepan3dplane_coefficientspointsinsidepotential_synapsesprogress_natprogressprojectionpruneprune_edgesprune_in_volumeprune_onlineprune_strahlerprune_twigsprune_verticesread.amirameshread.amiramesh.headerread.cmtkread.cmtkregread.hxsurfread.im3dread.landmarksread.morphmlread.neuronread.neuron.fijiread.neuron.neuromlread.neuron.swcread.neuronlistfhread.neuronsread.ngraph.swcread.nrrdread.nrrd.headerread.vaa3drawregisterformatreglistremotesyncrerootresamplerootpointsseglengthsseglistseglist2swcsegmentgraphselect_pointssetdiffsholl_analysissimplify_neuronsimplify_reglistsmooth_neuronspinestitch_neuronstitch_neuronsstitch_neurons_mststrahler_ordersub2indthresholdtpsregunionunmaskvoxdimswire3dwrite.amirameshwrite.cmtkwrite.cmtkregwrite.hxsurfwrite.im3dwrite.landmarkswrite.neuronwrite.neuronlistfhwrite.neuronswrite.nrrdwrite.nrrd.headerwrite.nrrd.header.for.filewrite.vtkxformxformimagexformpointsxyzmatrixxyzmatrix<-xyzmatrix2listxyzmatrix2strxyzpos

Dependencies:backportsbase64encBHbslibcachemcheckmateclicpp11crayondigestevaluatefastmapfilehashfontawesomefsgluehighrhmshtmltoolshtmlwidgetsigraphjquerylibjsonliteknitrlatticelifecyclemagrittrMatrixmemoisemimenabornat.utilspbapplypkgconfigplyrprettyunitsprogressR6rappdirsRcppRcppEigenrglrlangrmarkdownsassstringistringrtinytexvctrsxfunyamlzip

3D Graphics

Rendered fromplotly.Rmdusingknitr::rmarkdownon Sep 16 2024.

Last update: 2021-07-11
Started: 2019-09-25

Installation details

Rendered fromInstallation.Rmdusingknitr::rmarkdownon Sep 16 2024.

Last update: 2021-07-11
Started: 2016-10-26

Introduction to neurons and neuronlists

Rendered fromneurons-intro.Rmdusingknitr::rmarkdownon Sep 16 2024.

Last update: 2021-07-11
Started: 2016-10-30

NeuroGeometry: Analysing 3D morphology of neurons

Rendered fromNeuroGeometry.Rmdusingknitr::rmarkdownon Sep 16 2024.

Last update: 2019-01-09
Started: 2018-01-02

Working with individual neurons as graph structures

Rendered fromneurons-as-graph.Rmdusingknitr::rmarkdownon Sep 16 2024.

Last update: 2022-04-20
Started: 2018-01-02

Readme and manuals

Help Manual

Help pageTopics
Analyse 3D biological image data especially neuronsnat-package nat
Extract from neuronlistfh object or its attached data.frame[.neuronlistfh
Arithmetic for neuron coordinates applied to neuronlists*.neuronlist +.neuronlist -.neuronlist /.neuronlist
Decompose homogeneous affine matrix to CMTK registration parametersaffmat2cmtkparams
all.equal method tailored to dotprops objectsall.equal.dotprops
Check equality on data and key attributes of im3d objectsall.equal.im3d
Check equality on key fields of neuron objectall.equal.neuron
Return the type of an AmiraMesh file on disk or a parsed headeramiratype
Get or set the attached data.frame of a neuronlistas.data.frame.neuronlist data.frame<- data.frame<-.neuronlist
Convert an object to a nat hxsurf objectas.hxsurf as.hxsurf.mesh3d
Convert a suitable object to an im3d object.as.im3d as.im3d.im3d as.im3d.matrix
Convert an object to an rgl mesh3das.mesh3d as.mesh3d.ashape3d as.mesh3d.boundingbox as.mesh3d.hxsurf
Make a list of neurons that can be used for coordinate plotting/analysisas.neuronlist as.neuronlist.default
convert neuronlistfh to a regular (in memory) neuronlistas.neuronlist.neuronlistfh
Get the bounding box of an image volume or object containing 3D verticesboundingbox boundingbox.character boundingbox.default boundingbox.im3d boundingbox<-
Concatenate HyperSurface objectsc.hxsurf
Combine multiple neuronlists into a single listc.neuronlist
Cell07PNs: 40 Sample Projection Neurons from Jefferis, Potter et al 2007Cell07PNs
Return function that finds maximum of its inputs within a clamping rangeclampmax
Return path to directory containing CMTK binariescmtk cmtk.bindir
Utility function to create and run calls to CMTK command line toolscmtk.call cmtk.system2
Convert CMTK registration to homogeneous affine matrix with dof2matcmtk.dof2mat
Extract affine registration from CMTK registration file or in-memory listcmtk.extract_affine
Use CMTK mat2dof to convert homogeneous affine matrix into CMTK registrationcmtk.mat2dof
Reformat an image with a CMTK registration using the reformatx toolcmtk.reformatx
Calculate image statistics for a nrrd or other CMTK compatible filecmtk.statistics
Defines a target volume for a CMTK reformatx operationcmtk.targetvolume cmtk.targetvolume.default cmtk.targetvolume.im3d cmtk.targetvolume.list
Return cmtk version or test for presence of at least a specific versioncmtk.version
Compose homogeneous affine matrix from CMTK registration parameterscmtkparams2affmat
Create and test cmtkreg objects that specify path to a CMTK registrationas.cmtkreg as.cmtkreg.default as.cmtkreg.matrix as.cmtkreg.reglist cmtkreg is.cmtkreg
Make in-memory CMTK registration list from affine matrix or CMTK parameterscmtkreglist
Find 1D or 3D voxel indices into a 3D image given spatial coordinatescoord2ind coord2ind.default
Interactively re-root neurons (usually to their soma)correct_root
Return indices of points in a neuron distal to a given nodedistal_to
Olfactory Projection Neuron reconstructed from EM datadl1neuron
dotprops: Neurons as point clouds with tangent vectors (but no connectivity)as.dotprops dotprops dotprops.character dotprops.default dotprops.dotprops dotprops.im3d dotprops.neuron dotprops.neuronlist is.dotprops
Set or return list of registered file formats that we can readfileformats getformatreader getformatwriter registerformat
Find neurons within a 3D selection box (usually drawn in rgl window)find.neuron
Find neurons with soma inside 3D selection box (usually drawn in rgl window)find.soma
Flip an array, matrix or vector about an axisflip flip.array
Get topological features per each nodeget_distance_to_soma get_topo_features
Return root, end, or branchpoints of an igraph objectgraph.nodes
Construct an im3d object representing 3D image data, densities etcim3d
Interconvert pixel and physical coordinatesijkpos im3d-coords xyzpos
Read/Write calibrated 3D blocks of image dataim3d-io read.im3d write.im3d
Method to plot spatially calibrated image arraysimage.im3d
Convert locations of im3d voxel grid into XYZ coordinatesimexpand.grid
Make a scalebar to accompany an image.im3d plotimscalebar
Slice out a 3D subarray (or 2d matrix) from a 3D image arrayimslice
Find XYZ coords corresponding to 1D indices into a 3D imageind2coord ind2coord.array ind2coord.default ind2coord.im3d
Find the intersection of two collections of objectsintersect intersect.default intersect.neuronlist
Find the points on a plane that are intersected by an objectintersect_plane intersect_plane.default intersect_plane.neuron
Check if file is AmiraMesh formatis.amiramesh
Check whether a file is in Fiji's simple neurite tracer formatis.fijitraces
Test if an object is of class im3dis.im3d
Check whether a file is in NeuroML formatis.neuroml
Test objects of neuronlist class to store multiple neuronsis.neuronlist
Check if a file is a NRRD fileis.nrrd
Test if a file is an SWC format neuronis.swc
Check if a file is in the raw image format used by Hanchuan Peng's Vaa3Dis.vaa3draw
List of 20 Kenyon Cells from Chiang et al 2011 converted to dotprops objectskcs20
Generate a 3D model from connector and/or tree node datamake_model
Construct a 3D bounding box objectmakeboundingbox
Mask an object, typically to produce a copy with some values zeroed outmask mask.im3d
Extract or set the materials for an objectmaterials materials.character materials.default materials.hxsurf
Surface object (hxsurf) for the left mushroom body in FCWB template spaceMBL.surf
Mirror 3D object about a given axis, optionally using a warping registrationmirror mirror.character mirror.default mirror.neuronlist
Clear the rgl or plotly 3D scenenclear3d
Calculated normalised digest value for an objectndigest ndigest.dotprops ndigest.neuron ndigest.neuronlistfh
neuron: class to represent traced neuronsas.neuron as.neuron.data.frame as.neuron.default as.neuron.igraph as.neuron.ngraph is.neuron neuron
Create a neuronlist from zero or more neuronsneuronlist
Methods for working with the dataframe attached to a neuronlistdroplevels droplevels.neuronlist head head.neuronlist neuronlist-dataframe-methods tail tail.neuronlist with with.neuronlist [.neuronlist [<-.neuronlist
neuronlistfh - List of neurons loaded on demand from disk or remote websiteas.neuronlistfh as.neuronlistfh.neuronlist c.neuronlistfh is.neuronlistfh neuronlistfh
A neuronlist object that will read neurons from a zip file on demandas.neuronlist.neuronlistz neuronlistz
ngraph: a graph to encode a neuron's connectivityas.ngraph as.ngraph.data.frame as.ngraph.neuron ngraph
lapply and mapply for neuronlists (with optional parallelisation)nlapply nmapply progress_natprogress
Scan through a set of neurons, individually plotting each one in 3Dnlscan
Open customised rgl windownopen3d
Normalise an SWC format block of neuron morphology datanormalise_swc
Remove plotted neurons or other 3D objectsnpop3d
Return voxel dimensions (by default absolute voxel dimensions)nrrd.voxdims
Find the number of vertices in an object (or each element of a neuronlist)nvertices nvertices.default nvertices.neuronlist nvertices.shapelist3d
Set the 3D viewpoint of an RGL window using anatomical termsnview3d
Arithmetic for nat dotprops and surface objectsOps.dotprops Ops.hxsurf Ops.mesh3d
Arithmetic for neuron coordinatesOps.neuron
Return the space origin of a 3D image objectorigin
Generate a connectivity matrix based on euclidean distance between pointsoverlap_score
Some useful extensions / changes to rgl defaultspan3d
Find the coefficients of the plane equationplane_coefficients
Plot a 2D projection of a neuronplot.dotprops plot.neuron
2D plots of the elements in a neuronlist, optionally using a subset expressionplot.neuronlist
plot3d methods for different nat objectsplot3d
Plot a bounding box in 3Dplot3d.boundingbox
Plot the domain of a CMTK registrationplot3d.cmtkreg
3D plots of dotprops objects using rgl packageplot3d.dotprops
Plot amira surface objects in 3D using rglplot3d.hxsurf
Plot neurons in 3D using rgl library or plotly moduleplot3d.neuron
3D plots of the elements in a neuronlist, optionally using a subset expressionplot3d.character plot3d.neuronlist
Plot 3d representation of neuron (ngraph) with directed edgesplot3d.ngraph
Find which points of an object are inside a surfacepointsinside pointsinside.default
Calculate number of potential synapses between two neuronspotential_synapses potential_synapses.dotprops potential_synapses.neuron potential_synapses.neuronlist
Make 2D (orthogonal) projection of 3D image dataprojection
prune an object by removing points near (or far) from a target objectprune prune.default prune.dotprops prune.neuron prune.neuronlist
Prune neuron(s) within a volume defined by a 3D meshprune_in_volume prune_in_volume.neuron prune_in_volume.neuronlist
Prune a neuron interactively in an rgl windowprune_online prune_online.neuron prune_online.neuronlist
Prune a neuron by removing segments with a given Strahler orderprune_strahler
Remove all twigs less than a certain path length from a neuronprune_twigs prune_twigs.neuron prune_twigs.neuronlist
Prune selected vertices or edges from a neuronprune_edges prune_vertices
Read AmiraMesh data in binary or ascii formatread.amiramesh read.amiramesh.header
Read CMTK TypedStream file to a list in memoryread.cmtk
Read a CMTK format registrationread.cmtkreg
Read Amira surface (aka HxSurface or HyperSurface) files into hxsurf objecthxsurf read.hxsurf
Generic functions to read/write landmarks in any supported formatread.landmarks write.landmarks
Return parsed XML or R list versions of a NeuroML fileread.morphml
Read a single neuron from a fileread.neuron
Read a neuron saved by Fiji's Simple Neurite Tracer Pluginread.neuron.fiji
Read one or more neurons from a NeuroML v1 fileread.neuron.neuroml
Read a neuron in swc file formatread.neuron.swc read.ngraph.swc
Read a local, or remote, neuronlistfh object saved to a file.read.neuronlistfh
Read one or more neurons from file to a neuronlist in memoryread.neurons
Read NRRD files/headers into memorynrrd.datafiles read.nrrd read.nrrd.header
Read Vaa3d format image dataread.vaa3draw
A simple wrapper class for multiple transformationsc.reglist invert_reglist reglist
Synchronise a remote objectremotesync remotesync.neuronlistfh
Reroot neuronsreroot reroot.neuron reroot.neuronlist
Resample an object with a new spacingresample resample.neuron resample.neuronlist
Return the root, branch, or end points of a neuron or graphbranchpoints branchpoints.default branchpoints.igraph branchpoints.neuron endpoints endpoints.default endpoints.igraph endpoints.neuron rootpoints rootpoints.default rootpoints.igraph rootpoints.neuron
Scale and centre neuron 3D coordinatesscale scale.dotprops scale.neuron
Calculate length of all segments in neuronseglengths
Make/convert neuron connectivity information into a seglist objectas.seglist as.seglist.igraph as.seglist.neuron seglist
Recalculate Neurons's SWCData using SegList and point informationseglist2swc
Return a simplified segment graph for a neuronsegmentgraph
Interactively select 3D points in spaceselect_points
Find the (asymmetric) difference between two collections of objectssetdiff setdiff.default setdiff.neuronlist
Perform a Sholl analysis on neuron skeletonssholl_analysis sholl_analysis.neuron sholl_analysis.neuronlist
Simplify a neuron to the longest tree with n branch pointssimplify_neuron
Simplify a registration listsimplify_reglist
Smooth the 3D coordinates of a neuron skeletonsmooth_neuron smooth_segment_gauss
Compute the longest path (aka spine or backbone) of a neuronspine
Stitch two neurons together at their closest endpointstitch_neuron
Stitch multiple fragments into single neuron using nearest endpointsstitch_neurons
Stitch multiple fragments into single neuron using minimum spanning treestitch_neurons_mst
Find the Strahler order of each point in a neuronstrahler_order
Find 1D index given n-dimensional indicessub2ind
Subset methods for different nat objectssubset
Subset points in dotprops object that match given conditionssubset.dotprops
Subset hxsurf object to specified regionssubset.hxsurf
Subset neuron by keeping only vertices that match given conditionssubset.neuron
Subset neuronlist returning either new neuronlist or names of chosen neuronssubset.neuronlist
Summary statistics for neurons (e.g. cable length, number of nodes)summary summary.dotprops summary.mesh3d summary.neuron summary.neuronlist
Threshold an object, typically to produce a maskthreshold threshold.im3d
Thin plate spline registrations via xform and friendstpsreg xformpoints.tpsreg
Find the union of two collections of objectsunion union.default union.neuronlist
Make im3d image array containing values at locations defined by a maskunmask
Return voxel dimensions of an objectvoxdims voxdims.character voxdims.default voxdims.im3d
Wire frame plotswire3d wire3d.hxsurf wire3d.mesh3d wire3d.shapelist3d
Write a 3D data object to an AmiraMesh format filewrite.amiramesh
Write a suitable list to a CMTK TypedStream file on diskwrite.cmtk
Write out CMTK registration list to folderwrite.cmtkreg
Write Amira surface (aka HxSurface or HyperSurface) into .surf file.write.hxsurf
Write out a neuron skeleton or mesh in any of the file formats we know aboutwrite.neuron
Write out a neuronlistfh object to an RDS filewrite.neuronlistfh
Write neurons from a neuronlist object to individual files, or a zip archivewrite.neurons
Write data and metadata to NRRD file or create a detached NRRD (nhdr) file.write.nrrd write.nrrd.header write.nrrd.header.for.file
Write object to VTK filewrite.vtk write.vtk.neuron
Transform the 3D location of objects such as neuronsxform xform.character xform.data.frame xform.default xform.dotprops xform.list xform.mesh3d xform.neuron xform.neuronlist xform.shape3d
Transform image files using a registration or affine matrixxformimage xformimage.character xformimage.cmtkreg xformimage.default xformimage.reglist
Transform 3D points using a registration, affine matrix or functionxformpoints xformpoints.character xformpoints.cmtkreg xformpoints.default xformpoints.reglist
Get and assign coordinates for classes containing 3D vertex dataxyzmatrix xyzmatrix.character xyzmatrix.default xyzmatrix.dotprops xyzmatrix.hxsurf xyzmatrix.igraph xyzmatrix.list xyzmatrix.mesh3d xyzmatrix.neuron xyzmatrix.neuronlist xyzmatrix.shapelist3d xyzmatrix2list xyzmatrix2str xyzmatrix<- xyzmatrix<-.character xyzmatrix<-.dotprops xyzmatrix<-.hxsurf xyzmatrix<-.igraph xyzmatrix<-.mesh3d xyzmatrix<-.neuron xyzmatrix<-.neuronlist xyzmatrix<-.shape3d xyzmatrix<-.shapelist3d