Fetch a mesh volume from CATMAID

catmaid_get_volume(x, rval = c("mesh3d", "catmaidmesh", "raw"),
  invertFaces = FALSE, conn = NULL, pid = 1, ...)

Arguments

x

The integer volume id or character volume name

rval

The class to return.

invertFaces

Whether to invert the faces (swapping inside and outside, see details).

conn

the catmaid_connection object

pid

project id (default 1)

...

Additional arguments passed to the catmaid_fetch function.

Value

When rval mesh3d, the standard format used by the rgl and nat packages is the default. catmaidmesh is a tidy version of the mesh format used by catmaid. raw will allow any return value.

Details

Note that if x is a volume name as a character vector then it must be unique (something that CATMAID servers do not insist on).

Note also that this function is targeted at mesh volumes, but CATMAID also support box volumes - these can still be returned and will have a valid set of vertices but an invalid set of indices.

I have noticed that some CATMAID meshes are returned with the normals facing into the mesh (the opposite of what one would expect). This causes pointsinside to do the opposite of what one would expect. Use invertFaces=TRUE to fix this.

See also

Examples

## NB all these examples refer to the FAFB adult Drosophila brain ## CATMAID instance # \donttest{ v14.neuropil=catmaid_get_volume('v14.neuropil') # specifying by name is easier / less fragile than numeric ids # } if (FALSE) { AL_R=catmaid_get_volume("AL_R") shade3d(AL_R, col='red', alpha=.3) if(require("Morpho")) { plotNormals(facenormals(v13.AL_R), long=5e3) } # find surfaces for olfactory glomeruli vl=catmaid_get_volumelist() x glomids=vl$id[grepl("v14.[DV][MLAPC]{0,1}[0-9]{0,1}[dvaplm]{0,1}$", vl$name)] # fetch them all gg=lapply(glomids, catmaid_get_volume) # ... and plot mapply(shade3d, gg, col=rainbow(length(gg))) # alternatively wrap them all in an rgl shapelist3d, plotting each object sl=shapelist3d(gg, col=rainbow(length(gg)), plot=TRUE) }