spaces
ngtools.spaces
Utilities to manipulate spaces (ng.CoordinateSpace) in neuroglancer.
Functions:
| Name | Description |
|---|---|
convert_space |
Convert units of a coordinate space. |
normalize_space |
Ensure that dimensions have SI units (without prefix). |
name_compact2full |
Convert a compact axis name ( |
space_is_compatible |
Check whether two standard spaces can map to/from each other. |
space_to_name |
Get neurospace name from spatial axis names. |
Attributes:
| Name | Type | Description |
|---|---|---|
default |
CoordinateSpace
|
Default display space ( |
defaultnames |
list[str]
|
List of all default orientations ( |
defaultspaces |
dict[str, CoordinateSpace]
|
Mapping to all neuroglancer standard spaces (xyz, zyx, etc). |
letter2full |
dict[str, str]
|
Mapping from short to long axis names. |
neuronames |
list[str]
|
List of all existing neuroimaging orientations ( |
neurospaces |
dict[str, CoordinateSpace]
|
Mapping to all known neuroimaging-oriented spaced (RAS, LPI, etc), as well as all neuroglancer standard spaces (xyz, zyx, etc). |
neurotransforms |
dict[tuple[str, str], CoordinateSpaceTransform]
|
Mapping to transforms between neuroimaging spaces.
The keys are either pairs of |
name_compact2full
Convert compact axes name to long list of names.
Examples:
compact2full("ras") -> ["right", "anterior", "posterior"]
compact2full("xyz") -> ["x", "y", "z"]
space_is_compatible
Check whether two spaces can map to/from each other.
True if both spaces describe the same set of 3 axes.
convert_space
Convert units of a coordinate space.
Example
Ensure that all axes have SI unit (without prefix)
See also: normalize_space.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
space
|
CoordinateSpace
|
Coordinate space to convert. |
required |
units
|
str | list[str] | dict[str | tuple[str], str | list[str]]
|
Output unit(s).
|
'base'
|
names
|
str | list[str] | dict[str, str] | None
|
Name(s) of axis to convert.
If |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
space |
CoordinateSpace
|
Converted coordinate space. |
normalize_space
Ensure that dimensions have SI units (without prefix).
See also: convert_space.