Module: soma.aims¶
Here are listed members (classes, functions) of the soma.aims
module. Note that this module is mainly a binding of the C++ aimsdata library, and corresponds to a C++ namespace. Thus once soma.aimsalgo
is also imported, the namespace is fed with more classes. As a result the list here includes members from both libraries.
The aims module allows access to the AIMS library in python.
Comptibility and requirements¶
Since version 4.5.1 both Python 2 (2.7 and higher) and Python 3 (3.4 and higher) are supported. However as the module contains compiled code (python / C++ bindings) using specific python C interfaces (APIs/ABIs), PyAIMS has to be compiled separately for a given version of python.
PyAIMS also has bindings to the numpy library, allowing easy array manipulations. This also involves constraints on the Numpy ABI version: once PyAims is compiled, it is not possible to swith numpy to a different version featuring a different ABI (which pip often does without warning, unfortunately).
Most of it is a set of direct bindings to the AIMS C++ library API. But a few classes have been customized or specially written to make easy links to the python world. See also the small AIMS C++ developer doc.
aims contains mainly the AIMS and carto data structures and IO system. It covers several C++ libraries: cartobase, cartodata, graph, aimsdata, plus some C++ classes from the standard library (like std::vector)
Main classes¶
Reader
andWriter
for the generic IO system, which allows to read and write everything, and which can be, in most cases, replaced with the more convenient globalread()
andwrite()
functions.Finder
is also part of the IO system to identify files and get information about them.Volume_<type>:
volumes
. An important feature of Volumes is the link with thenumpy.ndarray
arrays, so all the power of numpy can be used to work on volumes. See for instanceVolume_FLOAT
. Volumes of various types can be build using the convenience factory functionVolume()
. Note that the older classesAimsData
are deprecated in the C++ library and have been removed from the python bindings in Aims 5.1.
carto.GenericObject
: the dynamic C++ generic object which behaves much like a python object, and its proxyObject
which should always be used to access aGenericObject
AimsVector_<type>_<size> for fixed-size vectors, and their aliases for points:
Point3df
,Point2df
,Point3d
vector_<type>, set_<type>, list_<type>, map_<type1>_<type2> provide bindings to the C++ std::vector, std::list, std::set, std::map template classes and easy conversions from / to python lists
rc_ptr_<type>: bridge with C++ reference counters, which should interact quite well, and most of the time transparently, with python reference counting
BucketMap_VOID
: list of voxels. Created using the factory functionBucketMap()
AimsTimeSurface_<polygons_size>_<texture_type=VOID>: meshes, and the factory function
AimsTimeSurface()
. See for instanceAimsTimeSurface_3_VOID
.TimeTexture_<type>: textures to map on meshes, and the factory function
TimeTexture()
.
AffineTransformation3d
: the transformation class that allows referential conversionsConverter_<type1>_<type2> and ShallowConverter_<type1>_<type2>: conversions between data types (mainly volume types). See the factory functions
Converter()
andShallowConverter()
a few algorithms will be added
- class soma.aims.AffineTransformation3d(*args)¶
Bases:
Transformation3d
- affine()¶
- fromColumnVector()¶
- fromMatrix(value)¶
- header()¶
- inverse()¶
- isDirect()¶
- isIdentity()¶
Test if the transformation can safely be omitted
This method must only return true if the transformation behaves exactly like an identity transformation (notably, the transform methods will always return the input coordinates unchanged).
NOTE: Implementors of derived classes may choose to always return false if a test would be difficult to implement or expensive to run.
- rotation()¶
- rotationaroundx()¶
- rotationaroundy()¶
- rotationaroundz()¶
- scale()¶
- setRotationAffine()¶
- setToIdentity()¶
- setTranslation()¶
- toColumnVector()¶
- toMatrix()¶
This function return a copy of the transformation matrix
- toVector()¶
- transformDouble()¶
- transformFloat()¶
- transformNormal()¶
- transformNormalDouble()¶
- transformNormalFloat()¶
- transformNormalPoint3dd()¶
- transformNormalPoint3df()¶
- transformPoint3d()¶
- transformPoint3dd()¶
- transformPoint3df()¶
- transformUnitNormal()¶
- transformVector()¶
- transformVectorDouble()¶
- transformVectorFloat()¶
- transformVectorPoint3dd()¶
- transformVectorPoint3df()¶
- translation()¶
- soma.aims.AimsConnectedComponent()¶
- void AimsConnectedComponent(data, connectivity, valids, backgrnd=0,
bin=True, minSize=0, numMax=0, verbose=True)
Connected components extraction. The function modifies the input data, and does not return a new one.
- Parameters:
- void AimsConnectedComponent(data, connectivity, backgrnd=0, bin=True,
minSize=0, maxSize=0, numMax=0, verbose=True)
Connected components extraction. The function modifies the input data, and does not return a new one.
- Parameters:
- void AimsConnectedComponent(data, connectivity, backgrnd=0, bin=True,
minSize=0, maxSize=0, numMax=0, verbose=True)
Connected components extraction, Bucket version. The function modifies the input data, and does not return a new one.
- Parameters:
- void AimsConnectedComponent(data, connectivity, valids, backgrnd=0,
bin=True, minSize=0, numMax=0, verbose=True)
Connected components extraction. The function modifies the input data, and does not return a new one.
- Parameters:
- void AimsConnectedComponent(data, connectivity, backgrnd=0, bin=True,
minSize=0, maxSize=0, numMax=0, verbose=True)
Connected components extraction. The function modifies the input data, and does not return a new one.
- Parameters:
- void AimsConnectedComponent(data, connectivity, backgrnd=0, bin=True,
minSize=0, maxSize=0, numMax=0, verbose=True)
Connected components extraction, Bucket version. The function modifies the input data, and does not return a new one.
- Parameters:
- void AimsConnectedComponent(data, connectivity, valids, backgrnd=0,
bin=True, minSize=0, numMax=0, verbose=True)
Connected components extraction. The function modifies the input data, and does not return a new one.
- Parameters:
- void AimsConnectedComponent(data, connectivity, backgrnd=0, bin=True,
minSize=0, maxSize=0, numMax=0, verbose=True)
Connected components extraction. The function modifies the input data, and does not return a new one.
- Parameters:
- void AimsConnectedComponent(data, connectivity, backgrnd=0, bin=True,
minSize=0, maxSize=0, numMax=0, verbose=True)
Connected components extraction, Bucket version. The function modifies the input data, and does not return a new one.
- Parameters:
- void AimsConnectedComponent(data, connectivity, valids, backgrnd=0,
bin=True, minSize=0, numMax=0, verbose=True)
Connected components extraction. The function modifies the input data, and does not return a new one.
- Parameters:
- void AimsConnectedComponent(data, connectivity, backgrnd=0, bin=True,
minSize=0, maxSize=0, numMax=0, verbose=True)
Connected components extraction. The function modifies the input data, and does not return a new one.
- Parameters:
- void AimsConnectedComponent(data, connectivity, backgrnd=0, bin=True,
minSize=0, maxSize=0, numMax=0, verbose=True)
Connected components extraction, Bucket version. The function modifies the input data, and does not return a new one.
- class soma.aims.AimsGraphReader¶
Bases:
wrapper
- readElements()¶
- setExcludeFilter()¶
- setReadFilter()¶
- class soma.aims.AimsMerge_S16_S16¶
Bases:
wrapper
- soma.aims.AimsSurfaceTriangle¶
alias of
AimsTimeSurface_3_VOID
- soma.aims.AimsThreshold(*args, **kwargs)[source]¶
Create a AimsThreshold instance from input and output types. Types may be passed as keyword arguments intype and outtype, or dtype if both are the same. Otherwise the arguments are parsed to find types arguments. Types may be specified as allowed by typeCode().
Other arguments are otherwise passed to the constructor of the underlying threshold object. See for instance:
soma.aims.AimsThreshold_S16_S16
.
- class soma.aims.AimsThreshold_FLOAT_S16¶
Bases:
wrapper
- AimsThreshold_FLOAT_S16(ttype, th1, th2=0,
background=0)
Thresholding types are specified as the soma.aims.threshold_t enum. Values are:
AIMS_LOWER_THAN
AIMS_LOWER_OR_EQUAL_TO
AIMS_GREATER_THAN
AIMS_GREATER_OR_EQUAL_TO
AIMS_EQUAL_TO
AIMS_DIFFER
AIMS_BETWEEN
AIMS_OUTSIDE
AIMS_BETWEEN_EXCLUDE_LOWER_BOUND
AIMS_BETWEEN_EXCLUDE_HIGHER_BOUND
AIMS_BETWEEN_EXCLUDE_BOUNDS
AIMS_OUTSIDE_INCLUDE_LOWER_BOUND
AIMS_OUTSIDE_INCLUDE_HIGHER_BOUND
AIMS_OUTSIDE_INCLUDE_BOUNDS
Use:
thresholded_vol = threshold(volume)
Apply non-binary thresholding: voxels passing the theshold are left with their initial value.
thresholded_vol = threshold.bin(volume)
Apply binary thresholding: voxels passing the theshold are set to a constant value – which one ?
- Parameters:
ttype (soma.aims.threshold_t enum) – thresholding type (see above)
th1 (float) – first (main) threshold
th2 (float) – second threshold (in case of double thresholding)
background (float) – value set to elements not passing the threshold condition
volume (Volume_S16) – input volume to be thresholded
- Returns:
thresholded_vol – thresholded volume
- Return type:
thresholded_vol = threshold(volume)
Apply non-binary thresholding: voxels passing the theshold are left with their initial value.
- Parameters:
volume (Volume_S16) – input volume to be thresholded
- Returns:
thresholded_vol – thresholded volume
- Return type:
- bin()¶
thresholded_vol = threshold.bin(volume)
Apply binary thresholding: voxels passing the theshold are set to a constant value – which one ?
- Parameters:
volume (Volume_FLOAT) – input volume to be thresholded
- Returns:
thresholded_vol – thresholded volume
- Return type:
- class soma.aims.AimsThreshold_S16_S16¶
Bases:
wrapper
- AimsThreshold_S16_S16(ttype, th1, th2=0,
background=0)
Thresholding types are specified as the soma.aims.threshold_t enum. Values are:
AIMS_LOWER_THAN
AIMS_LOWER_OR_EQUAL_TO
AIMS_GREATER_THAN
AIMS_GREATER_OR_EQUAL_TO
AIMS_EQUAL_TO
AIMS_DIFFER
AIMS_BETWEEN
AIMS_OUTSIDE
AIMS_BETWEEN_EXCLUDE_LOWER_BOUND
AIMS_BETWEEN_EXCLUDE_HIGHER_BOUND
AIMS_BETWEEN_EXCLUDE_BOUNDS
AIMS_OUTSIDE_INCLUDE_LOWER_BOUND
AIMS_OUTSIDE_INCLUDE_HIGHER_BOUND
AIMS_OUTSIDE_INCLUDE_BOUNDS
Use:
thresholded_vol = threshold(volume)
Apply non-binary thresholding: voxels passing the theshold are left with their initial value.
thresholded_vol = threshold.bin(volume)
Apply binary thresholding: voxels passing the theshold are set to a constant value – which one ?
- Parameters:
ttype (soma.aims.threshold_t enum) – thresholding type (see above)
th1 (short) – first (main) threshold
th2 (short) – second threshold (in case of double thresholding)
background (short) – value set to elements not passing the threshold condition
volume (Volume_S16) – input volume to be thresholded
- Returns:
thresholded_vol – thresholded volume
- Return type:
thresholded_vol = threshold(volume)
Apply non-binary thresholding: voxels passing the theshold are left with their initial value.
- Parameters:
volume (Volume_S16) – input volume to be thresholded
- Returns:
thresholded_vol – thresholded volume
- Return type:
- bin()¶
thresholded_vol = threshold.bin(volume)
Apply binary thresholding: voxels passing the theshold are set to a constant value – which one ?
- Parameters:
volume (Volume_S16) – input volume to be thresholded
- Returns:
thresholded_vol – thresholded volume
- Return type:
- soma.aims.AimsTimeSurface(*args, **kwargs)[source]¶
Create an instance of Aims mesh (AimsTimeSurface_<dim>_<dtype>) from a dimension parameter, or copies a mesh, or build it from arrays.
See for instance
AimsTimeSurface_3_VOID
Usages:
mesh1 = AimsTimeSurface() mesh2 = AimsTimeSurface(3) mesh3 = AimsTimeSurface(3, 'VOID') mesh4 = AimsTimeSurface(3, dtype='VOID') mesh5 = AimsTimeSurface(dim=3, dtype='VOID')
mesh6 = AimsTimeSurface(mesh)
mesh7 = AimsTimeSurface(vertices=[[1,2,3], [3,4,5.6]], polygons=[[0,1]]) mesh8 = AimsTimeSurface([[1,2,3], [3,4,5.6]], polygons=[[0,1]]) mesh9 = AimsTimeSurface([[1,2,3], [3,4,5.6]], None, [[0,1]]) mesh10 = AimsTimeSurface([[1,2,3], [3,4,5.6]], [[0,1]], normals=[])
- soma.aims.AimsTimeSurface_2¶
alias of
AimsTimeSurface_2_VOID
- class soma.aims.AimsTimeSurface_2_FLOAT(*args)¶
Bases:
RCObject
- erase()¶
- fromObject()¶
- header()¶
The header contains all meta-data.
- keys()¶
- normal()¶
- polygon()¶
- size()¶
- texture()¶
- updateNormals()¶
- vertex()¶
- class soma.aims.AimsTimeSurface_2_POINT2DF(*args)¶
Bases:
RCObject
- erase()¶
- fromObject()¶
- header()¶
The header contains all meta-data.
- keys()¶
- normal()¶
- polygon()¶
- size()¶
- texture()¶
- updateNormals()¶
- vertex()¶
- class soma.aims.AimsTimeSurface_2_VOID(*args)¶
Bases:
RCObject
- erase()¶
- fromObject()¶
- header()¶
The header contains all meta-data.
- keys()¶
- normal()¶
- polygon()¶
- size()¶
- texture()¶
- updateNormals()¶
- vertex()¶
- soma.aims.AimsTimeSurface_3¶
alias of
AimsTimeSurface_3_VOID
- class soma.aims.AimsTimeSurface_3_FLOAT(*args)¶
Bases:
RCObject
- erase()¶
- fromObject()¶
- header()¶
The header contains all meta-data.
- keys()¶
- normal()¶
- polygon()¶
- size()¶
- texture()¶
- updateNormals()¶
- vertex()¶
- class soma.aims.AimsTimeSurface_3_POINT2DF(*args)¶
Bases:
RCObject
- erase()¶
- fromObject()¶
- header()¶
The header contains all meta-data.
- keys()¶
- normal()¶
- polygon()¶
- size()¶
- texture()¶
- updateNormals()¶
- vertex()¶
- class soma.aims.AimsTimeSurface_3_VOID(*args)¶
Bases:
RCObject
- erase()¶
- fromObject()¶
- header()¶
The header contains all meta-data.
- keys()¶
- normal()¶
- polygon()¶
- size()¶
- texture()¶
- updateNormals()¶
- vertex()¶
- soma.aims.AimsTimeSurface_4¶
alias of
AimsTimeSurface_4_VOID
- class soma.aims.AimsTimeSurface_4_FLOAT(*args)¶
Bases:
RCObject
- erase()¶
- fromObject()¶
- header()¶
The header contains all meta-data.
- keys()¶
- normal()¶
- polygon()¶
- size()¶
- texture()¶
- updateNormals()¶
- vertex()¶
- class soma.aims.AimsTimeSurface_4_POINT2DF(*args)¶
Bases:
RCObject
- erase()¶
- fromObject()¶
- header()¶
The header contains all meta-data.
- keys()¶
- normal()¶
- polygon()¶
- size()¶
- texture()¶
- updateNormals()¶
- vertex()¶
- class soma.aims.AimsTimeSurface_4_VOID(*args)¶
Bases:
RCObject
- erase()¶
- fromObject()¶
- header()¶
The header contains all meta-data.
- keys()¶
- normal()¶
- polygon()¶
- size()¶
- texture()¶
- updateNormals()¶
- vertex()¶
- soma.aims.AimsVector(*args, **kwargs)[source]¶
Create an AimsVector instance from type and dimension arguments. Types may be passed as the keyword argument dtype. Otherwise the arguments are parsed to find types arguments. Dimension should be passed as the keyword argument dim, or is guessed from the input value(s).
Types may be specified as allowed by typeCode().
If unspecified, type is guessed from the 1st element of the vector data.
- class soma.aims.AimsVector_DOUBLE_2¶
Bases:
wrapper
- arraydata()¶
- assign()¶
- crossed()¶
- dnorm()¶
- dnorm2()¶
- dot()¶
- fromObject()¶
- isNull()¶
- item()¶
- items()¶
- list()¶
- norm()¶
- norm2()¶
- normalize()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- setItems()¶
- class soma.aims.AimsVector_DOUBLE_3¶
Bases:
wrapper
- arraydata()¶
- assign()¶
- crossed()¶
- dnorm()¶
- dnorm2()¶
- dot()¶
- fromObject()¶
- isNull()¶
- item()¶
- items()¶
- list()¶
- norm()¶
- norm2()¶
- normalize()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- setItems()¶
- class soma.aims.AimsVector_DOUBLE_4¶
Bases:
wrapper
- arraydata()¶
- assign()¶
- crossed()¶
- dnorm()¶
- dnorm2()¶
- dot()¶
- fromObject()¶
- isNull()¶
- item()¶
- items()¶
- list()¶
- norm()¶
- norm2()¶
- normalize()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- setItems()¶
- class soma.aims.AimsVector_FLOAT_2¶
Bases:
wrapper
- arraydata()¶
- assign()¶
- crossed()¶
- dnorm()¶
- dnorm2()¶
- dot()¶
- fromObject()¶
- isNull()¶
- item()¶
- items()¶
- list()¶
- norm()¶
- norm2()¶
- normalize()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- setItems()¶
- class soma.aims.AimsVector_FLOAT_3¶
Bases:
wrapper
This class wraps an aims Point3df aka AimsVector<3, float> use the method items() to get a tuple out of it use setItems(Point3df) to affect new values
- arraydata()¶
- assign()¶
- crossed()¶
- dnorm()¶
- dnorm2()¶
- dot()¶
- fromObject()¶
- isNull()¶
- item()¶
- items()¶
- list()¶
- norm()¶
- norm2()¶
- normalize()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- setItems()¶
- class soma.aims.AimsVector_FLOAT_4¶
Bases:
wrapper
- arraydata()¶
- assign()¶
- crossed()¶
- dnorm()¶
- dnorm2()¶
- dot()¶
- fromObject()¶
- isNull()¶
- item()¶
- items()¶
- list()¶
- norm()¶
- norm2()¶
- normalize()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- setItems()¶
- class soma.aims.AimsVector_S16_2¶
Bases:
wrapper
- arraydata()¶
- assign()¶
- crossed()¶
- dnorm()¶
- dnorm2()¶
- dot()¶
- fromObject()¶
- isNull()¶
- item()¶
- items()¶
- list()¶
- norm()¶
- norm2()¶
- normalize()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- setItems()¶
- class soma.aims.AimsVector_S16_3¶
Bases:
wrapper
- arraydata()¶
- assign()¶
- crossed()¶
- dnorm()¶
- dnorm2()¶
- dot()¶
- fromObject()¶
- isNull()¶
- item()¶
- items()¶
- list()¶
- norm()¶
- norm2()¶
- normalize()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- setItems()¶
- class soma.aims.AimsVector_S16_4¶
Bases:
wrapper
- arraydata()¶
- assign()¶
- crossed()¶
- dnorm()¶
- dnorm2()¶
- dot()¶
- fromObject()¶
- isNull()¶
- item()¶
- items()¶
- list()¶
- norm()¶
- norm2()¶
- normalize()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- setItems()¶
- class soma.aims.AimsVector_S32_2¶
Bases:
wrapper
- arraydata()¶
- assign()¶
- crossed()¶
- dnorm()¶
- dnorm2()¶
- dot()¶
- fromObject()¶
- isNull()¶
- item()¶
- items()¶
- list()¶
- norm()¶
- norm2()¶
- normalize()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- setItems()¶
- class soma.aims.AimsVector_S32_3¶
Bases:
wrapper
- arraydata()¶
- assign()¶
- crossed()¶
- dnorm()¶
- dnorm2()¶
- dot()¶
- fromObject()¶
- isNull()¶
- item()¶
- items()¶
- list()¶
- norm()¶
- norm2()¶
- normalize()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- setItems()¶
- class soma.aims.AimsVector_S32_4¶
Bases:
wrapper
- arraydata()¶
- assign()¶
- crossed()¶
- dnorm()¶
- dnorm2()¶
- dot()¶
- fromObject()¶
- isNull()¶
- item()¶
- items()¶
- list()¶
- norm()¶
- norm2()¶
- normalize()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- setItems()¶
- class soma.aims.AimsVector_S64_2¶
Bases:
wrapper
- arraydata()¶
- assign()¶
- crossed()¶
- dnorm()¶
- dnorm2()¶
- dot()¶
- fromObject()¶
- isNull()¶
- item()¶
- items()¶
- list()¶
- norm()¶
- norm2()¶
- normalize()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- setItems()¶
- class soma.aims.AimsVector_S64_3¶
Bases:
wrapper
- arraydata()¶
- assign()¶
- crossed()¶
- dnorm()¶
- dnorm2()¶
- dot()¶
- fromObject()¶
- isNull()¶
- item()¶
- items()¶
- list()¶
- norm()¶
- norm2()¶
- normalize()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- setItems()¶
- class soma.aims.AimsVector_S64_4¶
Bases:
wrapper
- arraydata()¶
- assign()¶
- crossed()¶
- dnorm()¶
- dnorm2()¶
- dot()¶
- fromObject()¶
- isNull()¶
- item()¶
- items()¶
- list()¶
- norm()¶
- norm2()¶
- normalize()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- setItems()¶
- class soma.aims.AimsVector_U32_2¶
Bases:
wrapper
- arraydata()¶
- assign()¶
- crossed()¶
- dnorm()¶
- dnorm2()¶
- dot()¶
- fromObject()¶
- isNull()¶
- item()¶
- items()¶
- list()¶
- norm()¶
- norm2()¶
- normalize()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- setItems()¶
- class soma.aims.AimsVector_U32_3¶
Bases:
wrapper
- arraydata()¶
- assign()¶
- crossed()¶
- dnorm()¶
- dnorm2()¶
- dot()¶
- fromObject()¶
- isNull()¶
- item()¶
- items()¶
- list()¶
- norm()¶
- norm2()¶
- normalize()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- setItems()¶
- class soma.aims.AimsVector_U32_4¶
Bases:
wrapper
- arraydata()¶
- assign()¶
- crossed()¶
- dnorm()¶
- dnorm2()¶
- dot()¶
- fromObject()¶
- isNull()¶
- item()¶
- items()¶
- list()¶
- norm()¶
- norm2()¶
- normalize()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- setItems()¶
- exception soma.aims.AssertionError¶
Bases:
StdException
- class soma.aims.BorderFiller_BOOL¶
Bases:
wrapper
- fillConstant()¶
- static void fillConstant( rc_ptr_Volume_BOOL data,
const bool & value = 0, bool unread_only = false )
Fills volume border with a constant value. The function modifies the input data, and does not return a new one.
- Parameters:
data (Volume_BOOL instance to fill border.) –
value (bool value to fill border with (optional)) – Default is 0.
unread_only (bool (optional)) – For partial reading, fill the data only where it has not been read. Default is False
- fillMedian()¶
- static void fillMedian( rc_ptr_Volume_BOOL data,
Point4dl size = Point4dl(-1,-1,-1,-1), bool unreadOnly = false )
Fills the border with a median value. The median value is processed in the inside border. The function modifies the input data, and does not return a new one.
- Parameters:
data (Volume_BOOL instance to fill border.) –
size (Point4dl size of inside border to use to define median value) – [-1,-1,-1,-1] means that the median value is processed in the inside border of equal outside border size. if the outside border is of size (2, 2, 0) in dimensions x, y, z, the inside border is also of size (2, 2, 0) (optional). Default is [-1,-1,-1,-1].
unread_only (bool (optional)) – For partial reading, fill the data only where it has not been read. Default is False.
- fillMirror()¶
- static void fillMirror( rc_ptr_Volume_BOOL data,
bool unreadOnly = false )
Fills the border mirroring the inside border. The function modifies the input data, and does not return a new one.
- Parameters:
data (Volume_BOOL instance to fill border.) –
unread_only (bool (optional)) – For partial reading, fill the data only where it has not been read. Default is False.
- fillNearest()¶
- static void fillNearest( rc_ptr_Volume_BOOL data,
bool unreadOnly = false )
Fills the border with the nearest inside voxel value. The function modifies the input data, and does not return a new one.
- Parameters:
data (Volume_BOOL instance to fill border.) –
unread_only (bool (optional)) – For partial reading, fill the data only where it has not been read. Default is False.
- class soma.aims.BorderFiller_DOUBLE¶
Bases:
wrapper
- fillConstant()¶
- static void fillConstant( rc_ptr_Volume_DOUBLE data,
const double & value = 0, bool unread_only = false )
Fills volume border with a constant value. The function modifies the input data, and does not return a new one.
- Parameters:
data (Volume_DOUBLE instance to fill border.) –
value (double value to fill border with (optional)) – Default is 0.
unread_only (bool (optional)) – For partial reading, fill the data only where it has not been read. Default is False
- fillMedian()¶
- static void fillMedian( rc_ptr_Volume_DOUBLE data,
Point4dl size = Point4dl(-1,-1,-1,-1), bool unreadOnly = false )
Fills the border with a median value. The median value is processed in the inside border. The function modifies the input data, and does not return a new one.
- Parameters:
data (Volume_DOUBLE instance to fill border.) –
size (Point4dl size of inside border to use to define median value) – [-1,-1,-1,-1] means that the median value is processed in the inside border of equal outside border size. if the outside border is of size (2, 2, 0) in dimensions x, y, z, the inside border is also of size (2, 2, 0) (optional). Default is [-1,-1,-1,-1].
unread_only (bool (optional)) – For partial reading, fill the data only where it has not been read. Default is False.
- fillMirror()¶
- static void fillMirror( rc_ptr_Volume_DOUBLE data,
bool unreadOnly = false )
Fills the border mirroring the inside border. The function modifies the input data, and does not return a new one.
- Parameters:
data (Volume_DOUBLE instance to fill border.) –
unread_only (bool (optional)) – For partial reading, fill the data only where it has not been read. Default is False.
- fillNearest()¶
- static void fillNearest( rc_ptr_Volume_DOUBLE data,
bool unreadOnly = false )
Fills the border with the nearest inside voxel value. The function modifies the input data, and does not return a new one.
- Parameters:
data (Volume_DOUBLE instance to fill border.) –
unread_only (bool (optional)) – For partial reading, fill the data only where it has not been read. Default is False.
- class soma.aims.BorderFiller_FLOAT¶
Bases:
wrapper
- fillConstant()¶
- static void fillConstant( rc_ptr_Volume_FLOAT data,
const float & value = 0, bool unread_only = false )
Fills volume border with a constant value. The function modifies the input data, and does not return a new one.
- Parameters:
data (Volume_FLOAT instance to fill border.) –
value (float value to fill border with (optional)) – Default is 0.
unread_only (bool (optional)) – For partial reading, fill the data only where it has not been read. Default is False
- fillMedian()¶
- static void fillMedian( rc_ptr_Volume_FLOAT data,
Point4dl size = Point4dl(-1,-1,-1,-1), bool unreadOnly = false )
Fills the border with a median value. The median value is processed in the inside border. The function modifies the input data, and does not return a new one.
- Parameters:
data (Volume_FLOAT instance to fill border.) –
size (Point4dl size of inside border to use to define median value) – [-1,-1,-1,-1] means that the median value is processed in the inside border of equal outside border size. if the outside border is of size (2, 2, 0) in dimensions x, y, z, the inside border is also of size (2, 2, 0) (optional). Default is [-1,-1,-1,-1].
unread_only (bool (optional)) – For partial reading, fill the data only where it has not been read. Default is False.
- fillMirror()¶
- static void fillMirror( rc_ptr_Volume_FLOAT data,
bool unreadOnly = false )
Fills the border mirroring the inside border. The function modifies the input data, and does not return a new one.
- Parameters:
data (Volume_FLOAT instance to fill border.) –
unread_only (bool (optional)) – For partial reading, fill the data only where it has not been read. Default is False.
- fillNearest()¶
- static void fillNearest( rc_ptr_Volume_FLOAT data,
bool unreadOnly = false )
Fills the border with the nearest inside voxel value. The function modifies the input data, and does not return a new one.
- Parameters:
data (Volume_FLOAT instance to fill border.) –
unread_only (bool (optional)) – For partial reading, fill the data only where it has not been read. Default is False.
- class soma.aims.BorderFiller_RGB¶
Bases:
wrapper
- fillConstant()¶
- static void fillConstant( rc_ptr_Volume_RGB data,
const AimsRGB & value = 0, bool unread_only = false )
Fills volume border with a constant value. The function modifies the input data, and does not return a new one.
- Parameters:
data (Volume_RGB instance to fill border.) –
value (AimsRGB value to fill border with (optional)) – Default is 0.
unread_only (bool (optional)) – For partial reading, fill the data only where it has not been read. Default is False
- fillMedian()¶
- static void fillMedian( rc_ptr_Volume_RGB data,
Point4dl size = Point4dl(-1,-1,-1,-1), bool unreadOnly = false )
Fills the border with a median value. The median value is processed in the inside border. The function modifies the input data, and does not return a new one.
- Parameters:
data (Volume_RGB instance to fill border.) –
size (Point4dl size of inside border to use to define median value) – [-1,-1,-1,-1] means that the median value is processed in the inside border of equal outside border size. if the outside border is of size (2, 2, 0) in dimensions x, y, z, the inside border is also of size (2, 2, 0) (optional). Default is [-1,-1,-1,-1].
unread_only (bool (optional)) – For partial reading, fill the data only where it has not been read. Default is False.
- fillMirror()¶
- static void fillMirror( rc_ptr_Volume_RGB data,
bool unreadOnly = false )
Fills the border mirroring the inside border. The function modifies the input data, and does not return a new one.
- Parameters:
data (Volume_RGB instance to fill border.) –
unread_only (bool (optional)) – For partial reading, fill the data only where it has not been read. Default is False.
- fillNearest()¶
- static void fillNearest( rc_ptr_Volume_RGB data,
bool unreadOnly = false )
Fills the border with the nearest inside voxel value. The function modifies the input data, and does not return a new one.
- Parameters:
data (Volume_RGB instance to fill border.) –
unread_only (bool (optional)) – For partial reading, fill the data only where it has not been read. Default is False.
- class soma.aims.BorderFiller_RGBA¶
Bases:
wrapper
- fillConstant()¶
- static void fillConstant( rc_ptr_Volume_RGBA data,
const AimsRGBA & value = 0, bool unread_only = false )
Fills volume border with a constant value. The function modifies the input data, and does not return a new one.
- Parameters:
data (Volume_RGBA instance to fill border.) –
value (AimsRGBA value to fill border with (optional)) – Default is 0.
unread_only (bool (optional)) – For partial reading, fill the data only where it has not been read. Default is False
- fillMedian()¶
- static void fillMedian( rc_ptr_Volume_RGBA data,
Point4dl size = Point4dl(-1,-1,-1,-1), bool unreadOnly = false )
Fills the border with a median value. The median value is processed in the inside border. The function modifies the input data, and does not return a new one.
- Parameters:
data (Volume_RGBA instance to fill border.) –
size (Point4dl size of inside border to use to define median value) – [-1,-1,-1,-1] means that the median value is processed in the inside border of equal outside border size. if the outside border is of size (2, 2, 0) in dimensions x, y, z, the inside border is also of size (2, 2, 0) (optional). Default is [-1,-1,-1,-1].
unread_only (bool (optional)) – For partial reading, fill the data only where it has not been read. Default is False.
- fillMirror()¶
- static void fillMirror( rc_ptr_Volume_RGBA data,
bool unreadOnly = false )
Fills the border mirroring the inside border. The function modifies the input data, and does not return a new one.
- Parameters:
data (Volume_RGBA instance to fill border.) –
unread_only (bool (optional)) – For partial reading, fill the data only where it has not been read. Default is False.
- fillNearest()¶
- static void fillNearest( rc_ptr_Volume_RGBA data,
bool unreadOnly = false )
Fills the border with the nearest inside voxel value. The function modifies the input data, and does not return a new one.
- Parameters:
data (Volume_RGBA instance to fill border.) –
unread_only (bool (optional)) – For partial reading, fill the data only where it has not been read. Default is False.
- class soma.aims.BorderFiller_S16¶
Bases:
wrapper
- fillConstant()¶
- static void fillConstant( rc_ptr_Volume_S16 data,
const short & value = 0, bool unread_only = false )
Fills volume border with a constant value. The function modifies the input data, and does not return a new one.
- Parameters:
data (Volume_S16 instance to fill border.) –
value (short value to fill border with (optional)) – Default is 0.
unread_only (bool (optional)) – For partial reading, fill the data only where it has not been read. Default is False
- fillMedian()¶
- static void fillMedian( rc_ptr_Volume_S16 data,
Point4dl size = Point4dl(-1,-1,-1,-1), bool unreadOnly = false )
Fills the border with a median value. The median value is processed in the inside border. The function modifies the input data, and does not return a new one.
- Parameters:
data (Volume_S16 instance to fill border.) –
size (Point4dl size of inside border to use to define median value) – [-1,-1,-1,-1] means that the median value is processed in the inside border of equal outside border size. if the outside border is of size (2, 2, 0) in dimensions x, y, z, the inside border is also of size (2, 2, 0) (optional). Default is [-1,-1,-1,-1].
unread_only (bool (optional)) – For partial reading, fill the data only where it has not been read. Default is False.
- fillMirror()¶
- static void fillMirror( rc_ptr_Volume_S16 data,
bool unreadOnly = false )
Fills the border mirroring the inside border. The function modifies the input data, and does not return a new one.
- Parameters:
data (Volume_S16 instance to fill border.) –
unread_only (bool (optional)) – For partial reading, fill the data only where it has not been read. Default is False.
- fillNearest()¶
- static void fillNearest( rc_ptr_Volume_S16 data,
bool unreadOnly = false )
Fills the border with the nearest inside voxel value. The function modifies the input data, and does not return a new one.
- Parameters:
data (Volume_S16 instance to fill border.) –
unread_only (bool (optional)) – For partial reading, fill the data only where it has not been read. Default is False.
- class soma.aims.BorderFiller_S32¶
Bases:
wrapper
- fillConstant()¶
- static void fillConstant( rc_ptr_Volume_S32 data,
const int & value = 0, bool unread_only = false )
Fills volume border with a constant value. The function modifies the input data, and does not return a new one.
- Parameters:
data (Volume_S32 instance to fill border.) –
value (int value to fill border with (optional)) – Default is 0.
unread_only (bool (optional)) – For partial reading, fill the data only where it has not been read. Default is False
- fillMedian()¶
- static void fillMedian( rc_ptr_Volume_S32 data,
Point4dl size = Point4dl(-1,-1,-1,-1), bool unreadOnly = false )
Fills the border with a median value. The median value is processed in the inside border. The function modifies the input data, and does not return a new one.
- Parameters:
data (Volume_S32 instance to fill border.) –
size (Point4dl size of inside border to use to define median value) – [-1,-1,-1,-1] means that the median value is processed in the inside border of equal outside border size. if the outside border is of size (2, 2, 0) in dimensions x, y, z, the inside border is also of size (2, 2, 0) (optional). Default is [-1,-1,-1,-1].
unread_only (bool (optional)) – For partial reading, fill the data only where it has not been read. Default is False.
- fillMirror()¶
- static void fillMirror( rc_ptr_Volume_S32 data,
bool unreadOnly = false )
Fills the border mirroring the inside border. The function modifies the input data, and does not return a new one.
- Parameters:
data (Volume_S32 instance to fill border.) –
unread_only (bool (optional)) – For partial reading, fill the data only where it has not been read. Default is False.
- fillNearest()¶
- static void fillNearest( rc_ptr_Volume_S32 data,
bool unreadOnly = false )
Fills the border with the nearest inside voxel value. The function modifies the input data, and does not return a new one.
- Parameters:
data (Volume_S32 instance to fill border.) –
unread_only (bool (optional)) – For partial reading, fill the data only where it has not been read. Default is False.
- class soma.aims.BorderFiller_U16¶
Bases:
wrapper
- fillConstant()¶
- static void fillConstant( rc_ptr_Volume_U16 data,
const unsigned short & value = 0, bool unread_only = false )
Fills volume border with a constant value. The function modifies the input data, and does not return a new one.
- Parameters:
data (Volume_U16 instance to fill border.) –
value (unsigned short value to fill border with (optional)) – Default is 0.
unread_only (bool (optional)) – For partial reading, fill the data only where it has not been read. Default is False
- fillMedian()¶
- static void fillMedian( rc_ptr_Volume_U16 data,
Point4dl size = Point4dl(-1,-1,-1,-1), bool unreadOnly = false )
Fills the border with a median value. The median value is processed in the inside border. The function modifies the input data, and does not return a new one.
- Parameters:
data (Volume_U16 instance to fill border.) –
size (Point4dl size of inside border to use to define median value) – [-1,-1,-1,-1] means that the median value is processed in the inside border of equal outside border size. if the outside border is of size (2, 2, 0) in dimensions x, y, z, the inside border is also of size (2, 2, 0) (optional). Default is [-1,-1,-1,-1].
unread_only (bool (optional)) – For partial reading, fill the data only where it has not been read. Default is False.
- fillMirror()¶
- static void fillMirror( rc_ptr_Volume_U16 data,
bool unreadOnly = false )
Fills the border mirroring the inside border. The function modifies the input data, and does not return a new one.
- Parameters:
data (Volume_U16 instance to fill border.) –
unread_only (bool (optional)) – For partial reading, fill the data only where it has not been read. Default is False.
- fillNearest()¶
- static void fillNearest( rc_ptr_Volume_U16 data,
bool unreadOnly = false )
Fills the border with the nearest inside voxel value. The function modifies the input data, and does not return a new one.
- Parameters:
data (Volume_U16 instance to fill border.) –
unread_only (bool (optional)) – For partial reading, fill the data only where it has not been read. Default is False.
- class soma.aims.BorderFiller_U32¶
Bases:
wrapper
- fillConstant()¶
- static void fillConstant( rc_ptr_Volume_U32 data,
const unsigned & value = 0, bool unread_only = false )
Fills volume border with a constant value. The function modifies the input data, and does not return a new one.
- Parameters:
data (Volume_U32 instance to fill border.) –
value (unsigned value to fill border with (optional)) – Default is 0.
unread_only (bool (optional)) – For partial reading, fill the data only where it has not been read. Default is False
- fillMedian()¶
- static void fillMedian( rc_ptr_Volume_U32 data,
Point4dl size = Point4dl(-1,-1,-1,-1), bool unreadOnly = false )
Fills the border with a median value. The median value is processed in the inside border. The function modifies the input data, and does not return a new one.
- Parameters:
data (Volume_U32 instance to fill border.) –
size (Point4dl size of inside border to use to define median value) – [-1,-1,-1,-1] means that the median value is processed in the inside border of equal outside border size. if the outside border is of size (2, 2, 0) in dimensions x, y, z, the inside border is also of size (2, 2, 0) (optional). Default is [-1,-1,-1,-1].
unread_only (bool (optional)) – For partial reading, fill the data only where it has not been read. Default is False.
- fillMirror()¶
- static void fillMirror( rc_ptr_Volume_U32 data,
bool unreadOnly = false )
Fills the border mirroring the inside border. The function modifies the input data, and does not return a new one.
- Parameters:
data (Volume_U32 instance to fill border.) –
unread_only (bool (optional)) – For partial reading, fill the data only where it has not been read. Default is False.
- fillNearest()¶
- static void fillNearest( rc_ptr_Volume_U32 data,
bool unreadOnly = false )
Fills the border with the nearest inside voxel value. The function modifies the input data, and does not return a new one.
- Parameters:
data (Volume_U32 instance to fill border.) –
unread_only (bool (optional)) – For partial reading, fill the data only where it has not been read. Default is False.
- class soma.aims.BorderFiller_U8¶
Bases:
wrapper
- fillConstant()¶
- static void fillConstant( rc_ptr_Volume_U8 data,
const unsigned char & value = 0, bool unread_only = false )
Fills volume border with a constant value. The function modifies the input data, and does not return a new one.
- Parameters:
data (Volume_U8 instance to fill border.) –
value (unsigned char value to fill border with (optional)) – Default is 0.
unread_only (bool (optional)) – For partial reading, fill the data only where it has not been read. Default is False
- fillMedian()¶
- static void fillMedian( rc_ptr_Volume_U8 data,
Point4dl size = Point4dl(-1,-1,-1,-1), bool unreadOnly = false )
Fills the border with a median value. The median value is processed in the inside border. The function modifies the input data, and does not return a new one.
- Parameters:
data (Volume_U8 instance to fill border.) –
size (Point4dl size of inside border to use to define median value) – [-1,-1,-1,-1] means that the median value is processed in the inside border of equal outside border size. if the outside border is of size (2, 2, 0) in dimensions x, y, z, the inside border is also of size (2, 2, 0) (optional). Default is [-1,-1,-1,-1].
unread_only (bool (optional)) – For partial reading, fill the data only where it has not been read. Default is False.
- fillMirror()¶
- static void fillMirror( rc_ptr_Volume_U8 data,
bool unreadOnly = false )
Fills the border mirroring the inside border. The function modifies the input data, and does not return a new one.
- Parameters:
data (Volume_U8 instance to fill border.) –
unread_only (bool (optional)) – For partial reading, fill the data only where it has not been read. Default is False.
- fillNearest()¶
- static void fillNearest( rc_ptr_Volume_U8 data,
bool unreadOnly = false )
Fills the border with the nearest inside voxel value. The function modifies the input data, and does not return a new one.
- Parameters:
data (Volume_U8 instance to fill border.) –
unread_only (bool (optional)) – For partial reading, fill the data only where it has not been read. Default is False.
- soma.aims.BucketMap(*args, **kwargs)[source]¶
Create an instance of Aims bucket (BucketMap_<type>) from a type parameter, which may be specified as the dtype keyword argument, or as one of the arguments if one is identitied as a type.
The default type is ‘VOID’.
Type definitions should match those accepted by typeCode().
- class soma.aims.BucketMap_DOUBLE(*args)¶
Bases:
RCObject
- clear()¶
- erase()¶
- fromObject()¶
- header()¶
The header contains all meta-data.
- insert()¶
- items()¶
- iteritems()¶
- keys()¶
- merge()¶
- rcToObject()¶
- setSizeT()¶
- setSizeX()¶
- setSizeXYZT()¶
- setSizeY()¶
- setSizeZ()¶
- size()¶
- sizeT()¶
- sizeX()¶
- sizeY()¶
- sizeZ()¶
- class soma.aims.BucketMap_FLOAT(*args)¶
Bases:
RCObject
- clear()¶
- erase()¶
- fromObject()¶
- header()¶
The header contains all meta-data.
- insert()¶
- items()¶
- iteritems()¶
- keys()¶
- merge()¶
- rcToObject()¶
- setSizeT()¶
- setSizeX()¶
- setSizeXYZT()¶
- setSizeY()¶
- setSizeZ()¶
- size()¶
- sizeT()¶
- sizeX()¶
- sizeY()¶
- sizeZ()¶
- class soma.aims.BucketMap_S16(*args)¶
Bases:
RCObject
- clear()¶
- erase()¶
- fromObject()¶
- header()¶
The header contains all meta-data.
- insert()¶
- items()¶
- iteritems()¶
- keys()¶
- merge()¶
- rcToObject()¶
- setSizeT()¶
- setSizeX()¶
- setSizeXYZT()¶
- setSizeY()¶
- setSizeZ()¶
- size()¶
- sizeT()¶
- sizeX()¶
- sizeY()¶
- sizeZ()¶
- class soma.aims.BucketMap_S32(*args)¶
Bases:
RCObject
- clear()¶
- erase()¶
- fromObject()¶
- header()¶
The header contains all meta-data.
- insert()¶
- items()¶
- iteritems()¶
- keys()¶
- merge()¶
- rcToObject()¶
- setSizeT()¶
- setSizeX()¶
- setSizeXYZT()¶
- setSizeY()¶
- setSizeZ()¶
- size()¶
- sizeT()¶
- sizeX()¶
- sizeY()¶
- sizeZ()¶
- class soma.aims.BucketMap_U16(*args)¶
Bases:
RCObject
- clear()¶
- erase()¶
- fromObject()¶
- header()¶
The header contains all meta-data.
- insert()¶
- items()¶
- iteritems()¶
- keys()¶
- merge()¶
- rcToObject()¶
- setSizeT()¶
- setSizeX()¶
- setSizeXYZT()¶
- setSizeY()¶
- setSizeZ()¶
- size()¶
- sizeT()¶
- sizeX()¶
- sizeY()¶
- sizeZ()¶
- class soma.aims.BucketMap_U32(*args)¶
Bases:
RCObject
- clear()¶
- erase()¶
- fromObject()¶
- header()¶
The header contains all meta-data.
- insert()¶
- items()¶
- iteritems()¶
- keys()¶
- merge()¶
- rcToObject()¶
- setSizeT()¶
- setSizeX()¶
- setSizeXYZT()¶
- setSizeY()¶
- setSizeZ()¶
- size()¶
- sizeT()¶
- sizeX()¶
- sizeY()¶
- sizeZ()¶
- class soma.aims.BucketMap_VOID(*args)¶
Bases:
RCObject
- clear()¶
- erase()¶
- fromObject()¶
- header()¶
The header contains all meta-data.
- insert()¶
- items()¶
- iteritems()¶
- keys()¶
- merge()¶
- rcToObject()¶
- setSizeT()¶
- setSizeX()¶
- setSizeXYZT()¶
- setSizeY()¶
- setSizeZ()¶
- size()¶
- sizeT()¶
- sizeX()¶
- sizeY()¶
- sizeZ()¶
- class soma.aims.BucketUtil¶
Bases:
wrapper
Utility class related to buckets
- volumeFromBucket()¶
- volume, offser = BucketUtil.volumeFromBucket(bucket, borderwidth=0,
enable_shift=True)
Bucket to volume conversion. Compared to Converter_BucketMap_Volume, this function has options to handle min bounding box, and allows to have borders.
If enable_shift is False, the volume will start at coordinates (0, 0, 0), without an offset (thus the volume may be much lager than needed, or may not contain the whole bucket if it has negative coordinates). In such case, pos is not used (thus passing 0 is OK).
volume = BucketUtil.volumeFromBucket(bucket, bbmin, bmax, borderwidth=0)
Bucket to volume conversion. Compared to Converter_BucketMap_Volume, this function has options to handle bounding box, and allows to have borders.
- class soma.aims.BundleListener¶
Bases:
wrapper
Serial processing of bundles.
BundleListener listens events from a
BundleProducer
object, typically emitted when a new bundle starts or ends, a fiber starts or ends etc.To use it, BundleListener has to be subclassed and some of the following methods overloaded: * bundleStarted * bundleTerminated * fiberStarted * fiberTerminated * newFiberPoint * noMoreBundle
To connect the listener to a producer, use
BundleProducer::addBundleListener()
.Inherited classes may inherit both BundleListener and BundleProducer, if they are part of a processing chain.
- bundleStarted(producer, bundle_info)¶
- bundleTerminated(producer, bundle_info)¶
- fiberStarted(producer, bundle_info, fiber_info)¶
- fiberTerminated(producer, bundle_info, fiber_info)¶
- newFiberPoint(producer, bundle_info, fiber_info, point)¶
- noMoreBundle(producer)¶
- class soma.aims.BundleMotion¶
Bases:
BundleProducer
,BundleListener
- addFiberPoint()¶
- bundleStarted(producer, bundle_info)¶
- bundleTerminated(producer, bundle_info)¶
- fiberStarted(producer, bundle_info, fiber_info)¶
- fiberTerminated(producer, bundle_info, fiber_info)¶
- newFiberPoint(producer, bundle_info, fiber_info, point)¶
- noMoreBundle(producer)¶
- startBundle()¶
- startFiber()¶
- terminateBundle()¶
- terminateFiber()¶
- class soma.aims.BundleProducer¶
Bases:
wrapper
Serial processing of bundles.
BundleProducer emits events to a
BundleListener
object while walking through a bundles set structure (or a bundles file), typically when a new bundle starts or ends, a fiber starts or ends etc.To connect the listener to a producer, use
BundleProducer::addBundleListener()
.Inherited classes may inherit both BundleListener and BundleProducer, if they are part of a processing chain.
- addBundleListener(listener)¶
Connects a
BundleProducer
to aBunsdleListener
.
- addFiberPoint()¶
- noMoreBundle()¶
- startBundle()¶
- startFiber()¶
- terminateBundle()¶
- terminateFiber()¶
- class soma.aims.BundleROISelect¶
Bases:
BundleProducer
,BundleListener
- addFiberPoint()¶
- bundleStarted(producer, bundle_info)¶
- bundleTerminated(producer, bundle_info)¶
- fiberStarted(producer, bundle_info, fiber_info)¶
- fiberTerminated(producer, bundle_info, fiber_info)¶
- newFiberPoint(producer, bundle_info, fiber_info, point)¶
- noMoreBundle(producer)¶
- startBundle()¶
- startFiber()¶
- terminateBundle()¶
- terminateFiber()¶
- class soma.aims.BundleROISplit¶
Bases:
BundleProducer
,BundleListener
- addFiberPoint()¶
- bundleStarted(producer, bundle_info)¶
- bundleTerminated(producer, bundle_info)¶
- fiberStarted(producer, bundle_info, fiber_info)¶
- fiberTerminated(producer, bundle_info, fiber_info)¶
- newFiberPoint(producer, bundle_info, fiber_info, point)¶
- noMoreBundle(producer)¶
- startBundle()¶
- startFiber()¶
- terminateBundle()¶
- terminateFiber()¶
- class soma.aims.BundleReader¶
Bases:
BundleProducer
Reads a bundles file, and emits events while walking through its data.
BundleReader is a
BundleProducer
, so can be listened by anyBundleListener
. It may read several bundles/fibers formats, using a lower-levelBundleProducer
dedicated to a specific format.Currently
.bundles
(AIMS/Connectomist) and.trk
(Trackvis) formats are supported.- addFiberPoint()¶
- formatExtensions(format='ALL')¶
return a set of file extensions associated with the given format. If the format is “ALL” (default) then all extensions of all supported formats are returned. If the format does not exist, an empty set is returned, and no error is issued.
- noMoreBundle()¶
- read()¶
read() is the entry point to fibers processing, and triggers the producer machinery.
- startBundle()¶
- startFiber()¶
- supportedFormats()¶
return a set of fiber tracts formats names supported by the BundlesReader.
- terminateBundle()¶
- terminateFiber()¶
- class soma.aims.BundleSampler¶
Bases:
BundleProducer
,BundleListener
- addFiberPoint()¶
- bundleStarted(producer, bundle_info)¶
- bundleTerminated(producer, bundle_info)¶
- fiberStarted(producer, bundle_info, fiber_info)¶
- fiberTerminated(producer, bundle_info, fiber_info)¶
- newFiberPoint(producer, bundle_info, fiber_info, point)¶
- noMoreBundle(producer)¶
- startBundle()¶
- startFiber()¶
- terminateBundle()¶
- terminateFiber()¶
- class soma.aims.BundleToGraph¶
Bases:
BundleListener
,PropertySet
Bundles structure building as a Graph
The
Graph
structure is used to represent bundles and fibers when we need to keep their complete structure in memory. This structure is especially used for 3D rendering in Anatomist.BundleToGraph is a
BundleListener
, thus has to be connected to aBundleProducer
to work (typically, aBundleReader
).Note that the BundleProducer / BundleListener system work as processing chains, and allows to keep only a small set of data in memory at one time. The Graph structure, on the contrary, keeps all information in memory, so may need a large amount of memory.
- bundleStarted(producer, bundle_info)¶
- bundleTerminated(producer, bundle_info)¶
- fiberStarted(producer, bundle_info, fiber_info)¶
- fiberTerminated(producer, bundle_info, fiber_info)¶
- newFiberPoint(producer, bundle_info, fiber_info, point)¶
- noMoreBundle(producer)¶
- class soma.aims.BundleToGraphWriter¶
Bases:
BundleToGraph
- bundleStarted(producer, bundle_info)¶
- bundleTerminated(producer, bundle_info)¶
- fiberStarted(producer, bundle_info, fiber_info)¶
- fiberTerminated(producer, bundle_info, fiber_info)¶
- newFiberPoint(producer, bundle_info, fiber_info, point)¶
- noMoreBundle(producer)¶
- setFileString()¶
- class soma.aims.BundleWriter¶
Bases:
BundleListener
,PropertySet
Writes bundles information to a bundles file.
BundleWriter is a
BundleListener
, thus must be connected to aBundleProducer
, and is fed by it.It will write the
.bundles
format.- bundleStarted(producer, bundle_info)¶
- bundleTerminated(producer, bundle_info)¶
- fiberStarted(producer, bundle_info, fiber_info)¶
- fiberTerminated(producer, bundle_info, fiber_info)¶
- newFiberPoint(producer, bundle_info, fiber_info, point)¶
- noMoreBundle(producer)¶
- setFileString(filename)¶
Set the output file name.
- class soma.aims.BundlesSlicer¶
Bases:
BundleListener
- addBundlesSlicerListener()¶
- bundleStarted(producer, bundle_info)¶
- bundleTerminated(producer, bundle_info)¶
- fiberStarted(producer, bundle_info, fiber_info)¶
- fiberTerminated(producer, bundle_info, fiber_info)¶
- newFiberPoint(producer, bundle_info, fiber_info, point)¶
- noMoreBundle(producer)¶
- class soma.aims.BundlesSlicerListener¶
Bases:
wrapper
- newBundleSlice()¶
- noMoreBundleSlice()¶
- startBundleSlicing()¶
- terminateBundleSlicing()¶
- class soma.aims.CiftiTools(matrix, smap={})¶
Bases:
wrapper
- Parameters:
mat (rc_ptr_SparseOrDenseMatrix) – matrix with CIFTI header (typically, read from CIFTI format via aims.read())
smap (map_STRING_S32) – brain structure name to mesh number map: defaults to the result of defaultBrainStructureToMeshMap()
CIFTI-2 shaped matrices manipulation tools.
This class eases manipulation of matrices (SparseOrDenseMatrix) with CIFTI information in their header. CIFTI information specify the nature of data contained in the matrix, and can bring ROIs or parcellations information.
Mainly one can obtain textures to map matrix information onto meshes. Textures may be ROI information (label textures, TimeTexture_S32), or matrix values textures, possibly expanded onto brain regions (TimeTexture_FLOAT in this case).
- brainStructureMap()¶
- buildDimensionObjectFromLabelsTexture()¶
- defaultBrainStructureToMeshMap()¶
Define the brain structure to mesh mapping: several meshes may be involved in CIFTI data mapping (typically a left hemisphere mesh and a right
- Returns:
mesh_map – mesh identifier to index mapping
- Return type:
map_STRING_S32
- dimensionType()¶
- expandedValueTextureFromDimension(dim, other_dim_index_pos)¶
Get matrix data in textures, possibly expanded to regions if needed.
Parcels data will be expanded to all vertices of each parcel, etc. The resulting textures can be mapped on appropriate brain meshes.
- Parameters:
dim (int) – dimension in the matrix to get info for
other_dim_index_pos (vector_S32) – position in fixed dimensions. Actually all dimensions must be specified (the size of this list must match the number of dimensions) but the specified dimension position will not be used (since all values will be extracted in textures), and possibly another one (scalars, series, labels dimension will be extracted in time steps or several textures).
- Returns:
textures – Scalar or time series data will be stored in texture timepoints. Labels data will be stored in separate textures because they provide possibly different colormaps. In this case the returned list will have the size meshes_number * labels_number, and will be stored in this order: [mesh0_label0, mesh1_label0, .. meshN_label0, mesh0_label1, ..
meshN_label1, .. mesh0_label0, .. meshN_labelM]
- Return type:
- getBrainStructureMeshNumberOfNodes()¶
- getBrainStructures(dim, keepSurfaces=True, keepVoxels=True)¶
Retreive brain structures list in a brain models dimension
- getDimensionObject()¶
- getIndicesForBrainStructure(dim, struct_name)¶
Get the list of indices corresponding to a given brain structure in the matrix, on a given dimension.
- getIndicesForSurfaceIndices(dim, surface_num, roi_indices)¶
Get the list of matrix indices corresponding to a given region on a mesh, for a given dimension.
- Parameters:
- Returns:
indices – list of indices in the matrix
- Return type:
- isMatchingSurface()¶
- isMatchingSurfaceOrTexture()¶
- isMatchingTexture()¶
- matrix()¶
- roiTextureFromDimension(dim)¶
Get ROI information for a given matrix dimension.
If the matrix dimension defines ROIs (parcels, brain regions), textures defining these regions are built.
If the matrix dimension defines labels, an empty texture will be created, with appropriate colormap information
If the matrix dimensions defines scalars or series, this function will probably not be useful.
- Parameters:
dim (int) – dimension in the matrix to get info for
- Returns:
textures – textures of regions, possibly with colormaps in headers, for regions, parcels etc. One texture per mesh. For scalars or series, the list will be empty since no particular ROI description is contained in the header for this dimension.
- Return type:
- setBrainStructureMap()¶
- setMatrix()¶
- valuesDimNum()¶
- valuesDimSize()¶
- class soma.aims.Connectivity¶
Bases:
wrapper
- CONNECTIVITY_18_XYZ = 7¶
- CONNECTIVITY_26_XYZ = 8¶
- CONNECTIVITY_4_XY = 0¶
- CONNECTIVITY_4_XYdiag = 28¶
- CONNECTIVITY_4_XZ = 1¶
- CONNECTIVITY_4_XZdiag = 29¶
- CONNECTIVITY_4_YZ = 2¶
- CONNECTIVITY_4_YZdiag = 30¶
- CONNECTIVITY_5_XYminus = 17¶
- CONNECTIVITY_5_XYplus = 18¶
- CONNECTIVITY_5_XZminus = 21¶
- CONNECTIVITY_5_XZplus = 22¶
- CONNECTIVITY_5_XminusY = 15¶
- CONNECTIVITY_5_XminusZ = 19¶
- CONNECTIVITY_5_XplusY = 16¶
- CONNECTIVITY_5_XplusZ = 20¶
- CONNECTIVITY_5_YZminus = 25¶
- CONNECTIVITY_5_YZplus = 26¶
- CONNECTIVITY_5_YminusZ = 23¶
- CONNECTIVITY_5_YplusZ = 24¶
- CONNECTIVITY_6_XYZ = 3¶
- CONNECTIVITY_8_XY = 4¶
- CONNECTIVITY_8_XYZ = 27¶
- CONNECTIVITY_8_XZ = 5¶
- CONNECTIVITY_8_YZ = 6¶
- CONNECTIVITY_9_XY_Zminus = 9¶
- CONNECTIVITY_9_XY_Zplus = 10¶
- CONNECTIVITY_9_XZ_Yminus = 11¶
- CONNECTIVITY_9_XZ_Yplus = 12¶
- CONNECTIVITY_9_YZ_Xminus = 13¶
- CONNECTIVITY_9_YZ_Xplus = 14¶
- dir()¶
- nbNeighbors()¶
- offset()¶
- type()¶
- type_from_string()¶
- type_string()¶
- type_to_string()¶
- xyzOffset()¶
- soma.aims.Converter(*args, **kwargs)[source]¶
Create a Converter instance from input and output types. Types may be passed as keyword arguments intype and outtype, or dtype if both are the same (not very useful for a converter). Otherwise the arguments are parsed to find types arguments.
Types may be specified as allowed by typeCode().
Note that for volumes, the method
astype
is often more convenient than using a Converter object (with the same result).
- class soma.aims.Converter_BucketMap_DOUBLE_rc_ptr_Volume_DOUBLE¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (BucketMap_DOUBLE) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (BucketMap_DOUBLE) – data to be converted
output_data (rc_ptr_Volume_DOUBLE) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_BucketMap_DOUBLE_rc_ptr_Volume_FLOAT¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (BucketMap_DOUBLE) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (BucketMap_DOUBLE) – data to be converted
output_data (rc_ptr_Volume_FLOAT) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_BucketMap_DOUBLE_rc_ptr_Volume_S16¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (BucketMap_DOUBLE) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (BucketMap_DOUBLE) – data to be converted
output_data (rc_ptr_Volume_S16) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_BucketMap_DOUBLE_rc_ptr_Volume_S32¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (BucketMap_DOUBLE) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (BucketMap_DOUBLE) – data to be converted
output_data (rc_ptr_Volume_S32) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_BucketMap_DOUBLE_rc_ptr_Volume_U16¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (BucketMap_DOUBLE) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (BucketMap_DOUBLE) – data to be converted
output_data (rc_ptr_Volume_U16) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_BucketMap_DOUBLE_rc_ptr_Volume_U32¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (BucketMap_DOUBLE) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (BucketMap_DOUBLE) – data to be converted
output_data (rc_ptr_Volume_U32) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_BucketMap_DOUBLE_rc_ptr_Volume_U8¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (BucketMap_DOUBLE) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (BucketMap_DOUBLE) – data to be converted
output_data (rc_ptr_Volume_U8) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_BucketMap_FLOAT_rc_ptr_Volume_DOUBLE¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (BucketMap_FLOAT) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (BucketMap_FLOAT) – data to be converted
output_data (rc_ptr_Volume_DOUBLE) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_BucketMap_FLOAT_rc_ptr_Volume_FLOAT¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (BucketMap_FLOAT) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (BucketMap_FLOAT) – data to be converted
output_data (rc_ptr_Volume_FLOAT) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_BucketMap_FLOAT_rc_ptr_Volume_S16¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (BucketMap_FLOAT) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (BucketMap_FLOAT) – data to be converted
output_data (rc_ptr_Volume_S16) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_BucketMap_FLOAT_rc_ptr_Volume_S32¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (BucketMap_FLOAT) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (BucketMap_FLOAT) – data to be converted
output_data (rc_ptr_Volume_S32) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_BucketMap_FLOAT_rc_ptr_Volume_U16¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (BucketMap_FLOAT) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (BucketMap_FLOAT) – data to be converted
output_data (rc_ptr_Volume_U16) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_BucketMap_FLOAT_rc_ptr_Volume_U32¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (BucketMap_FLOAT) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (BucketMap_FLOAT) – data to be converted
output_data (rc_ptr_Volume_U32) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_BucketMap_FLOAT_rc_ptr_Volume_U8¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (BucketMap_FLOAT) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (BucketMap_FLOAT) – data to be converted
output_data (rc_ptr_Volume_U8) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_BucketMap_S16_rc_ptr_Volume_DOUBLE¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (BucketMap_S16) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (BucketMap_S16) – data to be converted
output_data (rc_ptr_Volume_DOUBLE) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_BucketMap_S16_rc_ptr_Volume_FLOAT¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (BucketMap_S16) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (BucketMap_S16) – data to be converted
output_data (rc_ptr_Volume_FLOAT) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_BucketMap_S16_rc_ptr_Volume_S16¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (BucketMap_S16) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (BucketMap_S16) – data to be converted
output_data (rc_ptr_Volume_S16) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_BucketMap_S16_rc_ptr_Volume_S32¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (BucketMap_S16) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (BucketMap_S16) – data to be converted
output_data (rc_ptr_Volume_S32) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_BucketMap_S16_rc_ptr_Volume_U16¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (BucketMap_S16) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (BucketMap_S16) – data to be converted
output_data (rc_ptr_Volume_U16) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_BucketMap_S16_rc_ptr_Volume_U32¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (BucketMap_S16) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (BucketMap_S16) – data to be converted
output_data (rc_ptr_Volume_U32) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_BucketMap_S16_rc_ptr_Volume_U8¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (BucketMap_S16) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (BucketMap_S16) – data to be converted
output_data (rc_ptr_Volume_U8) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_BucketMap_S32_rc_ptr_Volume_DOUBLE¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (BucketMap_S32) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (BucketMap_S32) – data to be converted
output_data (rc_ptr_Volume_DOUBLE) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_BucketMap_S32_rc_ptr_Volume_FLOAT¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (BucketMap_S32) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (BucketMap_S32) – data to be converted
output_data (rc_ptr_Volume_FLOAT) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_BucketMap_S32_rc_ptr_Volume_S16¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (BucketMap_S32) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (BucketMap_S32) – data to be converted
output_data (rc_ptr_Volume_S16) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_BucketMap_S32_rc_ptr_Volume_S32¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (BucketMap_S32) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (BucketMap_S32) – data to be converted
output_data (rc_ptr_Volume_S32) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_BucketMap_S32_rc_ptr_Volume_U16¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (BucketMap_S32) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (BucketMap_S32) – data to be converted
output_data (rc_ptr_Volume_U16) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_BucketMap_S32_rc_ptr_Volume_U32¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (BucketMap_S32) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (BucketMap_S32) – data to be converted
output_data (rc_ptr_Volume_U32) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_BucketMap_S32_rc_ptr_Volume_U8¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (BucketMap_S32) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (BucketMap_S32) – data to be converted
output_data (rc_ptr_Volume_U8) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_BucketMap_U16_rc_ptr_Volume_DOUBLE¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (BucketMap_U16) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (BucketMap_U16) – data to be converted
output_data (rc_ptr_Volume_DOUBLE) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_BucketMap_U16_rc_ptr_Volume_FLOAT¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (BucketMap_U16) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (BucketMap_U16) – data to be converted
output_data (rc_ptr_Volume_FLOAT) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_BucketMap_U16_rc_ptr_Volume_S16¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (BucketMap_U16) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (BucketMap_U16) – data to be converted
output_data (rc_ptr_Volume_S16) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_BucketMap_U16_rc_ptr_Volume_S32¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (BucketMap_U16) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (BucketMap_U16) – data to be converted
output_data (rc_ptr_Volume_S32) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_BucketMap_U16_rc_ptr_Volume_U16¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (BucketMap_U16) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (BucketMap_U16) – data to be converted
output_data (rc_ptr_Volume_U16) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_BucketMap_U16_rc_ptr_Volume_U32¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (BucketMap_U16) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (BucketMap_U16) – data to be converted
output_data (rc_ptr_Volume_U32) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_BucketMap_U16_rc_ptr_Volume_U8¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (BucketMap_U16) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (BucketMap_U16) – data to be converted
output_data (rc_ptr_Volume_U8) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_BucketMap_U32_rc_ptr_Volume_DOUBLE¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (BucketMap_U32) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (BucketMap_U32) – data to be converted
output_data (rc_ptr_Volume_DOUBLE) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_BucketMap_U32_rc_ptr_Volume_FLOAT¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (BucketMap_U32) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (BucketMap_U32) – data to be converted
output_data (rc_ptr_Volume_FLOAT) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_BucketMap_U32_rc_ptr_Volume_S16¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (BucketMap_U32) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (BucketMap_U32) – data to be converted
output_data (rc_ptr_Volume_S16) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_BucketMap_U32_rc_ptr_Volume_S32¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (BucketMap_U32) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (BucketMap_U32) – data to be converted
output_data (rc_ptr_Volume_S32) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_BucketMap_U32_rc_ptr_Volume_U16¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (BucketMap_U32) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (BucketMap_U32) – data to be converted
output_data (rc_ptr_Volume_U16) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_BucketMap_U32_rc_ptr_Volume_U32¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (BucketMap_U32) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (BucketMap_U32) – data to be converted
output_data (rc_ptr_Volume_U32) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_BucketMap_U32_rc_ptr_Volume_U8¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (BucketMap_U32) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (BucketMap_U32) – data to be converted
output_data (rc_ptr_Volume_U8) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_BucketMap_VOID_rc_ptr_Volume_DOUBLE¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (BucketMap_VOID) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (BucketMap_VOID) – data to be converted
output_data (rc_ptr_Volume_DOUBLE) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_BucketMap_VOID_rc_ptr_Volume_FLOAT¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (BucketMap_VOID) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (BucketMap_VOID) – data to be converted
output_data (rc_ptr_Volume_FLOAT) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_BucketMap_VOID_rc_ptr_Volume_S16¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (BucketMap_VOID) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (BucketMap_VOID) – data to be converted
output_data (rc_ptr_Volume_S16) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_BucketMap_VOID_rc_ptr_Volume_S32¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (BucketMap_VOID) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (BucketMap_VOID) – data to be converted
output_data (rc_ptr_Volume_S32) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_BucketMap_VOID_rc_ptr_Volume_U16¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (BucketMap_VOID) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (BucketMap_VOID) – data to be converted
output_data (rc_ptr_Volume_U16) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_BucketMap_VOID_rc_ptr_Volume_U32¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (BucketMap_VOID) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (BucketMap_VOID) – data to be converted
output_data (rc_ptr_Volume_U32) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_BucketMap_VOID_rc_ptr_Volume_U8¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (BucketMap_VOID) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (BucketMap_VOID) – data to be converted
output_data (rc_ptr_Volume_U8) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_DOUBLE_Volume_DOUBLE¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_DOUBLE) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_DOUBLE) – data to be converted
output_data (Volume_DOUBLE) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_DOUBLE_Volume_FLOAT¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_DOUBLE) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_DOUBLE) – data to be converted
output_data (Volume_FLOAT) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_DOUBLE_Volume_HSV¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_DOUBLE) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_DOUBLE) – data to be converted
output_data (Volume_HSV) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_DOUBLE_Volume_RGB¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_DOUBLE) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_DOUBLE) – data to be converted
output_data (Volume_RGB) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_DOUBLE_Volume_RGBA¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_DOUBLE) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_DOUBLE) – data to be converted
output_data (Volume_RGBA) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_DOUBLE_Volume_S16¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_DOUBLE) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_DOUBLE) – data to be converted
output_data (Volume_S16) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_DOUBLE_Volume_S32¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_DOUBLE) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_DOUBLE) – data to be converted
output_data (Volume_S32) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_DOUBLE_Volume_U16¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_DOUBLE) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_DOUBLE) – data to be converted
output_data (Volume_U16) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_DOUBLE_Volume_U32¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_DOUBLE) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_DOUBLE) – data to be converted
output_data (Volume_U32) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_DOUBLE_Volume_U8¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_DOUBLE) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_DOUBLE) – data to be converted
output_data (Volume_U8) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_FLOAT_Volume_DOUBLE¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_FLOAT) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_FLOAT) – data to be converted
output_data (Volume_DOUBLE) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_FLOAT_Volume_FLOAT¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_FLOAT) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_FLOAT) – data to be converted
output_data (Volume_FLOAT) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_FLOAT_Volume_HSV¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_FLOAT) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_FLOAT) – data to be converted
output_data (Volume_HSV) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_FLOAT_Volume_RGB¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_FLOAT) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_FLOAT) – data to be converted
output_data (Volume_RGB) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_FLOAT_Volume_RGBA¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_FLOAT) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_FLOAT) – data to be converted
output_data (Volume_RGBA) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_FLOAT_Volume_S16¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_FLOAT) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_FLOAT) – data to be converted
output_data (Volume_S16) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_FLOAT_Volume_S32¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_FLOAT) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_FLOAT) – data to be converted
output_data (Volume_S32) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_FLOAT_Volume_U16¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_FLOAT) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_FLOAT) – data to be converted
output_data (Volume_U16) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_FLOAT_Volume_U32¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_FLOAT) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_FLOAT) – data to be converted
output_data (Volume_U32) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_FLOAT_Volume_U8¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_FLOAT) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_FLOAT) – data to be converted
output_data (Volume_U8) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_HSV_Volume_DOUBLE¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_HSV) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_HSV) – data to be converted
output_data (Volume_DOUBLE) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_HSV_Volume_FLOAT¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_HSV) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_HSV) – data to be converted
output_data (Volume_FLOAT) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_HSV_Volume_HSV¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_HSV) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_HSV) – data to be converted
output_data (Volume_HSV) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_HSV_Volume_RGB¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_HSV) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_HSV) – data to be converted
output_data (Volume_RGB) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_HSV_Volume_RGBA¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_HSV) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_HSV) – data to be converted
output_data (Volume_RGBA) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_HSV_Volume_S16¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_HSV) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_HSV) – data to be converted
output_data (Volume_S16) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_HSV_Volume_S32¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_HSV) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_HSV) – data to be converted
output_data (Volume_S32) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_HSV_Volume_U16¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_HSV) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_HSV) – data to be converted
output_data (Volume_U16) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_HSV_Volume_U32¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_HSV) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_HSV) – data to be converted
output_data (Volume_U32) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_HSV_Volume_U8¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_HSV) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_HSV) – data to be converted
output_data (Volume_U8) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_RGBA_Volume_DOUBLE¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_RGBA) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_RGBA) – data to be converted
output_data (Volume_DOUBLE) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_RGBA_Volume_FLOAT¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_RGBA) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_RGBA) – data to be converted
output_data (Volume_FLOAT) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_RGBA_Volume_HSV¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_RGBA) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_RGBA) – data to be converted
output_data (Volume_HSV) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_RGBA_Volume_RGB¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_RGBA) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_RGBA) – data to be converted
output_data (Volume_RGB) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_RGBA_Volume_RGBA¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_RGBA) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_RGBA) – data to be converted
output_data (Volume_RGBA) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_RGBA_Volume_S16¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_RGBA) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_RGBA) – data to be converted
output_data (Volume_S16) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_RGBA_Volume_S32¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_RGBA) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_RGBA) – data to be converted
output_data (Volume_S32) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_RGBA_Volume_U16¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_RGBA) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_RGBA) – data to be converted
output_data (Volume_U16) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_RGBA_Volume_U32¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_RGBA) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_RGBA) – data to be converted
output_data (Volume_U32) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_RGBA_Volume_U8¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_RGBA) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_RGBA) – data to be converted
output_data (Volume_U8) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_RGB_Volume_DOUBLE¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_RGB) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_RGB) – data to be converted
output_data (Volume_DOUBLE) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_RGB_Volume_FLOAT¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_RGB) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_RGB) – data to be converted
output_data (Volume_FLOAT) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_RGB_Volume_HSV¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_RGB) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_RGB) – data to be converted
output_data (Volume_HSV) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_RGB_Volume_RGB¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_RGB) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_RGB) – data to be converted
output_data (Volume_RGB) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_RGB_Volume_RGBA¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_RGB) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_RGB) – data to be converted
output_data (Volume_RGBA) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_RGB_Volume_S16¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_RGB) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_RGB) – data to be converted
output_data (Volume_S16) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_RGB_Volume_S32¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_RGB) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_RGB) – data to be converted
output_data (Volume_S32) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_RGB_Volume_U16¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_RGB) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_RGB) – data to be converted
output_data (Volume_U16) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_RGB_Volume_U32¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_RGB) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_RGB) – data to be converted
output_data (Volume_U32) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_RGB_Volume_U8¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_RGB) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_RGB) – data to be converted
output_data (Volume_U8) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_S16_Volume_DOUBLE¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_S16) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_S16) – data to be converted
output_data (Volume_DOUBLE) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_S16_Volume_FLOAT¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_S16) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_S16) – data to be converted
output_data (Volume_FLOAT) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_S16_Volume_HSV¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_S16) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_S16) – data to be converted
output_data (Volume_HSV) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_S16_Volume_RGB¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_S16) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_S16) – data to be converted
output_data (Volume_RGB) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_S16_Volume_RGBA¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_S16) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_S16) – data to be converted
output_data (Volume_RGBA) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_S16_Volume_S16¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_S16) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_S16) – data to be converted
output_data (Volume_S16) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_S16_Volume_S32¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_S16) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_S16) – data to be converted
output_data (Volume_S32) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_S16_Volume_U16¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_S16) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_S16) – data to be converted
output_data (Volume_U16) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_S16_Volume_U32¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_S16) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_S16) – data to be converted
output_data (Volume_U32) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_S16_Volume_U8¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_S16) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_S16) – data to be converted
output_data (Volume_U8) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_S32_Volume_DOUBLE¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_S32) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_S32) – data to be converted
output_data (Volume_DOUBLE) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_S32_Volume_FLOAT¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_S32) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_S32) – data to be converted
output_data (Volume_FLOAT) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_S32_Volume_HSV¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_S32) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_S32) – data to be converted
output_data (Volume_HSV) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_S32_Volume_RGB¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_S32) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_S32) – data to be converted
output_data (Volume_RGB) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_S32_Volume_RGBA¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_S32) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_S32) – data to be converted
output_data (Volume_RGBA) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_S32_Volume_S16¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_S32) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_S32) – data to be converted
output_data (Volume_S16) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_S32_Volume_S32¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_S32) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_S32) – data to be converted
output_data (Volume_S32) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_S32_Volume_U16¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_S32) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_S32) – data to be converted
output_data (Volume_U16) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_S32_Volume_U32¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_S32) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_S32) – data to be converted
output_data (Volume_U32) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_S32_Volume_U8¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_S32) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_S32) – data to be converted
output_data (Volume_U8) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_U16_Volume_DOUBLE¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_U16) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_U16) – data to be converted
output_data (Volume_DOUBLE) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_U16_Volume_FLOAT¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_U16) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_U16) – data to be converted
output_data (Volume_FLOAT) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_U16_Volume_HSV¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_U16) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_U16) – data to be converted
output_data (Volume_HSV) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_U16_Volume_RGB¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_U16) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_U16) – data to be converted
output_data (Volume_RGB) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_U16_Volume_RGBA¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_U16) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_U16) – data to be converted
output_data (Volume_RGBA) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_U16_Volume_S16¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_U16) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_U16) – data to be converted
output_data (Volume_S16) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_U16_Volume_S32¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_U16) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_U16) – data to be converted
output_data (Volume_S32) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_U16_Volume_U16¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_U16) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_U16) – data to be converted
output_data (Volume_U16) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_U16_Volume_U32¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_U16) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_U16) – data to be converted
output_data (Volume_U32) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_U16_Volume_U8¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_U16) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_U16) – data to be converted
output_data (Volume_U8) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_U32_Volume_DOUBLE¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_U32) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_U32) – data to be converted
output_data (Volume_DOUBLE) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_U32_Volume_FLOAT¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_U32) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_U32) – data to be converted
output_data (Volume_FLOAT) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_U32_Volume_HSV¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_U32) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_U32) – data to be converted
output_data (Volume_HSV) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_U32_Volume_RGB¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_U32) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_U32) – data to be converted
output_data (Volume_RGB) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_U32_Volume_RGBA¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_U32) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_U32) – data to be converted
output_data (Volume_RGBA) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_U32_Volume_S16¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_U32) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_U32) – data to be converted
output_data (Volume_S16) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_U32_Volume_S32¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_U32) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_U32) – data to be converted
output_data (Volume_S32) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_U32_Volume_U16¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_U32) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_U32) – data to be converted
output_data (Volume_U16) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_U32_Volume_U32¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_U32) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_U32) – data to be converted
output_data (Volume_U32) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_U32_Volume_U8¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_U32) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_U32) – data to be converted
output_data (Volume_U8) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_U8_Volume_DOUBLE¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_U8) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_U8) – data to be converted
output_data (Volume_DOUBLE) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_U8_Volume_FLOAT¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_U8) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_U8) – data to be converted
output_data (Volume_FLOAT) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_U8_Volume_HSV¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_U8) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_U8) – data to be converted
output_data (Volume_HSV) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_U8_Volume_RGB¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_U8) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_U8) – data to be converted
output_data (Volume_RGB) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_U8_Volume_RGBA¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_U8) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_U8) – data to be converted
output_data (Volume_RGBA) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_U8_Volume_S16¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_U8) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_U8) – data to be converted
output_data (Volume_S16) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_U8_Volume_S32¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_U8) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_U8) – data to be converted
output_data (Volume_S32) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_U8_Volume_U16¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_U8) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_U8) – data to be converted
output_data (Volume_U16) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_U8_Volume_U32¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_U8) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (Volume_U8) – data to be converted
output_data (Volume_U32) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_Volume_U8_Volume_U8¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (Volume_U8) – data to be converted
- Returns:
output data – converted data
- Return type:
- class soma.aims.Converter_rc_ptr_Volume_DOUBLE_BucketMap_DOUBLE¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (rc_ptr_Volume_DOUBLE) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (rc_ptr_Volume_DOUBLE) – data to be converted
output_data (BucketMap_DOUBLE) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_rc_ptr_Volume_DOUBLE_BucketMap_FLOAT¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (rc_ptr_Volume_DOUBLE) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (rc_ptr_Volume_DOUBLE) – data to be converted
output_data (BucketMap_FLOAT) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_rc_ptr_Volume_DOUBLE_BucketMap_S16¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (rc_ptr_Volume_DOUBLE) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (rc_ptr_Volume_DOUBLE) – data to be converted
output_data (BucketMap_S16) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_rc_ptr_Volume_DOUBLE_BucketMap_S32¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (rc_ptr_Volume_DOUBLE) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (rc_ptr_Volume_DOUBLE) – data to be converted
output_data (BucketMap_S32) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_rc_ptr_Volume_DOUBLE_BucketMap_U16¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (rc_ptr_Volume_DOUBLE) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (rc_ptr_Volume_DOUBLE) – data to be converted
output_data (BucketMap_U16) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_rc_ptr_Volume_DOUBLE_BucketMap_U32¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (rc_ptr_Volume_DOUBLE) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (rc_ptr_Volume_DOUBLE) – data to be converted
output_data (BucketMap_U32) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_rc_ptr_Volume_DOUBLE_BucketMap_VOID¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (rc_ptr_Volume_DOUBLE) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (rc_ptr_Volume_DOUBLE) – data to be converted
output_data (BucketMap_VOID) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_rc_ptr_Volume_FLOAT_BucketMap_DOUBLE¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (rc_ptr_Volume_FLOAT) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (rc_ptr_Volume_FLOAT) – data to be converted
output_data (BucketMap_DOUBLE) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_rc_ptr_Volume_FLOAT_BucketMap_FLOAT¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (rc_ptr_Volume_FLOAT) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (rc_ptr_Volume_FLOAT) – data to be converted
output_data (BucketMap_FLOAT) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_rc_ptr_Volume_FLOAT_BucketMap_S16¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (rc_ptr_Volume_FLOAT) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (rc_ptr_Volume_FLOAT) – data to be converted
output_data (BucketMap_S16) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_rc_ptr_Volume_FLOAT_BucketMap_S32¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (rc_ptr_Volume_FLOAT) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (rc_ptr_Volume_FLOAT) – data to be converted
output_data (BucketMap_S32) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_rc_ptr_Volume_FLOAT_BucketMap_U16¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (rc_ptr_Volume_FLOAT) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (rc_ptr_Volume_FLOAT) – data to be converted
output_data (BucketMap_U16) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_rc_ptr_Volume_FLOAT_BucketMap_U32¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (rc_ptr_Volume_FLOAT) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (rc_ptr_Volume_FLOAT) – data to be converted
output_data (BucketMap_U32) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_rc_ptr_Volume_FLOAT_BucketMap_VOID¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (rc_ptr_Volume_FLOAT) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (rc_ptr_Volume_FLOAT) – data to be converted
output_data (BucketMap_VOID) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_rc_ptr_Volume_S16_BucketMap_DOUBLE¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (rc_ptr_Volume_S16) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (rc_ptr_Volume_S16) – data to be converted
output_data (BucketMap_DOUBLE) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_rc_ptr_Volume_S16_BucketMap_FLOAT¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (rc_ptr_Volume_S16) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (rc_ptr_Volume_S16) – data to be converted
output_data (BucketMap_FLOAT) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_rc_ptr_Volume_S16_BucketMap_S16¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (rc_ptr_Volume_S16) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (rc_ptr_Volume_S16) – data to be converted
output_data (BucketMap_S16) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_rc_ptr_Volume_S16_BucketMap_S32¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (rc_ptr_Volume_S16) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (rc_ptr_Volume_S16) – data to be converted
output_data (BucketMap_S32) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_rc_ptr_Volume_S16_BucketMap_U16¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (rc_ptr_Volume_S16) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (rc_ptr_Volume_S16) – data to be converted
output_data (BucketMap_U16) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_rc_ptr_Volume_S16_BucketMap_U32¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (rc_ptr_Volume_S16) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (rc_ptr_Volume_S16) – data to be converted
output_data (BucketMap_U32) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_rc_ptr_Volume_S16_BucketMap_VOID¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (rc_ptr_Volume_S16) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (rc_ptr_Volume_S16) – data to be converted
output_data (BucketMap_VOID) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_rc_ptr_Volume_S32_BucketMap_DOUBLE¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (rc_ptr_Volume_S32) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (rc_ptr_Volume_S32) – data to be converted
output_data (BucketMap_DOUBLE) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_rc_ptr_Volume_S32_BucketMap_FLOAT¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (rc_ptr_Volume_S32) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (rc_ptr_Volume_S32) – data to be converted
output_data (BucketMap_FLOAT) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_rc_ptr_Volume_S32_BucketMap_S16¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (rc_ptr_Volume_S32) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (rc_ptr_Volume_S32) – data to be converted
output_data (BucketMap_S16) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_rc_ptr_Volume_S32_BucketMap_S32¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (rc_ptr_Volume_S32) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (rc_ptr_Volume_S32) – data to be converted
output_data (BucketMap_S32) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_rc_ptr_Volume_S32_BucketMap_U16¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (rc_ptr_Volume_S32) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (rc_ptr_Volume_S32) – data to be converted
output_data (BucketMap_U16) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_rc_ptr_Volume_S32_BucketMap_U32¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (rc_ptr_Volume_S32) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (rc_ptr_Volume_S32) – data to be converted
output_data (BucketMap_U32) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_rc_ptr_Volume_S32_BucketMap_VOID¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (rc_ptr_Volume_S32) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (rc_ptr_Volume_S32) – data to be converted
output_data (BucketMap_VOID) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_rc_ptr_Volume_U16_BucketMap_DOUBLE¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (rc_ptr_Volume_U16) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (rc_ptr_Volume_U16) – data to be converted
output_data (BucketMap_DOUBLE) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_rc_ptr_Volume_U16_BucketMap_FLOAT¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (rc_ptr_Volume_U16) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (rc_ptr_Volume_U16) – data to be converted
output_data (BucketMap_FLOAT) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_rc_ptr_Volume_U16_BucketMap_S16¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (rc_ptr_Volume_U16) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (rc_ptr_Volume_U16) – data to be converted
output_data (BucketMap_S16) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_rc_ptr_Volume_U16_BucketMap_S32¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (rc_ptr_Volume_U16) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (rc_ptr_Volume_U16) – data to be converted
output_data (BucketMap_S32) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_rc_ptr_Volume_U16_BucketMap_U16¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (rc_ptr_Volume_U16) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (rc_ptr_Volume_U16) – data to be converted
output_data (BucketMap_U16) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_rc_ptr_Volume_U16_BucketMap_U32¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (rc_ptr_Volume_U16) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (rc_ptr_Volume_U16) – data to be converted
output_data (BucketMap_U32) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_rc_ptr_Volume_U16_BucketMap_VOID¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (rc_ptr_Volume_U16) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (rc_ptr_Volume_U16) – data to be converted
output_data (BucketMap_VOID) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_rc_ptr_Volume_U32_BucketMap_DOUBLE¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (rc_ptr_Volume_U32) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (rc_ptr_Volume_U32) – data to be converted
output_data (BucketMap_DOUBLE) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_rc_ptr_Volume_U32_BucketMap_FLOAT¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (rc_ptr_Volume_U32) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (rc_ptr_Volume_U32) – data to be converted
output_data (BucketMap_FLOAT) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_rc_ptr_Volume_U32_BucketMap_S16¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (rc_ptr_Volume_U32) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (rc_ptr_Volume_U32) – data to be converted
output_data (BucketMap_S16) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_rc_ptr_Volume_U32_BucketMap_S32¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (rc_ptr_Volume_U32) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (rc_ptr_Volume_U32) – data to be converted
output_data (BucketMap_S32) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_rc_ptr_Volume_U32_BucketMap_U16¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (rc_ptr_Volume_U32) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (rc_ptr_Volume_U32) – data to be converted
output_data (BucketMap_U16) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_rc_ptr_Volume_U32_BucketMap_U32¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (rc_ptr_Volume_U32) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (rc_ptr_Volume_U32) – data to be converted
output_data (BucketMap_U32) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_rc_ptr_Volume_U32_BucketMap_VOID¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (rc_ptr_Volume_U32) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (rc_ptr_Volume_U32) – data to be converted
output_data (BucketMap_VOID) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_rc_ptr_Volume_U8_BucketMap_DOUBLE¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (rc_ptr_Volume_U8) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (rc_ptr_Volume_U8) – data to be converted
output_data (BucketMap_DOUBLE) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_rc_ptr_Volume_U8_BucketMap_FLOAT¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (rc_ptr_Volume_U8) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (rc_ptr_Volume_U8) – data to be converted
output_data (BucketMap_FLOAT) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_rc_ptr_Volume_U8_BucketMap_S16¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (rc_ptr_Volume_U8) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (rc_ptr_Volume_U8) – data to be converted
output_data (BucketMap_S16) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_rc_ptr_Volume_U8_BucketMap_S32¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (rc_ptr_Volume_U8) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (rc_ptr_Volume_U8) – data to be converted
output_data (BucketMap_S32) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_rc_ptr_Volume_U8_BucketMap_U16¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (rc_ptr_Volume_U8) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (rc_ptr_Volume_U8) – data to be converted
output_data (BucketMap_U16) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_rc_ptr_Volume_U8_BucketMap_U32¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (rc_ptr_Volume_U8) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (rc_ptr_Volume_U8) – data to be converted
output_data (BucketMap_U32) – conversion output will be done into this data
- Return type:
None
- class soma.aims.Converter_rc_ptr_Volume_U8_BucketMap_VOID¶
Bases:
wrapper
Converter classes can be used using the convert() method, or as a callable object:
result = converter(input_data)
- Parameters:
input_data (rc_ptr_Volume_U8) – data to be converted
- Returns:
output data – converted data
- Return type:
- convert(input_data, output_data)¶
In-place converson inside existing allocated data
- Parameters:
input_data (rc_ptr_Volume_U8) – data to be converted
output_data (BucketMap_VOID) – conversion output will be done into this data
- Return type:
None
- class soma.aims.CurveSelection¶
Bases:
BundleProducer
,BundleListener
- addFiberPoint()¶
- bundleStarted(producer, bundle_info)¶
- bundleTerminated(producer, bundle_info)¶
- fiberStarted(producer, bundle_info, fiber_info)¶
- fiberTerminated(producer, bundle_info, fiber_info)¶
- newFiberPoint(producer, bundle_info, fiber_info, point)¶
- noMoreBundle(producer)¶
- startBundle()¶
- startFiber()¶
- terminateBundle()¶
- terminateFiber()¶
- class soma.aims.CutMesh¶
Bases:
wrapper
Cut meshes by a plane. The output of the operation is one cut mesh per input mesh, and possibly a border polygon mesh, and a plane intersection mesh.
The plane mesh is not always correct, it is now preferred to use GLU’s tesselation algorithm.
To use it:
initialize using a constructor and/or set input parameters (see also the CutTexturedMesh subclasses to handle textured meshes)
call cut() or cutBorder(), these are the methods actually doing things
get outputs using cutMeshes(), borderLine(), planeMesh() and CutTexturedMesh.cutTextures()
- borderLine()¶
- cut()¶
- cutBorder()¶
- cutMeshes()¶
- planeMesh()¶
- class soma.aims.Edge(*args, **kwargs)¶
Bases:
GraphObject
- clone()¶
- currentValue()¶
- getScalar()¶
- getString()¶
- hasSyntax()¶
- hasVertex()¶
- has_key()¶
- intKey()¶
- isArray()¶
- isDictionary()¶
- isDictionaryIterator()¶
- isDynArray()¶
- isIterable()¶
- isIterator()¶
- isValid()¶
- key()¶
- objectIterator()¶
- setSyntax()¶
- size()¶
- type()¶
- vertices()¶
- verticesSize()¶
- exception soma.aims.ErrnoError¶
Bases:
RuntimeError
- exception soma.aims.FileError¶
Bases:
RuntimeError
- class soma.aims.FileFormatDictionary_AimsTimeSurface_2_VOID¶
Bases:
wrapper
- fileExtension()¶
- fileFormat()¶
- formats()¶
- init()¶
- registerBaseFormats()¶
- registerFormat()¶
- unregisterFormat()¶
- class soma.aims.FileFormatDictionary_AimsTimeSurface_3_VOID¶
Bases:
wrapper
- fileExtension()¶
- fileFormat()¶
- formats()¶
- init()¶
- registerBaseFormats()¶
- registerFormat()¶
- unregisterFormat()¶
- class soma.aims.FileFormatDictionary_Object¶
Bases:
wrapper
- fileExtension()¶
- fileFormat()¶
- formats()¶
- init()¶
- registerBaseFormats()¶
- registerFormat()¶
- unregisterFormat()¶
- class soma.aims.FileFormatDictionary_SparseOrDenseMatrix¶
Bases:
wrapper
- fileExtension()¶
- fileFormat()¶
- formats()¶
- init()¶
- registerBaseFormats()¶
- registerFormat()¶
- unregisterFormat()¶
- class soma.aims.FileFormatDictionary_Transformation3d¶
Bases:
wrapper
- fileExtension()¶
- fileFormat()¶
- formats()¶
- init()¶
- registerBaseFormats()¶
- registerFormat()¶
- unregisterFormat()¶
- class soma.aims.FileFormatDictionary_TransformationGraph3d¶
Bases:
wrapper
- fileExtension()¶
- fileFormat()¶
- formats()¶
- init()¶
- registerBaseFormats()¶
- registerFormat()¶
- unregisterFormat()¶
- class soma.aims.Finder¶
Bases:
wrapper
- check()¶
- dataType()¶
- extensions()¶
- finderFormat()¶
- format()¶
- header()¶
- objectType()¶
- possibleDataTypes()¶
- registerFormat()¶
- setDataType()¶
- setFormat()¶
- setHeader()¶
- setObjectType()¶
- setPossibleDataTypes()¶
- unregisterFormat()¶
- class soma.aims.GenericHandlers[source]¶
Bases:
object
Static generic handlers used as import rules.
- static moveChildren(namespace, extendedModule, referedModule)[source]¶
This static method is used to move child objects of a refered module to the extended module.
- Parameters:
namespace (string) – namespace of the referedModule to get objects to move from.
extendedModule (ExtendedModule) –
ExtendedModule
object into which move objects.referedModule (module) – refered module object to get objects to move from.
- static removeChildren(namespace, prefixes, extendedModule, referedModule)[source]¶
This static method is used to remove children from the extended module.
- Parameters:
namespace (string) – namespace of the referedModule.
prefixes (list) – list of prefixes of objects to remove.
extendedModule (ExtendedModule) –
ExtendedModule
object to remove objects from.referedModule (module) – refered module object.
- class soma.aims.Graph(*args, **kwargs)¶
Bases:
GraphObject
- addDirectedEdge()¶
- addEdge()¶
- addVertex()¶
- clear()¶
- clone()¶
- cloneVertex()¶
- currentValue()¶
- edges()¶
- edgesSize()¶
- extract()¶
- getScalar()¶
- getString()¶
- hasSyntax()¶
- hasVertex()¶
- has_key()¶
- intKey()¶
- isArray()¶
- isDictionary()¶
- isDictionaryIterator()¶
- isDirected()¶
- isDynArray()¶
- isIterable()¶
- isIterator()¶
- isUndirected()¶
- isValid()¶
- key()¶
- loadAllMissingElements()¶
- objectIterator()¶
- order()¶
- randomVertex()¶
- removeEdge()¶
- removeVertex()¶
- setSyntax()¶
- size()¶
- type()¶
- vertices()¶
- class soma.aims.GraphManip¶
Bases:
wrapper
- attributeColor()¶
- buckets2Volume()¶
- completeGraph()¶
- getICBM2009cTemplateTransform()¶
transform = aims.GraphManip.getICBM2009cTemplateTransform(graph)
Extract the transformation to the MNI ICBM152 space, shifted to the “most standard” field of view of the template image, the one from the ICBM2009c_nlin_asym template from the MNI. Actually we find various fields of view for the templates. The one we use here is (193, 229, 193). The transform to the “real” ICBM space (0 roughly at AC) is provided in the output transformation header. This space has a fixed transformation with our Aims Talairach, along with the template volume size and voxel size. This space has a fixed transformation with our Aims Talairach. Includes shifts and axes inversions.
- getICBMTransform()¶
transform = aims.GraphManip.getICBMTransform(graph)
Extract the transformation to the MNI ICBM152 space. This space has a fixed transformation with our Aims Talairach.
- getPath()¶
- get_element_table()¶
Get the GraphElementTable as a dict. The dict has the following shape:
{ syntax_name: { id_name: GraphElementCode_object } }
GraphElementCode objects are given as dicts (str, str):
{ 'id': <same_as_key: filename (globals) or attribute for filename (locals)>, 'attribute': <attribute_name_in_graph_element>, 'objectType': <type of object>, 'dataType': <data type of object>, 'storageType': <'Global', 'Local', or 'GlobalPacked'>, 'local_file_attribute': <attribute giving the filename for local storage in each graph elememt>, 'global_index_attribute': <attribute giving the index for global storage in each graph elememt>, 'global_filename': <filename for global storage>, 'global_attribute': <attribute>, 'syntax': <syntax_name> }
- graphFromVolume()¶
graph = graphFromVolume(vol, background=0, trans=None) graphFromVolume(vol, graph, background=0, trans=None,
automaticBackgroundSearch=True)
builds a ROI graph from a volume of labels
- printGraphElementTable()¶
- setAttributeColor()¶
- storeAims()¶
- storeTalairach()¶
- talairach()¶
- volume2Buckets()¶
- class soma.aims.GraphObject(*args, **kwargs)¶
Bases:
GenericObject
- clone()¶
- currentValue()¶
- getScalar()¶
- getString()¶
- hasSyntax()¶
- has_key()¶
- intKey()¶
- isArray()¶
- isDictionary()¶
- isDictionaryIterator()¶
- isDynArray()¶
- isIterable()¶
- isIterator()¶
- isNone()¶
- isScalar()¶
- isString()¶
- isValid()¶
- key()¶
- objectIterator()¶
- setSyntax()¶
- size()¶
- type()¶
- class soma.aims.Hierarchy(*args, **kwargs)¶
Bases:
Tree
- find(name)¶
- find_color(name, default_color=<class 'KeyError'>)¶
- hasSyntax()¶
- setSyntax()¶
- exception soma.aims.IOError¶
Bases:
RuntimeError
- exception soma.aims.IndexError¶
Bases:
StdException
- class soma.aims.MaskIterator(*args)¶
Bases:
RCObject
- contains()¶
- isValid()¶
- next()¶
- regionName()¶
- restart()¶
- value()¶
- valueMillimeters()¶
- volumeDimension()¶
- voxelSize()¶
- soma.aims.Motion¶
alias of
AffineTransformation3d
- class soma.aims.Object¶
Bases:
rc_ptr_GenericObject
Generic dynamic polymorphic object proxy.
Object is a proxy and a reference counter to a GenericObject. In most cases, Object and GenericObject are interchangeable and play the same role, there are two objects for technical reasons in the C++ layer, but in Python it whould make no difference.
The C++ generic object is an implementation of a mutable dynamic container which can hold any type of concrete data, with a generic access API which abstracts the concrete type of the object stored within it.
According to the underlying object type, Object can behave like a number, a string, or a container: sequence or dictionary. The python bindings can therefore support the sequence protocol, or the dictionary protocol, like a ‘real’ python object.
The only part which makes it visibly different from a python object is the conversions with stored objects, which are generally C++ objects (but can also be any python objects). Transparent conversions are done when possible.
We will take an example to show how to use it: a volume header. Suppose the files volume.img/volume.hdr[/volume.img.minf] represent a 3D volume (a MRI volume, typically, here in Analyze/SPM or Nifti format). We will read it using aims, and access its header data, which comes as a generic object.
>>> from __future__ import print_function # work using python 2 or 3 >>> from soma import aims >>> vol = aims.read('volume.img') >>> hdr = vol.header()
Now
vol
is the volume, andhdr
its header, of typeObject
.>>> type(hdr) <class 'soma.aims.Object'> >>> print(hdr) { 'voxel_size' : [ 1.875, 1.875, 4, 1 ], 'file_type' : 'SPM', 'byte_swapping' : 0, 'volume_dimension' : [ 128, 128, 16, 1 ], 'vox_units' : 'mm ', 'cal_units' : '', 'data_type' : 'S16', 'disk_data_type' : 'S16', 'bits_allocated' : 2, 'tr' : 1, 'minimum' : 0, 'maximum' : 13645, 'scale_factor' : 1, 'scale_factor_applied' : 0, 'db_name' : '', 'aux_file' : '', 'orient' : 3, 'generated' : '', 'scannum' : '', 'patient_id' : '', 'exp_date' : '', 'exp_time' : '', 'views' : 0, 'start_field' : 32768, 'field_skip' : 8192, 'omax' : 0, 'omin' : 0, 'smax' : 32, 'smin' : 0, 'SPM_data_type' : '', 'possible_data_types' : [ 'S16' ], 'spm_radio_convention' : 1, 'spm_origin' : [ 65, 65, 9 ], 'origin' : [ 64, 63, 7 ] }
hdr
prints like a dictionary, but is not really a python dictionary object. However it behaves like a dictionary:>>> print(hdr['voxel_size']) [ 1.875, 1.875, 4, 1 ] >>> print(hdr['data_type']) S16 >>> print(hdr['voxel_size'][0]) 1.875 >>> for x in hdr: >>> print(x) >>> voxel_size file_type byte_swapping volume_dimension vox_units cal_units data_type disk_data_type bits_allocated tr minimum maximum scale_factor scale_factor_applied db_name aux_file orient generated scannum patient_id exp_date exp_time views start_field field_skip omax omin smax smin SPM_data_type possible_data_types spm_radio_convention spm_origin origin >>> for x,y in hdr.items(): >>> print(x, ':', y) >>> voxel_size : [ 1.875, 1.875, 4, 1 ] file_type : 'SPM' byte_swapping : 0 volume_dimension : [ 128, 128, 16, 1 ] vox_units : 'mm ' cal_units : '' data_type : 'S16' disk_data_type : 'S16' bits_allocated : 2 tr : 1 minimum : 0 maximum : 13645 scale_factor : 1 scale_factor_applied : 0 db_name : '' aux_file : '' orient : 3 generated : '' scannum : '' patient_id : '' exp_date : '' exp_time : '' views : 0 start_field : 32768 field_skip : 8192 omax : 0 omin : 0 smax : 32 smin : 0 SPM_data_type : '' possible_data_types : [ 'S16' ] spm_radio_convention : 1 spm_origin : [ 65, 65, 9 ] origin : [ 64, 63, 7 ]
Elements returned by the dictionary queries can have various types, althrough they are all stored internally in a C++ structure through
soma.aims.Object
wrappers. But when the underlying type of the element is known and can be retreived as a python object (either a standard python type or a python binding of a C++ class), it is done automatically. Such conversion is not possible when the underlying object has no python binding and is a pure C++ object, or when there is no conversion function. In this case, an Object is returned and contains the selected data.Conversions are done using conversion methods that you generally do not need to call by hand: getScalar(), getString(), or the more general conversion method
soma.aims.Object.getPython()
. Elements types that cannot be converted to python concrete types are retreived in their Object container.The generic conversion function in
Object
:getPython
, is a static method and can be extended.Elements in
Object
containers can generally be read and written:>>> hdr['data_type'] = 'FLOAT' >>> hdr['data_type'] 'FLOAT'
This generally suits your needs. But in a few cases there will be a problem in internal types handling in the C++ layer.
Here, the underlying C++ generic object which did hold a C++ string (
std::string
)'S16'
is now replaced by another generic object built from the python string'FLOAT'
, and which now wraps an element of typePyObject
(orPyString
). It just behaves the same way, so this operation is perfectly valid, but if C++ programs expect it to be a C++std::string
, they may fail.Moreover, when writing back to existing concrete objects, some additional conversions may take place: for instance
hdr['voxel_size']
is a C++ object of typestd::vector<float>
, so writing tohdr['voxel_size'][0]
needs to enure we are actually writing afloat
, and if not, convert to it if possible.You can query a type identifier for a generic object via the
type()
method:>>> hdr.type() 'PropertySet'
Objects that can be converted from C++ generic objects to python are not necessarily known in advance. A conversion table is kept in the global variable
soma.aims.convertersObjectToPython
(in the aims module) and can be extended. Therefore other python modules using aims (such as sigraph) can extend this conversion table.Details and tricks
There are some limitations and “unexpected behaviours” caused by the underlying C++ implementation of generic objects, and general behaviour differences between Python and C++. The following is expert-level details, so read it only if you have problems or you are a C++ expert with good knowledge of the cartobase C++ library…
Generic object - specialized object conversions
Putting a specific object in a generic Object makes a copy of it the first time it is done, because C++ generic objects contain the specialized elements. Once this has been done once, generic objects are shared and not copied anymore, which is consistent with the normal python behaviour. The non-pythonic thing is the first insertion in a generic object:
>>> a = aims.vector_FLOAT([12.6, -5.7]) >>> print(a) [ 12.6, -5.7 ] >>> hdr['foo'] = a # here a is copied into hdr['foo'] >>> a.append( 6.8 ) # a is changed but not hdr >>> print(a) [ 12.6, -5.7, 6.8 ] >>> print(hdr['foo']) [ 12.6, -5.7 ] >>> hdr['dummy'] = hdr['foo'] >>> hdr['foo'].append(4.2) >>> print(hdr['dummy']) # this time hdr['dummy'] is changed [ 12.6, -5.7, 4.2 ]
To overcome the first copy problem, you may have to reassign the initial variable to the copy instance:
>>> a = aims.vector_FLOAT([1.2, 2.3, 3.4]) >>> hdr['foo'] = a >>> a = hdr['foo'] >>> print(hdr['foo']) [ 1.2, 2.3, 3.4 ] >>> a[1] = 12.8 >>> print(a) [ 1.2, 12.8, 3.4 ] >>> print(hdr['foo']) [ 1.2, 12.8, 3.4 ]
There are exceptions to this behaviour:
pure python objects, like lists or dictionaries are never copied since it is only a pointer to them (the C PyObject * pointer) which is stored.
small builtin types: numbers and strings are always copied since they are always converted and copied, not wrapped, when passed from python to C++ and vice versa.
The get() method
On
Object
theget
method is ambiguous and has 2 meanings:get() without arguments is a wrapping to the C++
rc_ptr::get()
which returns the underlying wrapped object (here, aGenericObject
)get(key, default=None) is the dict-like method that is available on
GenericObject
since aims 4.6.1.
Depending on the arguments the Object method will redirect to the right one, thus:
myobject.get() # gets the GenericObject myobject.get('key') # gets the dict item under keyt 'key' myobject.get().get('key') # does both, but this is what the previous line # already does, so the result is the same
To avoid this ambiguity,
Object.get()
andrc_ptr.get()
have been renamed_get()
years ago (in aims 4.0 I think) butget()
is still present for compatibility. This use (without argument) is obsolete and may be removed in the future.- getPython()¶
Conversion to python types: extracts what is in the Object (when possible). The global dictionary
soma.aims.convertersObjectToPython
stores converters
- isNone()¶
- static ptrToObject(x)¶
- static rcToObject(x)¶
- static toObject(x)¶
- soma.aims.Point2d¶
alias of
AimsVector_S16_2
- soma.aims.Point2dd¶
alias of
AimsVector_DOUBLE_2
- soma.aims.Point2df¶
alias of
AimsVector_FLOAT_2
- soma.aims.Point2dl¶
alias of
AimsVector_S64_2
- soma.aims.Point2du¶
alias of
AimsVector_U32_2
- soma.aims.Point3d¶
alias of
AimsVector_S16_3
- soma.aims.Point3dd¶
alias of
AimsVector_DOUBLE_3
- soma.aims.Point3df¶
alias of
AimsVector_FLOAT_3
- soma.aims.Point3dl¶
alias of
AimsVector_S64_3
- soma.aims.Point3du¶
alias of
AimsVector_U32_3
- soma.aims.Point4d¶
alias of
AimsVector_S16_4
- soma.aims.Point4dd¶
alias of
AimsVector_DOUBLE_4
- soma.aims.Point4df¶
alias of
AimsVector_FLOAT_4
- soma.aims.Point4dl¶
alias of
AimsVector_S64_4
- soma.aims.Point4du¶
alias of
AimsVector_U32_4
- class soma.aims.Quaternion¶
Bases:
wrapper
- angle()¶
- axis()¶
- buildFromMatrix(m)¶
- Parameters:
m (vector_FLOAT) – 4x4 matrix in columns (OpenGL-style). Be careful that it is not the expected order for a numpy array using ravel(), which have to be transposed.
- buildFromMotion()¶
- compose(value, /)¶
Return self*value.
- fromAxis()¶
- inverse()¶
- norm()¶
- normalized()¶
- setVector()¶
- transform()¶
- transformInverse()¶
- vector()¶
- class soma.aims.RawConverter_BucketMap_VOID_rc_ptr_Volume_S16¶
Bases:
wrapper
- convert()¶
- printToVolume()¶
- setTimeIsLabel()¶
- timeIsLabel()¶
- class soma.aims.Reader(typemap=None, allocmode=None, options=None)[source]¶
Bases:
object
Generic reader that can theorerically load any SIP-mapped AIMS or Cartograph object. A translation table can be provided to correctly map readers and objects. For quick and simple operations, you can also use the gloabl
soma.aims.read()
andsoma.aims.write()
functions, which use a Reader object internally.typemap can be provided to specify which reader may be used to load objects whose type has been read. A default internal map is present but can be replaced.
The map has 2 modes:
object_type : object_type (ex:
{'Volume' : 'Volume'}
)object_type : dict( data_type : full_type ) (ex:
'Mesh' : { 'VOID' : 'AimsSurfaceTriangle' }
)A default object_type can be specified if the data_type is not found:
'Mesh' : { 'VOID' : 'AimsSurfaceTriangle', 'default_object_type' : 'AimsTimeSurface_3_VOID' }
(and this example corresponds to the default internal map if none is specified)
- Parameters:
typemap (dict (optional)) – described above
allocmode ((optional)) –
carto.AllocatorContext
orcarto.AllocatorStrategy
.DataAccess constant: allocation specification.
- mapType(iotype, aimstype)[source]¶
Get the translated type correspondance between identified data type (from IO system) and the data type that will actually be read. This is generally the identity, but a few IO/types allow some variations.
- read(filename, border=0, frame=-1, dtype=None, object=None)[source]¶
Reads the object contained in the file <filename>, whatever the type of the contents of the file. All objects types supported by Aims IO system can be read. A border width and a frame number may be specified and will be only used by formats that support them. If <dtype> is specified, the corresponding object/data type is forced. It may be useful to force reading a volume with float voxels for instance. It is only supported by a few formats. <dtype> may contain a string or a type object, as accepted by
soma.aims.typeCode()
. The read function may follow other object/data types rules, allocators and options, as specified in the Reader constructor.
- class soma.aims.RoiDiff¶
Bases:
wrapper
- diff()¶
- globalStats()¶
- graph2LabelVolume()¶
- mismatch_bucket()¶
- roiNames()¶
- roiNamesInv()¶
- statsByLabel()¶
- writeCSV()¶
- class soma.aims.RoiIterator(*args)¶
Bases:
RCObject
- count()¶
- isValid()¶
- maskIterator()¶
- next()¶
- regionName()¶
- restart()¶
- setRegionNameAttributes(attributes)¶
set region name attribute in graph. Normally “name” or “label”. If several values are provided, attributes are searched in each graph vertex, in that order. If the attributes list is empty, then the graph “label_property” attribute will be used, and if it is not specified there, the default search list (“name”, “label”) will be used.
- exception soma.aims.RuntimeError¶
Bases:
StdException
- soma.aims.ShallowConverter(*args, **kwargs)[source]¶
Create a ShallowConverter instance from input and output types. Types may be passed as keyword arguments intype and outtype, or dtype if both are the same (not very useful for a converter). Otherwise the arguments are parsed to find types arguments.
Types may be specified as allowed by typeCode().
Note that for volumes, the method
astype
is often more convenient than using a Converter object (with the same result).
- class soma.aims.SimpleBundlesSlicer¶
Bases:
BundlesSlicer
- bundleStarted(producer, bundle_info)¶
- bundleTerminated(producer, bundle_info)¶
- fiberStarted(producer, bundle_info, fiber_info)¶
- fiberTerminated(producer, bundle_info, fiber_info)¶
- newFiberPoint(producer, bundle_info, fiber_info, point)¶
- noMoreBundle(producer)¶
- class soma.aims.SparseMatrix(*args)¶
Bases:
RCObject
- erase_element()¶
- fill()¶
- getColumn()¶
- getComposition()¶
- getNonZeroElementCount()¶
- getRow()¶
- getSize1()¶
- getSize2()¶
- getTrace()¶
- getTransposition()¶
- hasElement()¶
- header()¶
- isSquare()¶
- read()¶
- reallocate()¶
- setColumn()¶
- setDiagonal()¶
- setIdentity()¶
- setRow()¶
- setZero()¶
- transpose()¶
- write()¶
- class soma.aims.SparseOrDenseMatrix(*args)¶
Bases:
RCObject
- asDense()¶
- asSparse()¶
- denseMatrix()¶
- erase_element()¶
- freeColumn()¶
- freeRow()¶
- getColumn()¶
- getNonZeroElementCount()¶
- getRow()¶
- getSize()¶
- getSize1()¶
- getSize2()¶
- hasElement()¶
- header()¶
- isDense()¶
- isOptimalShape()¶
- muteToDense()¶
- muteToOptimalShape()¶
- muteToSparse()¶
- read()¶
- readAll()¶
- readColumn()¶
- readRow()¶
- reallocate()¶
- setColumn()¶
- setHeader()¶
- setMatrix()¶
- setRow()¶
- set_element()¶
- sparseMatrix()¶
- subMatrix()¶
- write()¶
- class soma.aims.StandardReferentials¶
Bases:
wrapper
- acPcReferential()¶
identifer (str) for the Taialairach/AIMS space
- acPcReferentialID()¶
identifer (UUID str) for the Talairach/AIMS space
- commonScannerBasedReferential()¶
- commonScannerBasedReferentialID()¶
- icbm2009cTemplateHeader()¶
hdr = aims.StandardReferentials.icbm2009cTemplateHeader() Return a header with size and characteristics of the ICBM2009c MNI template volume.
- mniTemplateReferential()¶
identifer (str) for the MNI/ICBM space
- mniTemplateReferentialID()¶
identifer (UUID str) for the MNI/ICBM space
- talairachReferential()¶
identifer (str) for the Talairach/CIFTI space
- talairachToICBM()¶
- talairachToICBM2009cTemplate()¶
trans = aims.StandardReferentials.talairachToICBM2009cTemplate()
Transformation between the ICBM152 standard space and the ICBM152 template space.
includes shifts and axes inversions.
This is the “most standard” field of view of the template image, the one from the ICBM2009c_nlin_asym template from the MNI. Actually we find various fields of view for the templates. The one we use here is (193, 229, 193). The transform to the “real” ICBM space (0 roughly at AC) is provided in the output transformation header. This space has a fixed transformation with our Aims Talairach, along with the template volume size and voxel size. This space has a fixed transformation with our Aims Talairach.
- class soma.aims.StdOutInhibitorFix[source]¶
Bases:
ResetCallback
- class soma.aims.SurfaceGenerator¶
Bases:
wrapper
Surface Generator Object. Available Methods are :
cube(center_p, radius_f, smoothnormal_b=false)
cylinder(p1_p, p2_p, radius1_f, radius2_f, nfacets_i, closed_b, smooth_b=false)
cone(arrow_p, base_p, radius_f, nfacets_i, closed_b, smooth_b=false)
arrow(arrow_p, base_p, radius_f, arrowradius_f, nfacets_i, arrowlengthfract_f)
icosahedron(center_p, radius_f)
sphere(center_p, radius_f, nfacets_i)
icosphere(center_p, radius_f, nfacets_i)
With arguments suffix _f:float, _i:int, _b:bool, _p: Point3df or 3-tuple
Alternatively, all those may be called with a GenericObject as only parameter.
This doc might not be up-to-date, use the
printDescription()
method for more info.- arrow()¶
static arrow( dictionary ) See the description() and printDescription() methods for more information.
static arrow( Point3df arrowhead, Point3df base, float headradius, float arrowradius, unsigned nfaces, float arrowlengthfactor )
- circle_wireframe()¶
- Circle, or part of circle.
center, radius are classical. nseg is the number of segments in the circle polygon normal is a normal vector to the circle plane. startdir is a vector in the circle plane determining the beginning of angles (circle ray). startangle, stopangle are meant to make parts of circle
- cone()¶
static cone( dictionary ) See the description() and printDescription() methods for more information.
static cone( Point3df arrowhead, Point3df base, float radius, unsigned nfaces, bool closed, bool smooth=False )
- cube()¶
static cube( dictionary ) See the description() and printDescription() methods for more information.
static cube( Point3df center, float radius, bool smoothnormals=False )
- cylinder()¶
static cylinder( dictionary ) See the description() and printDescription() methods for more information.
static cylinder( Point3df center1, Point3df center2, float radius1, float radius2, unsigned nfaces, bool closed, bool smooth=False )
- description()¶
- description_wireframe()¶
- ellipse()¶
static ellipse( dictionary ) See the description() and printDescription() methods for more information.
static ellipse( Point3df center, float radius1, float radius2, unsigned nfaces, bool uniquevertices=False )
- generate()¶
- generate_wireframe()¶
- grid(dict)¶
See the description() and printDescription() methods for more information.
grid(Point3df boundingbox_min, Point3df boundingbox_max, Point3df grid_sampling) Regular, wireframe grid
- icosahedron()¶
static icosahedron( dictionary ) See the description() and printDescription() methods for more information.
static icosahedron( Point3df center, float radius )
- icosphere(dictionary)¶
See the description() and printDescription() methods for more information.
icosphere( Point3df center, float radius, unsigned nfaces=320 )
Compared to sphere() which performs meridian / parallels tesselation, icosphere over-segments an icosahedron to get equal, equilateral triangles.
- parallelepiped(boundingbox_min, boundingbox_max, smooth=False)¶
- Parameters:
boundingbox_min (Point3df) – “lower bound” corner position
boundingbox_min – “upper bound” corner position
smooth (bool) – if True, make smooth faces and shared vertices in corners
- parallelepiped_wireframe(Point3df boundingbox_min, Point3df boundingbox_max)¶
- printDescription()¶
- printDescription_wireframe()¶
- sphere()¶
static sphere( dictionary ) See the description() and printDescription() methods for more information.
static sphere( Point3df center, float radius, unsigned nfaces, bool uniquevertices=False )
- class soma.aims.SurfaceManip¶
Bases:
wrapper
Surface Manipulation Object. All mehtods are static in this class, it is just a means of grouping functions.
- checkMeshIntersect()¶
- cutMesh(in_mesh, plane, cut_mesh, border_line)¶
Cut a mesh by a plane and that’s all.
- Parameters:
in_mesh (AimsSurfaceTriangle) – Triangular mesh to be cut.
plane (Point4df) – cut plane equation (4 coefs)
cut_mesh (AimsSurfaceTriangle) – output cut mesh (the part satisfying the plane equation). Polygons crossing the plane will be cut into smaller ones.
border_line (AimsTimeSurface_2_VOID) – output cut section polygon
- Return type:
None
- invertSurfacePolygons(mesh)¶
Invert polygons order (flips 2 vertex indices in each triangle) to flip its interior / exterior notions (used by OpenGL rendering). The input mesh is modified in-place.
- joinTexturedMesh()¶
Join a mesh and a texture into a textured mesh
- lineDirections(segments_mesh)¶
calculate directions of a line mesh, for each vertex
- Parameters:
segments_mesh (AimsTimeSurface_2_VOID) –
- Returns:
directions
- Return type:
- meshArea()¶
Surface area of a triangular mesh, in mm^2
Surface areas of regions of a triangular mesh, in mm^2. Regions are given as a texture.
- meshDensity(mesh, as_distance=False)¶
Calculate a mesh density: inverse of the average edges distance.
- Parameters:
mesh (AimsSurfaceTriangle) –
as_distance (bool (optional)) – if True, the average distance is not inverted, thus the output is an average distance map.
- Returns:
density_texture
- Return type:
- meshEdgeLengthRatioTexture(numerator_mesh, denominator_mesh)¶
Calculate an edge length ratio in edges of two meshes with the same topology. The max length ratios of edges is kept for each vertex.
- Parameters:
numerator_mesh (AimsSurfaceTriangle) –
denominator_mesh (AimsSurfaceTriangle) –
- Returns:
ratio_texture
- Return type:
- meshExtract(mesh, texture, label_value)¶
Extracts a sub-mesh defined by a texture label value.
- Returns:
sub_mesh (AimsTimeSurface_3_VOID) – extracted sub-mesh
vertices (vector_ULONG) – indices of extracted vertices
- meshMerge(input_output_mesh, input_mesh)¶
Concatenates the second mesh to the first one. The first argument will be modified.
- Parameters:
input_output_mesh (AimsTimeSurface_3_VOID) – first mesh. Will be modified to be the output.
input_mesh (AimsTimeSurface_3_VOID) – second mesh to be appended to the first one.
- Return type:
None
- meshPlanarPolygon(plane, polygon)¶
Tesselate a planar polygon to fill it by a triangular mesh
- Parameters:
plane (Point4df) – plane equation
polygon (AimsTimeSurface_2_VOID) – planar polygon to tesselate. Typically, the output of cutMesh()
- Returns:
planar_mesh – the mesh filling the polygon
- Return type:
AimsSurfaceTriangle
- meshTextureBoundary(mesh, label_texture, region_value)¶
Extracts the boundary of region of value <region_value> of the input texture, on the mesh.
If region_value is negative, take boundaries of all regions. The input texture is a label texture.
- Parameters:
mesh (AimsSurfaceTriangle) – input mesh to extract boundary on
label_texture (TimeTexture_S16, TimeTexture_S32, or TimeTexture_FLOAT) – label texture defining regions on the mesh
region_value (int16, int32 or float) – label of the desired region
- Returns:
boundary – output segments mesh (filar mesh) for the boundary
- Return type:
- meshTransform(mesh, transformation)¶
Apply linear coordinates transformation to a mesh. The input mesh will be modified in-place.
- Parameters:
mesh (AimsTimeSurface_3_VOID or AimsTimeSurface_2_VOID) – mesh to be transformed. Will be modified.
transformation (AffineTransformation3d) – Linear transformation matrix
- Return type:
None
- meshVolume(mesh)¶
Volume inside a triangular mesh, in mm^3. The mesh must enclode a closed volume, with no holes, otherwise the volume processing will “leak” and will be wrong.
- nearestPointToMesh()¶
- rasterizeMesh(mesh, volume, value=2)¶
Rasterize polygons into a volume.
- Parameters:
mesh (AimsTimeSurface_*) –
volume (Volume_S16) – Volume to write mesh imprint to
value (int) – label value used to write the mesh imprint in the volume
- rasterizeMeshWireframe(mesh, volume, value=1)¶
Rasterize polygons edges into a volume.
- Parameters:
mesh (AimsTimeSurface_*) –
volume (Volume_S16) – Volume to write mesh imprint to
value (int) – label value used to write the mesh imprint in the volume
- refineMeshTri4(mesh, selected_polygons=None)¶
Refine a mesh by subdivising every triangle into 4 smaller ones.
- Parameters:
mesh (AimsSurfaceTriangle) – mesh to be refined
selected_polygons (vector_U32) – optional list of polygons indices to be selectively refined. Others will not be changed, unless they are at the border of a refined one, in which case they have to be split in some way.
- Returns:
refined_mesh – refined mesh
- Return type:
AimsSurfaceTriangle
- sortPolygonsAlongDirection(mesh, timestep, direction)¶
Sort polygons along a given direction. Polygons centers will be used for sorting. Only one timestep is performed (to be fast).
- Parameters:
mesh (AimsTimeSurface_*) – The mesh will be modified.
timestep (int) –
direction (Point3df) –
sortPolygonsAlongDirection(mesh, timestep, direction)
Sort polygons along a given direction. Polygons centers will be used for sorting. Only one timestep is performed (to be fast).
- Parameters:
mesh (AimstimeSurface_*) – The mesh will be modified.
timestep (int) –
direction (Point3df) –
sortPolygonsAlongDirection(mesh, timestep, direction)
Sort polygons along a given direction. Polygons centers will be used for sorting. Only one timestep is performed (to be fast).
- Parameters:
mesh (AimstimeSurface_*) – The mesh will be modified.
timestep (int) –
direction (Point3df) –
- splitTexturedMesh()¶
Split a textured mesh into a mesh and a texture
- surfaceNeighbours()¶
- soma.aims.Texture(*args, **kwargs)[source]¶
Create an instance of Aims low-level texture (Texture_<type>) from a type parameter, which may be specified as the dtype keyword argument, or as one of the arguments if one is identitied as a type.
The default type is ‘FLOAT’.
Type definitions should match those accepted by typeCode().
Texture may also use a numpy array, or another Textrue_* as unique argument.
- class soma.aims.Texture_DOUBLE¶
Bases:
wrapper
- append()¶
- array_struct()¶
- arraydata()¶
- assign()¶
- checkResize()¶
- data()¶
- erase()¶
- item()¶
- list()¶
- nItem()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- push_back()¶
- reserve()¶
- resize()¶
- size()¶
- class soma.aims.Texture_FLOAT¶
Bases:
wrapper
- append()¶
- array_struct()¶
- arraydata()¶
- assign()¶
- checkResize()¶
- data()¶
- erase()¶
- item()¶
- list()¶
- nItem()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- push_back()¶
- reserve()¶
- resize()¶
- size()¶
- class soma.aims.Texture_POINT2DF¶
Bases:
wrapper
- append()¶
- array_struct()¶
- arraydata()¶
- assign()¶
- checkResize()¶
- data()¶
- erase()¶
- item()¶
- list()¶
- nItem()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- push_back()¶
- reserve()¶
- resize()¶
- size()¶
- class soma.aims.Texture_S16¶
Bases:
wrapper
- append()¶
- array_struct()¶
- arraydata()¶
- assign()¶
- checkResize()¶
- data()¶
- erase()¶
- item()¶
- list()¶
- nItem()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- push_back()¶
- reserve()¶
- resize()¶
- size()¶
- class soma.aims.Texture_S32¶
Bases:
wrapper
- append()¶
- array_struct()¶
- arraydata()¶
- assign()¶
- checkResize()¶
- data()¶
- erase()¶
- item()¶
- list()¶
- nItem()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- push_back()¶
- reserve()¶
- resize()¶
- size()¶
- class soma.aims.Texture_U16¶
Bases:
wrapper
- append()¶
- array_struct()¶
- arraydata()¶
- assign()¶
- checkResize()¶
- data()¶
- erase()¶
- item()¶
- list()¶
- nItem()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- push_back()¶
- reserve()¶
- resize()¶
- size()¶
- class soma.aims.Texture_U32¶
Bases:
wrapper
- append()¶
- array_struct()¶
- arraydata()¶
- assign()¶
- checkResize()¶
- data()¶
- erase()¶
- item()¶
- list()¶
- nItem()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- push_back()¶
- reserve()¶
- resize()¶
- size()¶
- class soma.aims.Texture_U8¶
Bases:
wrapper
- append()¶
- array_struct()¶
- arraydata()¶
- assign()¶
- checkResize()¶
- data()¶
- erase()¶
- item()¶
- list()¶
- nItem()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- push_back()¶
- reserve()¶
- resize()¶
- size()¶
- soma.aims.TimeTexture(*args, **kwargs)[source]¶
Create an instance of Aims texture (TimeTexture_<type>) from a type parameter, which may be specified as the dtype keyword argument, or as one of the arguments if one is identitied as a type.
The default type is ‘FLOAT’.
Type definitions should match those accepted by typeCode(). TimeTexture may also use a numpy array, or another TimeTexture_* or Textrue_* as unique argument.
Building from a numpy arrays uses the 1st dimension as vertex, the 2nd as time (if any).
- class soma.aims.TimeTexture_DOUBLE(*args)¶
Bases:
RCObject
- erase()¶
- fromObject()¶
- has_key()¶
- header()¶
- items()¶
- iteritems()¶
- keys()¶
- nItem()¶
- push_back()¶
- reserve()¶
- size()¶
- class soma.aims.TimeTexture_FLOAT(*args)¶
Bases:
RCObject
- erase()¶
- fromObject()¶
- has_key()¶
- header()¶
- items()¶
- iteritems()¶
- keys()¶
- nItem()¶
- push_back()¶
- reserve()¶
- size()¶
- class soma.aims.TimeTexture_POINT2DF(*args)¶
Bases:
RCObject
- erase()¶
- fromObject()¶
- has_key()¶
- header()¶
- items()¶
- iteritems()¶
- keys()¶
- nItem()¶
- push_back()¶
- reserve()¶
- size()¶
- class soma.aims.TimeTexture_S16(*args)¶
Bases:
RCObject
- erase()¶
- fromObject()¶
- has_key()¶
- header()¶
- items()¶
- iteritems()¶
- keys()¶
- nItem()¶
- push_back()¶
- reserve()¶
- size()¶
- class soma.aims.TimeTexture_S32(*args)¶
Bases:
RCObject
- erase()¶
- fromObject()¶
- has_key()¶
- header()¶
- items()¶
- iteritems()¶
- keys()¶
- nItem()¶
- push_back()¶
- reserve()¶
- size()¶
- class soma.aims.TimeTexture_U16(*args)¶
Bases:
RCObject
- erase()¶
- fromObject()¶
- has_key()¶
- header()¶
- items()¶
- iteritems()¶
- keys()¶
- nItem()¶
- push_back()¶
- reserve()¶
- size()¶
- class soma.aims.TimeTexture_U32(*args)¶
Bases:
RCObject
- erase()¶
- fromObject()¶
- has_key()¶
- header()¶
- items()¶
- iteritems()¶
- keys()¶
- nItem()¶
- push_back()¶
- reserve()¶
- size()¶
- class soma.aims.TimeTexture_U8(*args)¶
Bases:
RCObject
- erase()¶
- fromObject()¶
- has_key()¶
- header()¶
- items()¶
- iteritems()¶
- keys()¶
- nItem()¶
- push_back()¶
- reserve()¶
- size()¶
- class soma.aims.Transformation(*args)¶
Bases:
RCObject
Base class for spatial transformations.
- header()¶
- isIdentity()¶
Test if the transformation can safely be omitted
This method must only return true if the transformation behaves exactly like an identity transformation (notably, the transform methods will always return the input coordinates unchanged).
NOTE: Implementors of derived classes may choose to always return false if a test would be difficult to implement or expensive to run.
- setHeader()¶
- class soma.aims.Transformation3d(*args)¶
Bases:
Transformation
Base class for spatial transformations in 3D.
- fromObject()¶
- toObject()¶
- transform()¶
- transformDouble()¶
- transformFloat()¶
- transformPoint3d()¶
- transformPoint3dd()¶
- transformPoint3df()¶
- transformPoints()¶
- class soma.aims.TransformationChain3d(*args)¶
Bases:
Transformation3d
Container for a composition of multiple transformations.
This container holds a list of transformations, and acts as the composition of all transformations. Transformations are composed from the front to the back of the list:
chain = TransformationChain3d() chain.push_back(t1) chain.push_back(t2) # chain->transform(p) == t2.transform(t1.transform(p))
warning: Do not modify the transformations once you have passed them to push_back() or push_front(): it is unspecified if the changes will be noticed by TransformationChain3d (a reference to the same object may be kept internally, or a copy could be made). This behaviour will allow optimizations to be implemented (e.g. composing adjacent affine transformations by multiplying their matrices).
- getInverse()¶
- invertible()¶
- isIdentity()¶
Test if the transformation can safely be omitted
This method must only return true if the transformation behaves exactly like an identity transformation (notably, the transform methods will always return the input coordinates unchanged).
NOTE: Implementors of derived classes may choose to always return false if a test would be difficult to implement or expensive to run.
- pop_back()¶
Remove the last transformation from the list
- pop_front()¶
Remove the first transformation from the list
- push_back(transformation)¶
Add a transformation to the back of the list (applied last)
- push_front(transformation)¶
Add a transformation to the front of the list (applied first)
- simplify()¶
Compute a simpler transformation that is equivalent to the chain.
The transformation chain is simplified by applying the following rules, so that it should provide equivalent results to the original chain, up to numerical precision:
The simplification is applied recursively to any sub-chain.
Transformations of the simplified sub-chains are inserted at the top level (i.e. the simplified chain is flat, it contains no sub-chains).
Consecutive affine transformations are composed using matrix multiplication.
Identity transforms (i.e. transforms for which Transformation::isIdentity() returns true) are removed from the list.
If the simplified chain consists of only one transformation, no chain is returned, the contained transformation is returned directly. However, the transformation is not necessarily the same instance that was inserted in the chain (it will be a copy if it is an AffineTransformation3d).
If the simplified chain is empty, an empty chain is returned.
No deep copy is made, so the result can contain pointers to the same transformations as the original chain.
- size()¶
- transformDouble()¶
- transformFloat()¶
- transformPoint3d()¶
- transformPoint3dd()¶
- transformPoint3df()¶
- class soma.aims.TransformationGraph3d(*args, **kwargs)¶
Bases:
Graph
Manage transformations (affine and non-linear) transformations graph.
It maintains a graph of directed transformations (vertices are referentials, edges are 3D transformations).
It can be populated from a dictionary (Object) which can be read from a JSON or YAML file, and performs lazy-loading: transformations are actually loaded when they are used, more precisely in getTransformation() and when building a chain of composed transformations.
The graph is oriented, and does not manage inverse transforms. We could thing this could be done automatically for affine or other inversible transformations, but the lazy loading feature does not allow to know if a not yet loaded transform will be inversible or not. So this has to be done manually for now.
The graph populates with composed transforms when they are used: indirect paths from a referential to another are generated when needed, and stored in the graph as “deduced” transforms. Later access will thus use this cache instead of reccomputing it. A drawback, thus, is that the graph has to be used “statically”: any modification in the graph structure, or in any of its transformations, should invalidate a number of deduced, cached ones, which we do not handle for now (it’s a quite difficult problem to manage it efficiently). To date the only solution is to completely clear the cached transforms (clearCache()) after any modification.
The TransformationGraph3d structure is a Graph, and its elements are Vertex or Edge objects. To manipulate transformations, the API generally allows to use identifiers (generally UUIDs) for elements, and the Transformation objects are accessed through the “transformation” property of edges, or using the transformation() convenience method:
ref1 = tgraph.referentialById(“23df7ce8-e405-bc31-3863-d543e3cc89e5”) trans_edge = tgraph.getTransformation(
“23df7ce8-e405-bc31-3863-d543e3cc89e5”, “52929a27-6838-1d08-d6fc-7905ed9413a0”)
- if trans_edge:
trans = tgraph.transformation(trans_edge)
see also: https://hbp-spatial-backend.apps.hbp.eu/swagger-ui#/api_v1/get_v1_transform_point
- asDict()¶
convert to a dict-like structure compatible with loadTransformationsGraph()
- Parameters:
affine_only (bool) – if true, inclue only affine transformations
allow_read (bool) – if true, and if affine_only or embed_affines is also true, all affine transformations will be read in order to determine which are affine. Otherwise only those already loaded in memory (via the lazy reading mechanism) will be known to be affine. This parameter has no effect on non-affine transformations.
embed_affines (bool) –
- if true, affine transformations are not recorded as a
file name (.trm format), but as an embedded 4x4 matrix.
- clearCache(chain_only=False)¶
remove deduced transformations (built from composition).
If chain_only is true, then inverses of direct transforms are not removed.
- clone()¶
- currentValue()¶
- getScalar()¶
- getString()¶
- getTransformChain()¶
Get a transformation chain between two vertices.
You normally don’t need to call this method directly, il is called through getTransformation( src_ref, dst_ref, true ). This method however does not modify the transformations graph and does not register the combined transformation. It will, however, load lazy-loading transformations.
- getTransformation()¶
edge = tgraph.getTransformation(src_ref, dst_ref, allow_compose=False)
Get the transformation between source_ref and dst_ref. If it is not a registered transformation, return None. src_ref annd dst_ref may be string IDs or Vertex objects.
If allow_compose is True and the transformation is not found, then a transformations chain path is looked for. If a matching one is found, it is then registered in the graph to allow fast access later. The drawback of this register operation is that it cannot react to changes in the transformation chain (if a new transformation is added and could make a shorter path, it will not be taken into account).
- getTransformation_raw(src_ref, dst_ref)¶
same as getTransformation(), but do not perform lazy loading
- hasSyntax()¶
- has_key()¶
- intKey()¶
- isArray()¶
- isDictionary()¶
- isDictionaryIterator()¶
- isDynArray()¶
- isIterable()¶
- isIterator()¶
- isValid()¶
- key()¶
- loadAffineTransformations()¶
Load all affine transformations.
- loadTransformationsGraph()¶
Load a full transformations graph from a dict-like object.
The description dict may typically be read from a .json or a .yaml file.
The description is organized as a 2-level dictionary:
{ source_ref_id: { dest_ref_id1: transformation_filename1, dest_ref_id2: transformation_filename2, }, ... }
A referential ID is a string which may represent an UUID, or a name.
A transformatioon filename may be an affine (.trm) or non-linear (.ima) transformation file, or an empty string to represent an identity transformation.
The transformation files are found relatively to the directory given as the dirname parameter.
Alternatively to file names, an affine transformation may be given directly as its 4x4 matrix, written as a line vector (all 16 coefficients in a vecotr, describing the matrix horizontally). Ex:
{ source_ref_id: { dest_ref_id1: [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], }, ... }
- objectIterator()¶
- referentialById()¶
Get the vertex (referential) with given ID
- registerInverseTransformations(loadAffines=False)¶
register inverse transformations when they can be obtained.
This can be done only for loaded transformations. So the lazy loading feature will prevent for it to work on not already loaded transformations, since we cannot know if they are invertible before they are loaded.
For this reason, the loadAffines parameter allows to load affine transforms and register their inverses.
- registerTransformation()¶
Add (or register) the given transformation in the transformations graph.
transform may be a filename, or a Transformation instance. a Transformation is supposed to be a non-linear FFD (Free Form Deformation), not a linear transformation. If transform is a string, it may be: - an empty string will be an identity transformation - a .trm file will be an affine transformation, and will be passed to
the builtin Anatomist system
another file (.ima) will be a FFD transformation file and will be registered as its filename. Loading will happen only when the transformation is used, in get_transformation().
- setSyntax()¶
- size()¶
- transformation()¶
Get the Transformation3d object inside an edge. The returned reference counting pointer may contain a null pointer.
Get the Transformation3d object for the given UUID. The returned reference counting pointer may contain a null pointer.
- transformationById()¶
Get the edge (transformation) with given ID
- type()¶
- updateIds()¶
Update the internal UUIDs cache. Needs to be done after changes in elements UUIDs or insertion / deletions
- class soma.aims.Tree(*args, **kwargs)¶
Bases:
GenericObject
- children()¶
- childrenSize()¶
- clone()¶
- currentValue()¶
- getScalar()¶
- getString()¶
- hasSyntax()¶
- has_key()¶
- insert()¶
- intKey()¶
- isArray()¶
- isDictionary()¶
- isDictionaryIterator()¶
- isDynArray()¶
- isIterable()¶
- isIterator()¶
- isNone()¶
- isScalar()¶
- isString()¶
- isValid()¶
- key()¶
- objectIterator()¶
- remove()¶
- setSyntax()¶
- size()¶
- type()¶
- exception soma.aims.ValueError¶
Bases:
StdException
- class soma.aims.Vertex(*args, **kwargs)¶
Bases:
GraphObject
- clone()¶
- currentValue()¶
- edges()¶
- edgesSize()¶
- getScalar()¶
- getString()¶
- hasSyntax()¶
- has_key()¶
- intKey()¶
- isArray()¶
- isDictionary()¶
- isDictionaryIterator()¶
- isDynArray()¶
- isIterable()¶
- isIterator()¶
- isValid()¶
- key()¶
- neighbours()¶
- objectIterator()¶
- randomNeighbour()¶
- setSyntax()¶
- size()¶
- type()¶
- soma.aims.Volume(*args, **kwargs)[source]¶
Create an instance of Aims Volume (Volume_<type>) from a type parameter, which may be specified as the dtype keyword argument, or as one of the arguments if one is identitied as a type. The default type is ‘FLOAT’. Type definitions should match those accepted by typeCode(). Volume may also use a numpy array, or another Volume as unique argument.
Note that Volume( Volume_* ) actually performs a copy of the data, whereas Volume( rc_ptr_Volume_* ) share the input data.
- soma.aims.VolumeView(volume, position, size)[source]¶
Create a view in an existing volume. The returned volume is of the same type and shares data with its “parent”.
- class soma.aims.Volume_BOOL(*args)¶
Bases:
RCObject
Generalities
The various Volume_<type> classes are bindings to the C++ template classes carto::Volume. It represents a 4D volume (1D to 4D, actually) storing a specific type of data: for instance S16 is signed 16 bit short ints, FLOAT is 32 bit floats, etc.
Volumes are read and written using the
Reader
andWriter
classes, which are in turn used by the simpleread()
andwrite()
functions.A volume of a given type can be built either using its specialized class constructor, or the general
Volume()
function which can take a voxel type in its arguments: the following are equivalent:>>> v = aims.Volume_S16(100, 100, 10) >>> v = aims.Volume('S16', 100, 100, 10) >>> v = aims.Volume(100, 100, 10, dtype='S16') >>> v = aims.Volume([100, 100, 10], dtype='S16') >>> import numpy >>> v = aims.Volume(numpy.int16, 100, 100, 10)
Numpy arrays and volumes
A volume is an array of voxels, which can be accessed via the
at()
method. For standard numeric types, it is also possible to get the voxels array as a numpy array, using the__array__()
method, or more conveniently,numpy.asarray(volume)
ornumpy.array(volume, copy=False)
. In aims >= 5.0.2, a more concise shortcut is also available:volume.np
(this is available on all types providing numpy bindings actually).The array returned is a reference to the actual data block, so any modification to its contents also affects the Volume contents, so it is generally an easy way of manipulating volume voxels because all the power of the numpy module can be used on Volumes. The obsoloete
arraydata()
method used to return a numpy array just like it is in memory, that is a 4D (or more) array generally indexed by[t][z][y][x]
(but it depands how it has been built), which is generally not what you like and is not consistent with AIMS indexing. Contrarily, usingvolume.np
sets strides in the returned numpy array, so that indexing is in the “normal” order[x][y][z][t]
, while still sharing the same memory block. The Volume object now also wraps the numpy accessors to the volume object itself, so thatvolume[x, y, z, t]
is the same asnupmy.asarray(volume)[x, y, z, t]
.new in PyAims 4.7
Since PyAims 4.7 the numpy arrays bindings have notably improved, and are now able to bind arrays to voxels types which are not scalar numeric types. Volumes of RGB, RGBA, HSV, or Point3df now have numpy bindings. The bound object have generally a “numpy struct” binding, that is not the usual C++/python object binding, but instead a structure managed by numpy which also supports indexing. For most objects we are using, they also have an array stucture (a RGB is an array with 3 int8 items), and are bound under a sturcture with a unique field, named “v” (for “vector”):
>>> v = aims.Volume('RGB', 100, 100, 10) >>> v[0, 0, 0, 0] ([0, 0, 0],)
Such an array may be indexed by the field name, which returns another array with scalar values and additional dimensions:
>>> v['v'].dtype dtype('uint8') >>> v['v'].shape (100, 100, 10, 1, 3)
Both arrays share their memory with the aims volume.
Header
Volumes also store a header which can contain various information (including sizes and voxel sizes). The header is a dictionary-like generic object (
Object
) which can be accessed by theheader()
method. This header object also has a read-write access with some restrictions inherent to theObject
mechanism. It will be saved with the volume contents when the volume is saved on disk.Volumes support a number of arithmetic operators like +, - etc. when the operands types and sizes match: for instance:
>>> # V1 and V2 are two volumes >>> V3 = V1 + V2 # adds two volumes >>> V2 -= V1 >>> V3 = V1 + 3 # adds 3 to aceh voxel >>> V3 = V1 * V2 # itemwise multiplication
Some type conversions can be performed on volumes, for istance to convert a Volume_S16 to a Volume_FLOAT. The simplest, to convert to another data type, is to use the
astype()
method.To convert a volume into diffent structure types, such as
Buckets
, use the converter classesConverter_<type1>_<type2>
andShallowConverter_<type1>_<type2>
with <type1> and <type2> being volume or other object types: for instanceConverter_Volume_S16_Volume_FLOAT
. The converter can also be called using type arguments:>>> vol1 = aims.AimsData('S16', 100, 100, 10) >>> c = aims.Converter(intype=vol1, outtype='BucketMap_VOID') >>> vol2 = c(vol1)
Volume from a numpy array
It is also possible to build a Volume from a numpy array:
>>> v = aims.Volume(numpy.zeros((100, 100, 10)))
Note that passing a 1D numpy array of ints will build a volume mapping the array contents, whereas passing a python list or tuple of ints will interpret the list as a shape for the volume:
>>> v = aims.Volume(numpy.array([100, 100, 10]).astype('int32')) >>> print(v.getSize()) [ 3, 1, 1, 1 ] >>> print(v.np) [100 100 10] >>> v = aims.Volume([100, 100, 10]) >>> print(v.getSize()) [ 100, 100, 10, 1 ]
Array ordering:
In pyaims <= 5.0.x the Volume classes were only working with the X axis (the first) being contiguous, and, for numpy, should be interpreted as “Fortran-contiguous”. So to convert a numpy array into a Volume and keep the same axes ordering, you had to convert it to Fortran order first:
>>> v = aims.Volume(numpy.zeros((2, 3, 4, dtype='int32'))) # v.getSize() used to return [4, 3, 2, 1] >>> v = aims.Volume(np.asfortranarray(numpy.zeros((2, 3, 4), dtype='int32'))) >>> print(v.getSize()) [2, 3, 4, 1]
In pyaims 5.1 this limitation is gone, you can omit the fortran order conversion. Strides are taken into account in the C++ volume. But you have to be careful with such volumes as many C++ programs assume internally that the X axis is contiguous in memory, which is not true in this situation. These programs and functions may not work, crash, or produce incorrect results when used with non-contiguous X axis volumes.
- class Position4Di¶
Bases:
wrapper
4 ints for position or size, used for Volume views.
- all()¶
- allocatorContext()¶
- any()¶
- arraydata()¶
Note
arraydata() returns a numpy array to the internal memory block, with “inverted” shape and strides.
WARNING: this is an obsolete method, which behaviour has changed. Most of the time you need numpy.asarray(volume), or more simply: volume.np, which actually provides an array with the same indices ordering. Here it is a transposed one.
Given the internal ordering of Aims Volumes, the resulting numpy array is indexed as [t][z][y][x]. This order corresponds to the numpy “fortran” order:
order='F'
If you need the inverse, more natural, [x][y][z][t] ordering, use the following:>>> volarray = volume.np
or:
>>> volarray = numpy.array(volume, copy=False)
or:
>>> volarray = numpy.asarray(volume)
Using arraydata(), as the indices are reversed, if you do something like:
vol2 = aims.Volume(vol.arraydata())
You will build a transposed volume.
- astype(dtype, copy=False)¶
Easy conversion method for volumes. Works in a similar was as numpy arrays astype() methods, except that the “copy” parameter defaults to False.
- Parameters:
dtype (string or type object) – may be a volume or voxel type, specified either as a type oject (int, aims.Volume_S32, numpy.int16), or as a string (“S16”…).
copy (bool) – if False, a ShallowConverter will be used: if dtype matches the current volume type, a shared reference to self will be returned. Otherwise a new copy will be returned.
- Return type:
A volume of the converted type
- at(posx, posy=0, posz=0, post=0)¶
Returns the volume value for the selected voxel.
at(posx1, posx2, posx3, posx4, posx5, posx6=0, posx7=0, posx8=0)
Returns the volume value for the selected voxel.
at(vector_int)
Returns the volume value for the selected voxel.
- checkResize()¶
- copyHeaderFrom()¶
- fill(value)¶
Fill Volume_BOOL using the given value.
- fillBorder(value)¶
Fill the surrounding of the volume view in the reference volume (if any) using the given value.
- fromObject()¶
- getBorders()¶
- getSize()¶
Number of voxels in each dimension (list of 4 ints)
- getSizeT()¶
- getSizeX()¶
- getSizeY()¶
- getSizeZ()¶
- getStrides()¶
- getVoxelSize()¶
Voxel sizes in mm (list of 4 floats)
- header()¶
The header contains all meta-data.
- max()¶
- min()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- posInRefVolume()¶
If the volume is a view into another (larger) one, this returns the position in “parent” one.
- refVolume()¶
If the volume is a view into another (larger) one, this returns the “parent” one.
- setPosInRefVolume()¶
Set position in parent volume
- setValue(value, x, y=0, z=0, t=0)¶
Set the voxel value at the given position.
setValue(value, [x1, x2, x3, x4, x5, x6…])
Set the voxel value at the given position.
- setVoxelSize(vs_list)¶
- setVoxelSize(vx, vy=1., vz=1., vt=1.) None
Set voxel sizes in mm (list of at least 4 floats)
- property shape¶
- class soma.aims.Volume_CDOUBLE(*args)¶
Bases:
RCObject
Generalities
The various Volume_<type> classes are bindings to the C++ template classes carto::Volume. It represents a 4D volume (1D to 4D, actually) storing a specific type of data: for instance S16 is signed 16 bit short ints, FLOAT is 32 bit floats, etc.
Volumes are read and written using the
Reader
andWriter
classes, which are in turn used by the simpleread()
andwrite()
functions.A volume of a given type can be built either using its specialized class constructor, or the general
Volume()
function which can take a voxel type in its arguments: the following are equivalent:>>> v = aims.Volume_S16(100, 100, 10) >>> v = aims.Volume('S16', 100, 100, 10) >>> v = aims.Volume(100, 100, 10, dtype='S16') >>> v = aims.Volume([100, 100, 10], dtype='S16') >>> import numpy >>> v = aims.Volume(numpy.int16, 100, 100, 10)
Numpy arrays and volumes
A volume is an array of voxels, which can be accessed via the
at()
method. For standard numeric types, it is also possible to get the voxels array as a numpy array, using the__array__()
method, or more conveniently,numpy.asarray(volume)
ornumpy.array(volume, copy=False)
. In aims >= 5.0.2, a more concise shortcut is also available:volume.np
(this is available on all types providing numpy bindings actually).The array returned is a reference to the actual data block, so any modification to its contents also affects the Volume contents, so it is generally an easy way of manipulating volume voxels because all the power of the numpy module can be used on Volumes. The obsoloete
arraydata()
method used to return a numpy array just like it is in memory, that is a 4D (or more) array generally indexed by[t][z][y][x]
(but it depands how it has been built), which is generally not what you like and is not consistent with AIMS indexing. Contrarily, usingvolume.np
sets strides in the returned numpy array, so that indexing is in the “normal” order[x][y][z][t]
, while still sharing the same memory block. The Volume object now also wraps the numpy accessors to the volume object itself, so thatvolume[x, y, z, t]
is the same asnupmy.asarray(volume)[x, y, z, t]
.new in PyAims 4.7
Since PyAims 4.7 the numpy arrays bindings have notably improved, and are now able to bind arrays to voxels types which are not scalar numeric types. Volumes of RGB, RGBA, HSV, or Point3df now have numpy bindings. The bound object have generally a “numpy struct” binding, that is not the usual C++/python object binding, but instead a structure managed by numpy which also supports indexing. For most objects we are using, they also have an array stucture (a RGB is an array with 3 int8 items), and are bound under a sturcture with a unique field, named “v” (for “vector”):
>>> v = aims.Volume('RGB', 100, 100, 10) >>> v[0, 0, 0, 0] ([0, 0, 0],)
Such an array may be indexed by the field name, which returns another array with scalar values and additional dimensions:
>>> v['v'].dtype dtype('uint8') >>> v['v'].shape (100, 100, 10, 1, 3)
Both arrays share their memory with the aims volume.
Header
Volumes also store a header which can contain various information (including sizes and voxel sizes). The header is a dictionary-like generic object (
Object
) which can be accessed by theheader()
method. This header object also has a read-write access with some restrictions inherent to theObject
mechanism. It will be saved with the volume contents when the volume is saved on disk.Volumes support a number of arithmetic operators like +, - etc. when the operands types and sizes match: for instance:
>>> # V1 and V2 are two volumes >>> V3 = V1 + V2 # adds two volumes >>> V2 -= V1 >>> V3 = V1 + 3 # adds 3 to aceh voxel >>> V3 = V1 * V2 # itemwise multiplication
Some type conversions can be performed on volumes, for istance to convert a Volume_S16 to a Volume_FLOAT. The simplest, to convert to another data type, is to use the
astype()
method.To convert a volume into diffent structure types, such as
Buckets
, use the converter classesConverter_<type1>_<type2>
andShallowConverter_<type1>_<type2>
with <type1> and <type2> being volume or other object types: for instanceConverter_Volume_S16_Volume_FLOAT
. The converter can also be called using type arguments:>>> vol1 = aims.AimsData('S16', 100, 100, 10) >>> c = aims.Converter(intype=vol1, outtype='BucketMap_VOID') >>> vol2 = c(vol1)
Volume from a numpy array
It is also possible to build a Volume from a numpy array:
>>> v = aims.Volume(numpy.zeros((100, 100, 10)))
Note that passing a 1D numpy array of ints will build a volume mapping the array contents, whereas passing a python list or tuple of ints will interpret the list as a shape for the volume:
>>> v = aims.Volume(numpy.array([100, 100, 10]).astype('int32')) >>> print(v.getSize()) [ 3, 1, 1, 1 ] >>> print(v.np) [100 100 10] >>> v = aims.Volume([100, 100, 10]) >>> print(v.getSize()) [ 100, 100, 10, 1 ]
Array ordering:
In pyaims <= 5.0.x the Volume classes were only working with the X axis (the first) being contiguous, and, for numpy, should be interpreted as “Fortran-contiguous”. So to convert a numpy array into a Volume and keep the same axes ordering, you had to convert it to Fortran order first:
>>> v = aims.Volume(numpy.zeros((2, 3, 4, dtype='int32'))) # v.getSize() used to return [4, 3, 2, 1] >>> v = aims.Volume(np.asfortranarray(numpy.zeros((2, 3, 4), dtype='int32'))) >>> print(v.getSize()) [2, 3, 4, 1]
In pyaims 5.1 this limitation is gone, you can omit the fortran order conversion. Strides are taken into account in the C++ volume. But you have to be careful with such volumes as many C++ programs assume internally that the X axis is contiguous in memory, which is not true in this situation. These programs and functions may not work, crash, or produce incorrect results when used with non-contiguous X axis volumes.
- class Position4Di¶
Bases:
wrapper
4 ints for position or size, used for Volume views.
- all()¶
- allocatorContext()¶
- any()¶
- arraydata()¶
Note
arraydata() returns a numpy array to the internal memory block, with “inverted” shape and strides.
WARNING: this is an obsolete method, which behaviour has changed. Most of the time you need numpy.asarray(volume), or more simply: volume.np, which actually provides an array with the same indices ordering. Here it is a transposed one.
Given the internal ordering of Aims Volumes, the resulting numpy array is indexed as [t][z][y][x]. This order corresponds to the numpy “fortran” order:
order='F'
If you need the inverse, more natural, [x][y][z][t] ordering, use the following:>>> volarray = volume.np
or:
>>> volarray = numpy.array(volume, copy=False)
or:
>>> volarray = numpy.asarray(volume)
Using arraydata(), as the indices are reversed, if you do something like:
vol2 = aims.Volume(vol.arraydata())
You will build a transposed volume.
- astype(dtype, copy=False)¶
Easy conversion method for volumes. Works in a similar was as numpy arrays astype() methods, except that the “copy” parameter defaults to False.
- Parameters:
dtype (string or type object) – may be a volume or voxel type, specified either as a type oject (int, aims.Volume_S32, numpy.int16), or as a string (“S16”…).
copy (bool) – if False, a ShallowConverter will be used: if dtype matches the current volume type, a shared reference to self will be returned. Otherwise a new copy will be returned.
- Return type:
A volume of the converted type
- at(posx, posy=0, posz=0, post=0)¶
Returns the volume value for the selected voxel.
at(posx1, posx2, posx3, posx4, posx5, posx6=0, posx7=0, posx8=0)
Returns the volume value for the selected voxel.
at(vector_int)
Returns the volume value for the selected voxel.
- checkResize()¶
- copyHeaderFrom()¶
- fill(value)¶
Fill Volume_CDOUBLE using the given value.
- fillBorder(value)¶
Fill the surrounding of the volume view in the reference volume (if any) using the given value.
- fromObject()¶
- getBorders()¶
- getSize()¶
Number of voxels in each dimension (list of 4 ints)
- getSizeT()¶
- getSizeX()¶
- getSizeY()¶
- getSizeZ()¶
- getStrides()¶
- getVoxelSize()¶
Voxel sizes in mm (list of 4 floats)
- header()¶
The header contains all meta-data.
- max()¶
- min()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- posInRefVolume()¶
If the volume is a view into another (larger) one, this returns the position in “parent” one.
- refVolume()¶
If the volume is a view into another (larger) one, this returns the “parent” one.
- setPosInRefVolume()¶
Set position in parent volume
- setValue(value, x, y=0, z=0, t=0)¶
Set the voxel value at the given position.
setValue(value, [x1, x2, x3, x4, x5, x6…])
Set the voxel value at the given position.
- setVoxelSize(vs_list)¶
- setVoxelSize(vx, vy=1., vz=1., vt=1.) None
Set voxel sizes in mm (list of at least 4 floats)
- property shape¶
- class soma.aims.Volume_CFLOAT(*args)¶
Bases:
RCObject
Generalities
The various Volume_<type> classes are bindings to the C++ template classes carto::Volume. It represents a 4D volume (1D to 4D, actually) storing a specific type of data: for instance S16 is signed 16 bit short ints, FLOAT is 32 bit floats, etc.
Volumes are read and written using the
Reader
andWriter
classes, which are in turn used by the simpleread()
andwrite()
functions.A volume of a given type can be built either using its specialized class constructor, or the general
Volume()
function which can take a voxel type in its arguments: the following are equivalent:>>> v = aims.Volume_S16(100, 100, 10) >>> v = aims.Volume('S16', 100, 100, 10) >>> v = aims.Volume(100, 100, 10, dtype='S16') >>> v = aims.Volume([100, 100, 10], dtype='S16') >>> import numpy >>> v = aims.Volume(numpy.int16, 100, 100, 10)
Numpy arrays and volumes
A volume is an array of voxels, which can be accessed via the
at()
method. For standard numeric types, it is also possible to get the voxels array as a numpy array, using the__array__()
method, or more conveniently,numpy.asarray(volume)
ornumpy.array(volume, copy=False)
. In aims >= 5.0.2, a more concise shortcut is also available:volume.np
(this is available on all types providing numpy bindings actually).The array returned is a reference to the actual data block, so any modification to its contents also affects the Volume contents, so it is generally an easy way of manipulating volume voxels because all the power of the numpy module can be used on Volumes. The obsoloete
arraydata()
method used to return a numpy array just like it is in memory, that is a 4D (or more) array generally indexed by[t][z][y][x]
(but it depands how it has been built), which is generally not what you like and is not consistent with AIMS indexing. Contrarily, usingvolume.np
sets strides in the returned numpy array, so that indexing is in the “normal” order[x][y][z][t]
, while still sharing the same memory block. The Volume object now also wraps the numpy accessors to the volume object itself, so thatvolume[x, y, z, t]
is the same asnupmy.asarray(volume)[x, y, z, t]
.new in PyAims 4.7
Since PyAims 4.7 the numpy arrays bindings have notably improved, and are now able to bind arrays to voxels types which are not scalar numeric types. Volumes of RGB, RGBA, HSV, or Point3df now have numpy bindings. The bound object have generally a “numpy struct” binding, that is not the usual C++/python object binding, but instead a structure managed by numpy which also supports indexing. For most objects we are using, they also have an array stucture (a RGB is an array with 3 int8 items), and are bound under a sturcture with a unique field, named “v” (for “vector”):
>>> v = aims.Volume('RGB', 100, 100, 10) >>> v[0, 0, 0, 0] ([0, 0, 0],)
Such an array may be indexed by the field name, which returns another array with scalar values and additional dimensions:
>>> v['v'].dtype dtype('uint8') >>> v['v'].shape (100, 100, 10, 1, 3)
Both arrays share their memory with the aims volume.
Header
Volumes also store a header which can contain various information (including sizes and voxel sizes). The header is a dictionary-like generic object (
Object
) which can be accessed by theheader()
method. This header object also has a read-write access with some restrictions inherent to theObject
mechanism. It will be saved with the volume contents when the volume is saved on disk.Volumes support a number of arithmetic operators like +, - etc. when the operands types and sizes match: for instance:
>>> # V1 and V2 are two volumes >>> V3 = V1 + V2 # adds two volumes >>> V2 -= V1 >>> V3 = V1 + 3 # adds 3 to aceh voxel >>> V3 = V1 * V2 # itemwise multiplication
Some type conversions can be performed on volumes, for istance to convert a Volume_S16 to a Volume_FLOAT. The simplest, to convert to another data type, is to use the
astype()
method.To convert a volume into diffent structure types, such as
Buckets
, use the converter classesConverter_<type1>_<type2>
andShallowConverter_<type1>_<type2>
with <type1> and <type2> being volume or other object types: for instanceConverter_Volume_S16_Volume_FLOAT
. The converter can also be called using type arguments:>>> vol1 = aims.AimsData('S16', 100, 100, 10) >>> c = aims.Converter(intype=vol1, outtype='BucketMap_VOID') >>> vol2 = c(vol1)
Volume from a numpy array
It is also possible to build a Volume from a numpy array:
>>> v = aims.Volume(numpy.zeros((100, 100, 10)))
Note that passing a 1D numpy array of ints will build a volume mapping the array contents, whereas passing a python list or tuple of ints will interpret the list as a shape for the volume:
>>> v = aims.Volume(numpy.array([100, 100, 10]).astype('int32')) >>> print(v.getSize()) [ 3, 1, 1, 1 ] >>> print(v.np) [100 100 10] >>> v = aims.Volume([100, 100, 10]) >>> print(v.getSize()) [ 100, 100, 10, 1 ]
Array ordering:
In pyaims <= 5.0.x the Volume classes were only working with the X axis (the first) being contiguous, and, for numpy, should be interpreted as “Fortran-contiguous”. So to convert a numpy array into a Volume and keep the same axes ordering, you had to convert it to Fortran order first:
>>> v = aims.Volume(numpy.zeros((2, 3, 4, dtype='int32'))) # v.getSize() used to return [4, 3, 2, 1] >>> v = aims.Volume(np.asfortranarray(numpy.zeros((2, 3, 4), dtype='int32'))) >>> print(v.getSize()) [2, 3, 4, 1]
In pyaims 5.1 this limitation is gone, you can omit the fortran order conversion. Strides are taken into account in the C++ volume. But you have to be careful with such volumes as many C++ programs assume internally that the X axis is contiguous in memory, which is not true in this situation. These programs and functions may not work, crash, or produce incorrect results when used with non-contiguous X axis volumes.
- class Position4Di¶
Bases:
wrapper
4 ints for position or size, used for Volume views.
- all()¶
- allocatorContext()¶
- any()¶
- arraydata()¶
Note
arraydata() returns a numpy array to the internal memory block, with “inverted” shape and strides.
WARNING: this is an obsolete method, which behaviour has changed. Most of the time you need numpy.asarray(volume), or more simply: volume.np, which actually provides an array with the same indices ordering. Here it is a transposed one.
Given the internal ordering of Aims Volumes, the resulting numpy array is indexed as [t][z][y][x]. This order corresponds to the numpy “fortran” order:
order='F'
If you need the inverse, more natural, [x][y][z][t] ordering, use the following:>>> volarray = volume.np
or:
>>> volarray = numpy.array(volume, copy=False)
or:
>>> volarray = numpy.asarray(volume)
Using arraydata(), as the indices are reversed, if you do something like:
vol2 = aims.Volume(vol.arraydata())
You will build a transposed volume.
- astype(dtype, copy=False)¶
Easy conversion method for volumes. Works in a similar was as numpy arrays astype() methods, except that the “copy” parameter defaults to False.
- Parameters:
dtype (string or type object) – may be a volume or voxel type, specified either as a type oject (int, aims.Volume_S32, numpy.int16), or as a string (“S16”…).
copy (bool) – if False, a ShallowConverter will be used: if dtype matches the current volume type, a shared reference to self will be returned. Otherwise a new copy will be returned.
- Return type:
A volume of the converted type
- at(posx, posy=0, posz=0, post=0)¶
Returns the volume value for the selected voxel.
at(posx1, posx2, posx3, posx4, posx5, posx6=0, posx7=0, posx8=0)
Returns the volume value for the selected voxel.
at(vector_int)
Returns the volume value for the selected voxel.
- checkResize()¶
- copyHeaderFrom()¶
- fill(value)¶
Fill Volume_CFLOAT using the given value.
- fillBorder(value)¶
Fill the surrounding of the volume view in the reference volume (if any) using the given value.
- fromObject()¶
- getBorders()¶
- getSize()¶
Number of voxels in each dimension (list of 4 ints)
- getSizeT()¶
- getSizeX()¶
- getSizeY()¶
- getSizeZ()¶
- getStrides()¶
- getVoxelSize()¶
Voxel sizes in mm (list of 4 floats)
- header()¶
The header contains all meta-data.
- max()¶
- min()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- posInRefVolume()¶
If the volume is a view into another (larger) one, this returns the position in “parent” one.
- refVolume()¶
If the volume is a view into another (larger) one, this returns the “parent” one.
- setPosInRefVolume()¶
Set position in parent volume
- setValue(value, x, y=0, z=0, t=0)¶
Set the voxel value at the given position.
setValue(value, [x1, x2, x3, x4, x5, x6…])
Set the voxel value at the given position.
- setVoxelSize(vs_list)¶
- setVoxelSize(vx, vy=1., vz=1., vt=1.) None
Set voxel sizes in mm (list of at least 4 floats)
- property shape¶
- class soma.aims.Volume_DOUBLE(*args)¶
Bases:
RCObject
Generalities
The various Volume_<type> classes are bindings to the C++ template classes carto::Volume. It represents a 4D volume (1D to 4D, actually) storing a specific type of data: for instance S16 is signed 16 bit short ints, FLOAT is 32 bit floats, etc.
Volumes are read and written using the
Reader
andWriter
classes, which are in turn used by the simpleread()
andwrite()
functions.A volume of a given type can be built either using its specialized class constructor, or the general
Volume()
function which can take a voxel type in its arguments: the following are equivalent:>>> v = aims.Volume_S16(100, 100, 10) >>> v = aims.Volume('S16', 100, 100, 10) >>> v = aims.Volume(100, 100, 10, dtype='S16') >>> v = aims.Volume([100, 100, 10], dtype='S16') >>> import numpy >>> v = aims.Volume(numpy.int16, 100, 100, 10)
Numpy arrays and volumes
A volume is an array of voxels, which can be accessed via the
at()
method. For standard numeric types, it is also possible to get the voxels array as a numpy array, using the__array__()
method, or more conveniently,numpy.asarray(volume)
ornumpy.array(volume, copy=False)
. In aims >= 5.0.2, a more concise shortcut is also available:volume.np
(this is available on all types providing numpy bindings actually).The array returned is a reference to the actual data block, so any modification to its contents also affects the Volume contents, so it is generally an easy way of manipulating volume voxels because all the power of the numpy module can be used on Volumes. The obsoloete
arraydata()
method used to return a numpy array just like it is in memory, that is a 4D (or more) array generally indexed by[t][z][y][x]
(but it depands how it has been built), which is generally not what you like and is not consistent with AIMS indexing. Contrarily, usingvolume.np
sets strides in the returned numpy array, so that indexing is in the “normal” order[x][y][z][t]
, while still sharing the same memory block. The Volume object now also wraps the numpy accessors to the volume object itself, so thatvolume[x, y, z, t]
is the same asnupmy.asarray(volume)[x, y, z, t]
.new in PyAims 4.7
Since PyAims 4.7 the numpy arrays bindings have notably improved, and are now able to bind arrays to voxels types which are not scalar numeric types. Volumes of RGB, RGBA, HSV, or Point3df now have numpy bindings. The bound object have generally a “numpy struct” binding, that is not the usual C++/python object binding, but instead a structure managed by numpy which also supports indexing. For most objects we are using, they also have an array stucture (a RGB is an array with 3 int8 items), and are bound under a sturcture with a unique field, named “v” (for “vector”):
>>> v = aims.Volume('RGB', 100, 100, 10) >>> v[0, 0, 0, 0] ([0, 0, 0],)
Such an array may be indexed by the field name, which returns another array with scalar values and additional dimensions:
>>> v['v'].dtype dtype('uint8') >>> v['v'].shape (100, 100, 10, 1, 3)
Both arrays share their memory with the aims volume.
Header
Volumes also store a header which can contain various information (including sizes and voxel sizes). The header is a dictionary-like generic object (
Object
) which can be accessed by theheader()
method. This header object also has a read-write access with some restrictions inherent to theObject
mechanism. It will be saved with the volume contents when the volume is saved on disk.Volumes support a number of arithmetic operators like +, - etc. when the operands types and sizes match: for instance:
>>> # V1 and V2 are two volumes >>> V3 = V1 + V2 # adds two volumes >>> V2 -= V1 >>> V3 = V1 + 3 # adds 3 to aceh voxel >>> V3 = V1 * V2 # itemwise multiplication
Some type conversions can be performed on volumes, for istance to convert a Volume_S16 to a Volume_FLOAT. The simplest, to convert to another data type, is to use the
astype()
method.To convert a volume into diffent structure types, such as
Buckets
, use the converter classesConverter_<type1>_<type2>
andShallowConverter_<type1>_<type2>
with <type1> and <type2> being volume or other object types: for instanceConverter_Volume_S16_Volume_FLOAT
. The converter can also be called using type arguments:>>> vol1 = aims.AimsData('S16', 100, 100, 10) >>> c = aims.Converter(intype=vol1, outtype='BucketMap_VOID') >>> vol2 = c(vol1)
Volume from a numpy array
It is also possible to build a Volume from a numpy array:
>>> v = aims.Volume(numpy.zeros((100, 100, 10)))
Note that passing a 1D numpy array of ints will build a volume mapping the array contents, whereas passing a python list or tuple of ints will interpret the list as a shape for the volume:
>>> v = aims.Volume(numpy.array([100, 100, 10]).astype('int32')) >>> print(v.getSize()) [ 3, 1, 1, 1 ] >>> print(v.np) [100 100 10] >>> v = aims.Volume([100, 100, 10]) >>> print(v.getSize()) [ 100, 100, 10, 1 ]
Array ordering:
In pyaims <= 5.0.x the Volume classes were only working with the X axis (the first) being contiguous, and, for numpy, should be interpreted as “Fortran-contiguous”. So to convert a numpy array into a Volume and keep the same axes ordering, you had to convert it to Fortran order first:
>>> v = aims.Volume(numpy.zeros((2, 3, 4, dtype='int32'))) # v.getSize() used to return [4, 3, 2, 1] >>> v = aims.Volume(np.asfortranarray(numpy.zeros((2, 3, 4), dtype='int32'))) >>> print(v.getSize()) [2, 3, 4, 1]
In pyaims 5.1 this limitation is gone, you can omit the fortran order conversion. Strides are taken into account in the C++ volume. But you have to be careful with such volumes as many C++ programs assume internally that the X axis is contiguous in memory, which is not true in this situation. These programs and functions may not work, crash, or produce incorrect results when used with non-contiguous X axis volumes.
- class Position4Di¶
Bases:
wrapper
4 ints for position or size, used for Volume views.
- all()¶
- allocatorContext()¶
- any()¶
- arraydata()¶
Note
arraydata() returns a numpy array to the internal memory block, with “inverted” shape and strides.
WARNING: this is an obsolete method, which behaviour has changed. Most of the time you need numpy.asarray(volume), or more simply: volume.np, which actually provides an array with the same indices ordering. Here it is a transposed one.
Given the internal ordering of Aims Volumes, the resulting numpy array is indexed as [t][z][y][x]. This order corresponds to the numpy “fortran” order:
order='F'
If you need the inverse, more natural, [x][y][z][t] ordering, use the following:>>> volarray = volume.np
or:
>>> volarray = numpy.array(volume, copy=False)
or:
>>> volarray = numpy.asarray(volume)
Using arraydata(), as the indices are reversed, if you do something like:
vol2 = aims.Volume(vol.arraydata())
You will build a transposed volume.
- astype(dtype, copy=False)¶
Easy conversion method for volumes. Works in a similar was as numpy arrays astype() methods, except that the “copy” parameter defaults to False.
- Parameters:
dtype (string or type object) – may be a volume or voxel type, specified either as a type oject (int, aims.Volume_S32, numpy.int16), or as a string (“S16”…).
copy (bool) – if False, a ShallowConverter will be used: if dtype matches the current volume type, a shared reference to self will be returned. Otherwise a new copy will be returned.
- Return type:
A volume of the converted type
- at(posx, posy=0, posz=0, post=0)¶
Returns the volume value for the selected voxel.
at(posx1, posx2, posx3, posx4, posx5, posx6=0, posx7=0, posx8=0)
Returns the volume value for the selected voxel.
at(vector_int)
Returns the volume value for the selected voxel.
- checkResize()¶
- copyHeaderFrom()¶
- fill(value)¶
Fill Volume_DOUBLE using the given value.
- fillBorder(value)¶
Fill the surrounding of the volume view in the reference volume (if any) using the given value.
- fromObject()¶
- getBorders()¶
- getSize()¶
Number of voxels in each dimension (list of 4 ints)
- getSizeT()¶
- getSizeX()¶
- getSizeY()¶
- getSizeZ()¶
- getStrides()¶
- getVoxelSize()¶
Voxel sizes in mm (list of 4 floats)
- header()¶
The header contains all meta-data.
- max()¶
- min()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- posInRefVolume()¶
If the volume is a view into another (larger) one, this returns the position in “parent” one.
- refVolume()¶
If the volume is a view into another (larger) one, this returns the “parent” one.
- setPosInRefVolume()¶
Set position in parent volume
- setValue(value, x, y=0, z=0, t=0)¶
Set the voxel value at the given position.
setValue(value, [x1, x2, x3, x4, x5, x6…])
Set the voxel value at the given position.
- setVoxelSize(vs_list)¶
- setVoxelSize(vx, vy=1., vz=1., vt=1.) None
Set voxel sizes in mm (list of at least 4 floats)
- property shape¶
- class soma.aims.Volume_FLOAT(*args)¶
Bases:
RCObject
Generalities
The various Volume_<type> classes are bindings to the C++ template classes carto::Volume. It represents a 4D volume (1D to 4D, actually) storing a specific type of data: for instance S16 is signed 16 bit short ints, FLOAT is 32 bit floats, etc.
Volumes are read and written using the
Reader
andWriter
classes, which are in turn used by the simpleread()
andwrite()
functions.A volume of a given type can be built either using its specialized class constructor, or the general
Volume()
function which can take a voxel type in its arguments: the following are equivalent:>>> v = aims.Volume_S16(100, 100, 10) >>> v = aims.Volume('S16', 100, 100, 10) >>> v = aims.Volume(100, 100, 10, dtype='S16') >>> v = aims.Volume([100, 100, 10], dtype='S16') >>> import numpy >>> v = aims.Volume(numpy.int16, 100, 100, 10)
Numpy arrays and volumes
A volume is an array of voxels, which can be accessed via the
at()
method. For standard numeric types, it is also possible to get the voxels array as a numpy array, using the__array__()
method, or more conveniently,numpy.asarray(volume)
ornumpy.array(volume, copy=False)
. In aims >= 5.0.2, a more concise shortcut is also available:volume.np
(this is available on all types providing numpy bindings actually).The array returned is a reference to the actual data block, so any modification to its contents also affects the Volume contents, so it is generally an easy way of manipulating volume voxels because all the power of the numpy module can be used on Volumes. The obsoloete
arraydata()
method used to return a numpy array just like it is in memory, that is a 4D (or more) array generally indexed by[t][z][y][x]
(but it depands how it has been built), which is generally not what you like and is not consistent with AIMS indexing. Contrarily, usingvolume.np
sets strides in the returned numpy array, so that indexing is in the “normal” order[x][y][z][t]
, while still sharing the same memory block. The Volume object now also wraps the numpy accessors to the volume object itself, so thatvolume[x, y, z, t]
is the same asnupmy.asarray(volume)[x, y, z, t]
.new in PyAims 4.7
Since PyAims 4.7 the numpy arrays bindings have notably improved, and are now able to bind arrays to voxels types which are not scalar numeric types. Volumes of RGB, RGBA, HSV, or Point3df now have numpy bindings. The bound object have generally a “numpy struct” binding, that is not the usual C++/python object binding, but instead a structure managed by numpy which also supports indexing. For most objects we are using, they also have an array stucture (a RGB is an array with 3 int8 items), and are bound under a sturcture with a unique field, named “v” (for “vector”):
>>> v = aims.Volume('RGB', 100, 100, 10) >>> v[0, 0, 0, 0] ([0, 0, 0],)
Such an array may be indexed by the field name, which returns another array with scalar values and additional dimensions:
>>> v['v'].dtype dtype('uint8') >>> v['v'].shape (100, 100, 10, 1, 3)
Both arrays share their memory with the aims volume.
Header
Volumes also store a header which can contain various information (including sizes and voxel sizes). The header is a dictionary-like generic object (
Object
) which can be accessed by theheader()
method. This header object also has a read-write access with some restrictions inherent to theObject
mechanism. It will be saved with the volume contents when the volume is saved on disk.Volumes support a number of arithmetic operators like +, - etc. when the operands types and sizes match: for instance:
>>> # V1 and V2 are two volumes >>> V3 = V1 + V2 # adds two volumes >>> V2 -= V1 >>> V3 = V1 + 3 # adds 3 to aceh voxel >>> V3 = V1 * V2 # itemwise multiplication
Some type conversions can be performed on volumes, for istance to convert a Volume_S16 to a Volume_FLOAT. The simplest, to convert to another data type, is to use the
astype()
method.To convert a volume into diffent structure types, such as
Buckets
, use the converter classesConverter_<type1>_<type2>
andShallowConverter_<type1>_<type2>
with <type1> and <type2> being volume or other object types: for instanceConverter_Volume_S16_Volume_FLOAT
. The converter can also be called using type arguments:>>> vol1 = aims.AimsData('S16', 100, 100, 10) >>> c = aims.Converter(intype=vol1, outtype='BucketMap_VOID') >>> vol2 = c(vol1)
Volume from a numpy array
It is also possible to build a Volume from a numpy array:
>>> v = aims.Volume(numpy.zeros((100, 100, 10)))
Note that passing a 1D numpy array of ints will build a volume mapping the array contents, whereas passing a python list or tuple of ints will interpret the list as a shape for the volume:
>>> v = aims.Volume(numpy.array([100, 100, 10]).astype('int32')) >>> print(v.getSize()) [ 3, 1, 1, 1 ] >>> print(v.np) [100 100 10] >>> v = aims.Volume([100, 100, 10]) >>> print(v.getSize()) [ 100, 100, 10, 1 ]
Array ordering:
In pyaims <= 5.0.x the Volume classes were only working with the X axis (the first) being contiguous, and, for numpy, should be interpreted as “Fortran-contiguous”. So to convert a numpy array into a Volume and keep the same axes ordering, you had to convert it to Fortran order first:
>>> v = aims.Volume(numpy.zeros((2, 3, 4, dtype='int32'))) # v.getSize() used to return [4, 3, 2, 1] >>> v = aims.Volume(np.asfortranarray(numpy.zeros((2, 3, 4), dtype='int32'))) >>> print(v.getSize()) [2, 3, 4, 1]
In pyaims 5.1 this limitation is gone, you can omit the fortran order conversion. Strides are taken into account in the C++ volume. But you have to be careful with such volumes as many C++ programs assume internally that the X axis is contiguous in memory, which is not true in this situation. These programs and functions may not work, crash, or produce incorrect results when used with non-contiguous X axis volumes.
- class Position4Di¶
Bases:
wrapper
4 ints for position or size, used for Volume views.
- all()¶
- allocatorContext()¶
- any()¶
- arraydata()¶
Note
arraydata() returns a numpy array to the internal memory block, with “inverted” shape and strides.
WARNING: this is an obsolete method, which behaviour has changed. Most of the time you need numpy.asarray(volume), or more simply: volume.np, which actually provides an array with the same indices ordering. Here it is a transposed one.
Given the internal ordering of Aims Volumes, the resulting numpy array is indexed as [t][z][y][x]. This order corresponds to the numpy “fortran” order:
order='F'
If you need the inverse, more natural, [x][y][z][t] ordering, use the following:>>> volarray = volume.np
or:
>>> volarray = numpy.array(volume, copy=False)
or:
>>> volarray = numpy.asarray(volume)
Using arraydata(), as the indices are reversed, if you do something like:
vol2 = aims.Volume(vol.arraydata())
You will build a transposed volume.
- astype(dtype, copy=False)¶
Easy conversion method for volumes. Works in a similar was as numpy arrays astype() methods, except that the “copy” parameter defaults to False.
- Parameters:
dtype (string or type object) – may be a volume or voxel type, specified either as a type oject (int, aims.Volume_S32, numpy.int16), or as a string (“S16”…).
copy (bool) – if False, a ShallowConverter will be used: if dtype matches the current volume type, a shared reference to self will be returned. Otherwise a new copy will be returned.
- Return type:
A volume of the converted type
- at(posx, posy=0, posz=0, post=0)¶
Returns the volume value for the selected voxel.
at(posx1, posx2, posx3, posx4, posx5, posx6=0, posx7=0, posx8=0)
Returns the volume value for the selected voxel.
at(vector_int)
Returns the volume value for the selected voxel.
- checkResize()¶
- copyHeaderFrom()¶
- fill(value)¶
Fill Volume_FLOAT using the given value.
- fillBorder(value)¶
Fill the surrounding of the volume view in the reference volume (if any) using the given value.
- fromObject()¶
- getBorders()¶
- getSize()¶
Number of voxels in each dimension (list of 4 ints)
- getSizeT()¶
- getSizeX()¶
- getSizeY()¶
- getSizeZ()¶
- getStrides()¶
- getVoxelSize()¶
Voxel sizes in mm (list of 4 floats)
- header()¶
The header contains all meta-data.
- max()¶
- min()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- posInRefVolume()¶
If the volume is a view into another (larger) one, this returns the position in “parent” one.
- refVolume()¶
If the volume is a view into another (larger) one, this returns the “parent” one.
- setPosInRefVolume()¶
Set position in parent volume
- setValue(value, x, y=0, z=0, t=0)¶
Set the voxel value at the given position.
setValue(value, [x1, x2, x3, x4, x5, x6…])
Set the voxel value at the given position.
- setVoxelSize(vs_list)¶
- setVoxelSize(vx, vy=1., vz=1., vt=1.) None
Set voxel sizes in mm (list of at least 4 floats)
- property shape¶
- class soma.aims.Volume_HSV(*args)¶
Bases:
RCObject
Generalities
The various Volume_<type> classes are bindings to the C++ template classes carto::Volume. It represents a 4D volume (1D to 4D, actually) storing a specific type of data: for instance S16 is signed 16 bit short ints, FLOAT is 32 bit floats, etc.
Volumes are read and written using the
Reader
andWriter
classes, which are in turn used by the simpleread()
andwrite()
functions.A volume of a given type can be built either using its specialized class constructor, or the general
Volume()
function which can take a voxel type in its arguments: the following are equivalent:>>> v = aims.Volume_S16(100, 100, 10) >>> v = aims.Volume('S16', 100, 100, 10) >>> v = aims.Volume(100, 100, 10, dtype='S16') >>> v = aims.Volume([100, 100, 10], dtype='S16') >>> import numpy >>> v = aims.Volume(numpy.int16, 100, 100, 10)
Numpy arrays and volumes
A volume is an array of voxels, which can be accessed via the
at()
method. For standard numeric types, it is also possible to get the voxels array as a numpy array, using the__array__()
method, or more conveniently,numpy.asarray(volume)
ornumpy.array(volume, copy=False)
. In aims >= 5.0.2, a more concise shortcut is also available:volume.np
(this is available on all types providing numpy bindings actually).The array returned is a reference to the actual data block, so any modification to its contents also affects the Volume contents, so it is generally an easy way of manipulating volume voxels because all the power of the numpy module can be used on Volumes. The obsoloete
arraydata()
method used to return a numpy array just like it is in memory, that is a 4D (or more) array generally indexed by[t][z][y][x]
(but it depands how it has been built), which is generally not what you like and is not consistent with AIMS indexing. Contrarily, usingvolume.np
sets strides in the returned numpy array, so that indexing is in the “normal” order[x][y][z][t]
, while still sharing the same memory block. The Volume object now also wraps the numpy accessors to the volume object itself, so thatvolume[x, y, z, t]
is the same asnupmy.asarray(volume)[x, y, z, t]
.new in PyAims 4.7
Since PyAims 4.7 the numpy arrays bindings have notably improved, and are now able to bind arrays to voxels types which are not scalar numeric types. Volumes of RGB, RGBA, HSV, or Point3df now have numpy bindings. The bound object have generally a “numpy struct” binding, that is not the usual C++/python object binding, but instead a structure managed by numpy which also supports indexing. For most objects we are using, they also have an array stucture (a RGB is an array with 3 int8 items), and are bound under a sturcture with a unique field, named “v” (for “vector”):
>>> v = aims.Volume('RGB', 100, 100, 10) >>> v[0, 0, 0, 0] ([0, 0, 0],)
Such an array may be indexed by the field name, which returns another array with scalar values and additional dimensions:
>>> v['v'].dtype dtype('uint8') >>> v['v'].shape (100, 100, 10, 1, 3)
Both arrays share their memory with the aims volume.
Header
Volumes also store a header which can contain various information (including sizes and voxel sizes). The header is a dictionary-like generic object (
Object
) which can be accessed by theheader()
method. This header object also has a read-write access with some restrictions inherent to theObject
mechanism. It will be saved with the volume contents when the volume is saved on disk.Volumes support a number of arithmetic operators like +, - etc. when the operands types and sizes match: for instance:
>>> # V1 and V2 are two volumes >>> V3 = V1 + V2 # adds two volumes >>> V2 -= V1 >>> V3 = V1 + 3 # adds 3 to aceh voxel >>> V3 = V1 * V2 # itemwise multiplication
Some type conversions can be performed on volumes, for istance to convert a Volume_S16 to a Volume_FLOAT. The simplest, to convert to another data type, is to use the
astype()
method.To convert a volume into diffent structure types, such as
Buckets
, use the converter classesConverter_<type1>_<type2>
andShallowConverter_<type1>_<type2>
with <type1> and <type2> being volume or other object types: for instanceConverter_Volume_S16_Volume_FLOAT
. The converter can also be called using type arguments:>>> vol1 = aims.AimsData('S16', 100, 100, 10) >>> c = aims.Converter(intype=vol1, outtype='BucketMap_VOID') >>> vol2 = c(vol1)
Volume from a numpy array
It is also possible to build a Volume from a numpy array:
>>> v = aims.Volume(numpy.zeros((100, 100, 10)))
Note that passing a 1D numpy array of ints will build a volume mapping the array contents, whereas passing a python list or tuple of ints will interpret the list as a shape for the volume:
>>> v = aims.Volume(numpy.array([100, 100, 10]).astype('int32')) >>> print(v.getSize()) [ 3, 1, 1, 1 ] >>> print(v.np) [100 100 10] >>> v = aims.Volume([100, 100, 10]) >>> print(v.getSize()) [ 100, 100, 10, 1 ]
Array ordering:
In pyaims <= 5.0.x the Volume classes were only working with the X axis (the first) being contiguous, and, for numpy, should be interpreted as “Fortran-contiguous”. So to convert a numpy array into a Volume and keep the same axes ordering, you had to convert it to Fortran order first:
>>> v = aims.Volume(numpy.zeros((2, 3, 4, dtype='int32'))) # v.getSize() used to return [4, 3, 2, 1] >>> v = aims.Volume(np.asfortranarray(numpy.zeros((2, 3, 4), dtype='int32'))) >>> print(v.getSize()) [2, 3, 4, 1]
In pyaims 5.1 this limitation is gone, you can omit the fortran order conversion. Strides are taken into account in the C++ volume. But you have to be careful with such volumes as many C++ programs assume internally that the X axis is contiguous in memory, which is not true in this situation. These programs and functions may not work, crash, or produce incorrect results when used with non-contiguous X axis volumes.
- class Position4Di¶
Bases:
wrapper
4 ints for position or size, used for Volume views.
- all()¶
- allocatorContext()¶
- any()¶
- arraydata()¶
Note
arraydata() returns a numpy array to the internal memory block, with “inverted” shape and strides.
WARNING: this is an obsolete method, which behaviour has changed. Most of the time you need numpy.asarray(volume), or more simply: volume.np, which actually provides an array with the same indices ordering. Here it is a transposed one.
Given the internal ordering of Aims Volumes, the resulting numpy array is indexed as [t][z][y][x]. This order corresponds to the numpy “fortran” order:
order='F'
If you need the inverse, more natural, [x][y][z][t] ordering, use the following:>>> volarray = volume.np
or:
>>> volarray = numpy.array(volume, copy=False)
or:
>>> volarray = numpy.asarray(volume)
Using arraydata(), as the indices are reversed, if you do something like:
vol2 = aims.Volume(vol.arraydata())
You will build a transposed volume.
- astype(dtype, copy=False)¶
Easy conversion method for volumes. Works in a similar was as numpy arrays astype() methods, except that the “copy” parameter defaults to False.
- Parameters:
dtype (string or type object) – may be a volume or voxel type, specified either as a type oject (int, aims.Volume_S32, numpy.int16), or as a string (“S16”…).
copy (bool) – if False, a ShallowConverter will be used: if dtype matches the current volume type, a shared reference to self will be returned. Otherwise a new copy will be returned.
- Return type:
A volume of the converted type
- at(posx, posy=0, posz=0, post=0)¶
Returns the volume value for the selected voxel.
at(posx1, posx2, posx3, posx4, posx5, posx6=0, posx7=0, posx8=0)
Returns the volume value for the selected voxel.
at(vector_int)
Returns the volume value for the selected voxel.
- checkResize()¶
- copyHeaderFrom()¶
- fill(value)¶
Fill Volume_HSV using the given value.
- fillBorder(value)¶
Fill the surrounding of the volume view in the reference volume (if any) using the given value.
- fromObject()¶
- getBorders()¶
- getSize()¶
Number of voxels in each dimension (list of 4 ints)
- getSizeT()¶
- getSizeX()¶
- getSizeY()¶
- getSizeZ()¶
- getStrides()¶
- getVoxelSize()¶
Voxel sizes in mm (list of 4 floats)
- header()¶
The header contains all meta-data.
- max()¶
- min()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- posInRefVolume()¶
If the volume is a view into another (larger) one, this returns the position in “parent” one.
- refVolume()¶
If the volume is a view into another (larger) one, this returns the “parent” one.
- setPosInRefVolume()¶
Set position in parent volume
- setValue(value, x, y=0, z=0, t=0)¶
Set the voxel value at the given position.
setValue(value, [x1, x2, x3, x4, x5, x6…])
Set the voxel value at the given position.
- setVoxelSize(vs_list)¶
- setVoxelSize(vx, vy=1., vz=1., vt=1.) None
Set voxel sizes in mm (list of at least 4 floats)
- property shape¶
- class soma.aims.Volume_POINT3DF(*args)¶
Bases:
RCObject
Generalities
The various Volume_<type> classes are bindings to the C++ template classes carto::Volume. It represents a 4D volume (1D to 4D, actually) storing a specific type of data: for instance S16 is signed 16 bit short ints, FLOAT is 32 bit floats, etc.
Volumes are read and written using the
Reader
andWriter
classes, which are in turn used by the simpleread()
andwrite()
functions.A volume of a given type can be built either using its specialized class constructor, or the general
Volume()
function which can take a voxel type in its arguments: the following are equivalent:>>> v = aims.Volume_S16(100, 100, 10) >>> v = aims.Volume('S16', 100, 100, 10) >>> v = aims.Volume(100, 100, 10, dtype='S16') >>> v = aims.Volume([100, 100, 10], dtype='S16') >>> import numpy >>> v = aims.Volume(numpy.int16, 100, 100, 10)
Numpy arrays and volumes
A volume is an array of voxels, which can be accessed via the
at()
method. For standard numeric types, it is also possible to get the voxels array as a numpy array, using the__array__()
method, or more conveniently,numpy.asarray(volume)
ornumpy.array(volume, copy=False)
. In aims >= 5.0.2, a more concise shortcut is also available:volume.np
(this is available on all types providing numpy bindings actually).The array returned is a reference to the actual data block, so any modification to its contents also affects the Volume contents, so it is generally an easy way of manipulating volume voxels because all the power of the numpy module can be used on Volumes. The obsoloete
arraydata()
method used to return a numpy array just like it is in memory, that is a 4D (or more) array generally indexed by[t][z][y][x]
(but it depands how it has been built), which is generally not what you like and is not consistent with AIMS indexing. Contrarily, usingvolume.np
sets strides in the returned numpy array, so that indexing is in the “normal” order[x][y][z][t]
, while still sharing the same memory block. The Volume object now also wraps the numpy accessors to the volume object itself, so thatvolume[x, y, z, t]
is the same asnupmy.asarray(volume)[x, y, z, t]
.new in PyAims 4.7
Since PyAims 4.7 the numpy arrays bindings have notably improved, and are now able to bind arrays to voxels types which are not scalar numeric types. Volumes of RGB, RGBA, HSV, or Point3df now have numpy bindings. The bound object have generally a “numpy struct” binding, that is not the usual C++/python object binding, but instead a structure managed by numpy which also supports indexing. For most objects we are using, they also have an array stucture (a RGB is an array with 3 int8 items), and are bound under a sturcture with a unique field, named “v” (for “vector”):
>>> v = aims.Volume('RGB', 100, 100, 10) >>> v[0, 0, 0, 0] ([0, 0, 0],)
Such an array may be indexed by the field name, which returns another array with scalar values and additional dimensions:
>>> v['v'].dtype dtype('uint8') >>> v['v'].shape (100, 100, 10, 1, 3)
Both arrays share their memory with the aims volume.
Header
Volumes also store a header which can contain various information (including sizes and voxel sizes). The header is a dictionary-like generic object (
Object
) which can be accessed by theheader()
method. This header object also has a read-write access with some restrictions inherent to theObject
mechanism. It will be saved with the volume contents when the volume is saved on disk.Volumes support a number of arithmetic operators like +, - etc. when the operands types and sizes match: for instance:
>>> # V1 and V2 are two volumes >>> V3 = V1 + V2 # adds two volumes >>> V2 -= V1 >>> V3 = V1 + 3 # adds 3 to aceh voxel >>> V3 = V1 * V2 # itemwise multiplication
Some type conversions can be performed on volumes, for istance to convert a Volume_S16 to a Volume_FLOAT. The simplest, to convert to another data type, is to use the
astype()
method.To convert a volume into diffent structure types, such as
Buckets
, use the converter classesConverter_<type1>_<type2>
andShallowConverter_<type1>_<type2>
with <type1> and <type2> being volume or other object types: for instanceConverter_Volume_S16_Volume_FLOAT
. The converter can also be called using type arguments:>>> vol1 = aims.AimsData('S16', 100, 100, 10) >>> c = aims.Converter(intype=vol1, outtype='BucketMap_VOID') >>> vol2 = c(vol1)
Volume from a numpy array
It is also possible to build a Volume from a numpy array:
>>> v = aims.Volume(numpy.zeros((100, 100, 10)))
Note that passing a 1D numpy array of ints will build a volume mapping the array contents, whereas passing a python list or tuple of ints will interpret the list as a shape for the volume:
>>> v = aims.Volume(numpy.array([100, 100, 10]).astype('int32')) >>> print(v.getSize()) [ 3, 1, 1, 1 ] >>> print(v.np) [100 100 10] >>> v = aims.Volume([100, 100, 10]) >>> print(v.getSize()) [ 100, 100, 10, 1 ]
Array ordering:
In pyaims <= 5.0.x the Volume classes were only working with the X axis (the first) being contiguous, and, for numpy, should be interpreted as “Fortran-contiguous”. So to convert a numpy array into a Volume and keep the same axes ordering, you had to convert it to Fortran order first:
>>> v = aims.Volume(numpy.zeros((2, 3, 4, dtype='int32'))) # v.getSize() used to return [4, 3, 2, 1] >>> v = aims.Volume(np.asfortranarray(numpy.zeros((2, 3, 4), dtype='int32'))) >>> print(v.getSize()) [2, 3, 4, 1]
In pyaims 5.1 this limitation is gone, you can omit the fortran order conversion. Strides are taken into account in the C++ volume. But you have to be careful with such volumes as many C++ programs assume internally that the X axis is contiguous in memory, which is not true in this situation. These programs and functions may not work, crash, or produce incorrect results when used with non-contiguous X axis volumes.
- class Position4Di¶
Bases:
wrapper
4 ints for position or size, used for Volume views.
- all()¶
- allocatorContext()¶
- any()¶
- arraydata()¶
Note
arraydata() returns a numpy array to the internal memory block, with “inverted” shape and strides.
WARNING: this is an obsolete method, which behaviour has changed. Most of the time you need numpy.asarray(volume), or more simply: volume.np, which actually provides an array with the same indices ordering. Here it is a transposed one.
Given the internal ordering of Aims Volumes, the resulting numpy array is indexed as [t][z][y][x]. This order corresponds to the numpy “fortran” order:
order='F'
If you need the inverse, more natural, [x][y][z][t] ordering, use the following:>>> volarray = volume.np
or:
>>> volarray = numpy.array(volume, copy=False)
or:
>>> volarray = numpy.asarray(volume)
Using arraydata(), as the indices are reversed, if you do something like:
vol2 = aims.Volume(vol.arraydata())
You will build a transposed volume.
- astype(dtype, copy=False)¶
Easy conversion method for volumes. Works in a similar was as numpy arrays astype() methods, except that the “copy” parameter defaults to False.
- Parameters:
dtype (string or type object) – may be a volume or voxel type, specified either as a type oject (int, aims.Volume_S32, numpy.int16), or as a string (“S16”…).
copy (bool) – if False, a ShallowConverter will be used: if dtype matches the current volume type, a shared reference to self will be returned. Otherwise a new copy will be returned.
- Return type:
A volume of the converted type
- at(posx, posy=0, posz=0, post=0)¶
Returns the volume value for the selected voxel.
at(posx1, posx2, posx3, posx4, posx5, posx6=0, posx7=0, posx8=0)
Returns the volume value for the selected voxel.
at(vector_int)
Returns the volume value for the selected voxel.
- checkResize()¶
- copyHeaderFrom()¶
- fill(value)¶
Fill Volume_POINT3DF using the given value.
- fillBorder(value)¶
Fill the surrounding of the volume view in the reference volume (if any) using the given value.
- fromObject()¶
- getBorders()¶
- getSize()¶
Number of voxels in each dimension (list of 4 ints)
- getSizeT()¶
- getSizeX()¶
- getSizeY()¶
- getSizeZ()¶
- getStrides()¶
- getVoxelSize()¶
Voxel sizes in mm (list of 4 floats)
- header()¶
The header contains all meta-data.
- max()¶
- min()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- posInRefVolume()¶
If the volume is a view into another (larger) one, this returns the position in “parent” one.
- refVolume()¶
If the volume is a view into another (larger) one, this returns the “parent” one.
- setPosInRefVolume()¶
Set position in parent volume
- setValue(value, x, y=0, z=0, t=0)¶
Set the voxel value at the given position.
setValue(value, [x1, x2, x3, x4, x5, x6…])
Set the voxel value at the given position.
- setVoxelSize(vs_list)¶
- setVoxelSize(vx, vy=1., vz=1., vt=1.) None
Set voxel sizes in mm (list of at least 4 floats)
- property shape¶
- class soma.aims.Volume_RGB(*args)¶
Bases:
RCObject
Generalities
The various Volume_<type> classes are bindings to the C++ template classes carto::Volume. It represents a 4D volume (1D to 4D, actually) storing a specific type of data: for instance S16 is signed 16 bit short ints, FLOAT is 32 bit floats, etc.
Volumes are read and written using the
Reader
andWriter
classes, which are in turn used by the simpleread()
andwrite()
functions.A volume of a given type can be built either using its specialized class constructor, or the general
Volume()
function which can take a voxel type in its arguments: the following are equivalent:>>> v = aims.Volume_S16(100, 100, 10) >>> v = aims.Volume('S16', 100, 100, 10) >>> v = aims.Volume(100, 100, 10, dtype='S16') >>> v = aims.Volume([100, 100, 10], dtype='S16') >>> import numpy >>> v = aims.Volume(numpy.int16, 100, 100, 10)
Numpy arrays and volumes
A volume is an array of voxels, which can be accessed via the
at()
method. For standard numeric types, it is also possible to get the voxels array as a numpy array, using the__array__()
method, or more conveniently,numpy.asarray(volume)
ornumpy.array(volume, copy=False)
. In aims >= 5.0.2, a more concise shortcut is also available:volume.np
(this is available on all types providing numpy bindings actually).The array returned is a reference to the actual data block, so any modification to its contents also affects the Volume contents, so it is generally an easy way of manipulating volume voxels because all the power of the numpy module can be used on Volumes. The obsoloete
arraydata()
method used to return a numpy array just like it is in memory, that is a 4D (or more) array generally indexed by[t][z][y][x]
(but it depands how it has been built), which is generally not what you like and is not consistent with AIMS indexing. Contrarily, usingvolume.np
sets strides in the returned numpy array, so that indexing is in the “normal” order[x][y][z][t]
, while still sharing the same memory block. The Volume object now also wraps the numpy accessors to the volume object itself, so thatvolume[x, y, z, t]
is the same asnupmy.asarray(volume)[x, y, z, t]
.new in PyAims 4.7
Since PyAims 4.7 the numpy arrays bindings have notably improved, and are now able to bind arrays to voxels types which are not scalar numeric types. Volumes of RGB, RGBA, HSV, or Point3df now have numpy bindings. The bound object have generally a “numpy struct” binding, that is not the usual C++/python object binding, but instead a structure managed by numpy which also supports indexing. For most objects we are using, they also have an array stucture (a RGB is an array with 3 int8 items), and are bound under a sturcture with a unique field, named “v” (for “vector”):
>>> v = aims.Volume('RGB', 100, 100, 10) >>> v[0, 0, 0, 0] ([0, 0, 0],)
Such an array may be indexed by the field name, which returns another array with scalar values and additional dimensions:
>>> v['v'].dtype dtype('uint8') >>> v['v'].shape (100, 100, 10, 1, 3)
Both arrays share their memory with the aims volume.
Header
Volumes also store a header which can contain various information (including sizes and voxel sizes). The header is a dictionary-like generic object (
Object
) which can be accessed by theheader()
method. This header object also has a read-write access with some restrictions inherent to theObject
mechanism. It will be saved with the volume contents when the volume is saved on disk.Volumes support a number of arithmetic operators like +, - etc. when the operands types and sizes match: for instance:
>>> # V1 and V2 are two volumes >>> V3 = V1 + V2 # adds two volumes >>> V2 -= V1 >>> V3 = V1 + 3 # adds 3 to aceh voxel >>> V3 = V1 * V2 # itemwise multiplication
Some type conversions can be performed on volumes, for istance to convert a Volume_S16 to a Volume_FLOAT. The simplest, to convert to another data type, is to use the
astype()
method.To convert a volume into diffent structure types, such as
Buckets
, use the converter classesConverter_<type1>_<type2>
andShallowConverter_<type1>_<type2>
with <type1> and <type2> being volume or other object types: for instanceConverter_Volume_S16_Volume_FLOAT
. The converter can also be called using type arguments:>>> vol1 = aims.AimsData('S16', 100, 100, 10) >>> c = aims.Converter(intype=vol1, outtype='BucketMap_VOID') >>> vol2 = c(vol1)
Volume from a numpy array
It is also possible to build a Volume from a numpy array:
>>> v = aims.Volume(numpy.zeros((100, 100, 10)))
Note that passing a 1D numpy array of ints will build a volume mapping the array contents, whereas passing a python list or tuple of ints will interpret the list as a shape for the volume:
>>> v = aims.Volume(numpy.array([100, 100, 10]).astype('int32')) >>> print(v.getSize()) [ 3, 1, 1, 1 ] >>> print(v.np) [100 100 10] >>> v = aims.Volume([100, 100, 10]) >>> print(v.getSize()) [ 100, 100, 10, 1 ]
Array ordering:
In pyaims <= 5.0.x the Volume classes were only working with the X axis (the first) being contiguous, and, for numpy, should be interpreted as “Fortran-contiguous”. So to convert a numpy array into a Volume and keep the same axes ordering, you had to convert it to Fortran order first:
>>> v = aims.Volume(numpy.zeros((2, 3, 4, dtype='int32'))) # v.getSize() used to return [4, 3, 2, 1] >>> v = aims.Volume(np.asfortranarray(numpy.zeros((2, 3, 4), dtype='int32'))) >>> print(v.getSize()) [2, 3, 4, 1]
In pyaims 5.1 this limitation is gone, you can omit the fortran order conversion. Strides are taken into account in the C++ volume. But you have to be careful with such volumes as many C++ programs assume internally that the X axis is contiguous in memory, which is not true in this situation. These programs and functions may not work, crash, or produce incorrect results when used with non-contiguous X axis volumes.
- class Position4Di¶
Bases:
wrapper
4 ints for position or size, used for Volume views.
- all()¶
- allocatorContext()¶
- any()¶
- arraydata()¶
Note
arraydata() returns a numpy array to the internal memory block, with “inverted” shape and strides.
WARNING: this is an obsolete method, which behaviour has changed. Most of the time you need numpy.asarray(volume), or more simply: volume.np, which actually provides an array with the same indices ordering. Here it is a transposed one.
Given the internal ordering of Aims Volumes, the resulting numpy array is indexed as [t][z][y][x]. This order corresponds to the numpy “fortran” order:
order='F'
If you need the inverse, more natural, [x][y][z][t] ordering, use the following:>>> volarray = volume.np
or:
>>> volarray = numpy.array(volume, copy=False)
or:
>>> volarray = numpy.asarray(volume)
Using arraydata(), as the indices are reversed, if you do something like:
vol2 = aims.Volume(vol.arraydata())
You will build a transposed volume.
- astype(dtype, copy=False)¶
Easy conversion method for volumes. Works in a similar was as numpy arrays astype() methods, except that the “copy” parameter defaults to False.
- Parameters:
dtype (string or type object) – may be a volume or voxel type, specified either as a type oject (int, aims.Volume_S32, numpy.int16), or as a string (“S16”…).
copy (bool) – if False, a ShallowConverter will be used: if dtype matches the current volume type, a shared reference to self will be returned. Otherwise a new copy will be returned.
- Return type:
A volume of the converted type
- at(posx, posy=0, posz=0, post=0)¶
Returns the volume value for the selected voxel.
at(posx1, posx2, posx3, posx4, posx5, posx6=0, posx7=0, posx8=0)
Returns the volume value for the selected voxel.
at(vector_int)
Returns the volume value for the selected voxel.
- checkResize()¶
- copyHeaderFrom()¶
- fill(value)¶
Fill Volume_RGB using the given value.
- fillBorder(value)¶
Fill the surrounding of the volume view in the reference volume (if any) using the given value.
- fromObject()¶
- getBorders()¶
- getSize()¶
Number of voxels in each dimension (list of 4 ints)
- getSizeT()¶
- getSizeX()¶
- getSizeY()¶
- getSizeZ()¶
- getStrides()¶
- getVoxelSize()¶
Voxel sizes in mm (list of 4 floats)
- header()¶
The header contains all meta-data.
- max()¶
- min()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- posInRefVolume()¶
If the volume is a view into another (larger) one, this returns the position in “parent” one.
- refVolume()¶
If the volume is a view into another (larger) one, this returns the “parent” one.
- setPosInRefVolume()¶
Set position in parent volume
- setValue(value, x, y=0, z=0, t=0)¶
Set the voxel value at the given position.
setValue(value, [x1, x2, x3, x4, x5, x6…])
Set the voxel value at the given position.
- setVoxelSize(vs_list)¶
- setVoxelSize(vx, vy=1., vz=1., vt=1.) None
Set voxel sizes in mm (list of at least 4 floats)
- property shape¶
- class soma.aims.Volume_RGBA(*args)¶
Bases:
RCObject
Generalities
The various Volume_<type> classes are bindings to the C++ template classes carto::Volume. It represents a 4D volume (1D to 4D, actually) storing a specific type of data: for instance S16 is signed 16 bit short ints, FLOAT is 32 bit floats, etc.
Volumes are read and written using the
Reader
andWriter
classes, which are in turn used by the simpleread()
andwrite()
functions.A volume of a given type can be built either using its specialized class constructor, or the general
Volume()
function which can take a voxel type in its arguments: the following are equivalent:>>> v = aims.Volume_S16(100, 100, 10) >>> v = aims.Volume('S16', 100, 100, 10) >>> v = aims.Volume(100, 100, 10, dtype='S16') >>> v = aims.Volume([100, 100, 10], dtype='S16') >>> import numpy >>> v = aims.Volume(numpy.int16, 100, 100, 10)
Numpy arrays and volumes
A volume is an array of voxels, which can be accessed via the
at()
method. For standard numeric types, it is also possible to get the voxels array as a numpy array, using the__array__()
method, or more conveniently,numpy.asarray(volume)
ornumpy.array(volume, copy=False)
. In aims >= 5.0.2, a more concise shortcut is also available:volume.np
(this is available on all types providing numpy bindings actually).The array returned is a reference to the actual data block, so any modification to its contents also affects the Volume contents, so it is generally an easy way of manipulating volume voxels because all the power of the numpy module can be used on Volumes. The obsoloete
arraydata()
method used to return a numpy array just like it is in memory, that is a 4D (or more) array generally indexed by[t][z][y][x]
(but it depands how it has been built), which is generally not what you like and is not consistent with AIMS indexing. Contrarily, usingvolume.np
sets strides in the returned numpy array, so that indexing is in the “normal” order[x][y][z][t]
, while still sharing the same memory block. The Volume object now also wraps the numpy accessors to the volume object itself, so thatvolume[x, y, z, t]
is the same asnupmy.asarray(volume)[x, y, z, t]
.new in PyAims 4.7
Since PyAims 4.7 the numpy arrays bindings have notably improved, and are now able to bind arrays to voxels types which are not scalar numeric types. Volumes of RGB, RGBA, HSV, or Point3df now have numpy bindings. The bound object have generally a “numpy struct” binding, that is not the usual C++/python object binding, but instead a structure managed by numpy which also supports indexing. For most objects we are using, they also have an array stucture (a RGB is an array with 3 int8 items), and are bound under a sturcture with a unique field, named “v” (for “vector”):
>>> v = aims.Volume('RGB', 100, 100, 10) >>> v[0, 0, 0, 0] ([0, 0, 0],)
Such an array may be indexed by the field name, which returns another array with scalar values and additional dimensions:
>>> v['v'].dtype dtype('uint8') >>> v['v'].shape (100, 100, 10, 1, 3)
Both arrays share their memory with the aims volume.
Header
Volumes also store a header which can contain various information (including sizes and voxel sizes). The header is a dictionary-like generic object (
Object
) which can be accessed by theheader()
method. This header object also has a read-write access with some restrictions inherent to theObject
mechanism. It will be saved with the volume contents when the volume is saved on disk.Volumes support a number of arithmetic operators like +, - etc. when the operands types and sizes match: for instance:
>>> # V1 and V2 are two volumes >>> V3 = V1 + V2 # adds two volumes >>> V2 -= V1 >>> V3 = V1 + 3 # adds 3 to aceh voxel >>> V3 = V1 * V2 # itemwise multiplication
Some type conversions can be performed on volumes, for istance to convert a Volume_S16 to a Volume_FLOAT. The simplest, to convert to another data type, is to use the
astype()
method.To convert a volume into diffent structure types, such as
Buckets
, use the converter classesConverter_<type1>_<type2>
andShallowConverter_<type1>_<type2>
with <type1> and <type2> being volume or other object types: for instanceConverter_Volume_S16_Volume_FLOAT
. The converter can also be called using type arguments:>>> vol1 = aims.AimsData('S16', 100, 100, 10) >>> c = aims.Converter(intype=vol1, outtype='BucketMap_VOID') >>> vol2 = c(vol1)
Volume from a numpy array
It is also possible to build a Volume from a numpy array:
>>> v = aims.Volume(numpy.zeros((100, 100, 10)))
Note that passing a 1D numpy array of ints will build a volume mapping the array contents, whereas passing a python list or tuple of ints will interpret the list as a shape for the volume:
>>> v = aims.Volume(numpy.array([100, 100, 10]).astype('int32')) >>> print(v.getSize()) [ 3, 1, 1, 1 ] >>> print(v.np) [100 100 10] >>> v = aims.Volume([100, 100, 10]) >>> print(v.getSize()) [ 100, 100, 10, 1 ]
Array ordering:
In pyaims <= 5.0.x the Volume classes were only working with the X axis (the first) being contiguous, and, for numpy, should be interpreted as “Fortran-contiguous”. So to convert a numpy array into a Volume and keep the same axes ordering, you had to convert it to Fortran order first:
>>> v = aims.Volume(numpy.zeros((2, 3, 4, dtype='int32'))) # v.getSize() used to return [4, 3, 2, 1] >>> v = aims.Volume(np.asfortranarray(numpy.zeros((2, 3, 4), dtype='int32'))) >>> print(v.getSize()) [2, 3, 4, 1]
In pyaims 5.1 this limitation is gone, you can omit the fortran order conversion. Strides are taken into account in the C++ volume. But you have to be careful with such volumes as many C++ programs assume internally that the X axis is contiguous in memory, which is not true in this situation. These programs and functions may not work, crash, or produce incorrect results when used with non-contiguous X axis volumes.
- class Position4Di¶
Bases:
wrapper
4 ints for position or size, used for Volume views.
- all()¶
- allocatorContext()¶
- any()¶
- arraydata()¶
Note
arraydata() returns a numpy array to the internal memory block, with “inverted” shape and strides.
WARNING: this is an obsolete method, which behaviour has changed. Most of the time you need numpy.asarray(volume), or more simply: volume.np, which actually provides an array with the same indices ordering. Here it is a transposed one.
Given the internal ordering of Aims Volumes, the resulting numpy array is indexed as [t][z][y][x]. This order corresponds to the numpy “fortran” order:
order='F'
If you need the inverse, more natural, [x][y][z][t] ordering, use the following:>>> volarray = volume.np
or:
>>> volarray = numpy.array(volume, copy=False)
or:
>>> volarray = numpy.asarray(volume)
Using arraydata(), as the indices are reversed, if you do something like:
vol2 = aims.Volume(vol.arraydata())
You will build a transposed volume.
- astype(dtype, copy=False)¶
Easy conversion method for volumes. Works in a similar was as numpy arrays astype() methods, except that the “copy” parameter defaults to False.
- Parameters:
dtype (string or type object) – may be a volume or voxel type, specified either as a type oject (int, aims.Volume_S32, numpy.int16), or as a string (“S16”…).
copy (bool) – if False, a ShallowConverter will be used: if dtype matches the current volume type, a shared reference to self will be returned. Otherwise a new copy will be returned.
- Return type:
A volume of the converted type
- at(posx, posy=0, posz=0, post=0)¶
Returns the volume value for the selected voxel.
at(posx1, posx2, posx3, posx4, posx5, posx6=0, posx7=0, posx8=0)
Returns the volume value for the selected voxel.
at(vector_int)
Returns the volume value for the selected voxel.
- checkResize()¶
- copyHeaderFrom()¶
- fill(value)¶
Fill Volume_RGBA using the given value.
- fillBorder(value)¶
Fill the surrounding of the volume view in the reference volume (if any) using the given value.
- fromObject()¶
- getBorders()¶
- getSize()¶
Number of voxels in each dimension (list of 4 ints)
- getSizeT()¶
- getSizeX()¶
- getSizeY()¶
- getSizeZ()¶
- getStrides()¶
- getVoxelSize()¶
Voxel sizes in mm (list of 4 floats)
- header()¶
The header contains all meta-data.
- max()¶
- min()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- posInRefVolume()¶
If the volume is a view into another (larger) one, this returns the position in “parent” one.
- refVolume()¶
If the volume is a view into another (larger) one, this returns the “parent” one.
- setPosInRefVolume()¶
Set position in parent volume
- setValue(value, x, y=0, z=0, t=0)¶
Set the voxel value at the given position.
setValue(value, [x1, x2, x3, x4, x5, x6…])
Set the voxel value at the given position.
- setVoxelSize(vs_list)¶
- setVoxelSize(vx, vy=1., vz=1., vt=1.) None
Set voxel sizes in mm (list of at least 4 floats)
- property shape¶
- class soma.aims.Volume_S16(*args)¶
Bases:
RCObject
Generalities
The various Volume_<type> classes are bindings to the C++ template classes carto::Volume. It represents a 4D volume (1D to 4D, actually) storing a specific type of data: for instance S16 is signed 16 bit short ints, FLOAT is 32 bit floats, etc.
Volumes are read and written using the
Reader
andWriter
classes, which are in turn used by the simpleread()
andwrite()
functions.A volume of a given type can be built either using its specialized class constructor, or the general
Volume()
function which can take a voxel type in its arguments: the following are equivalent:>>> v = aims.Volume_S16(100, 100, 10) >>> v = aims.Volume('S16', 100, 100, 10) >>> v = aims.Volume(100, 100, 10, dtype='S16') >>> v = aims.Volume([100, 100, 10], dtype='S16') >>> import numpy >>> v = aims.Volume(numpy.int16, 100, 100, 10)
Numpy arrays and volumes
A volume is an array of voxels, which can be accessed via the
at()
method. For standard numeric types, it is also possible to get the voxels array as a numpy array, using the__array__()
method, or more conveniently,numpy.asarray(volume)
ornumpy.array(volume, copy=False)
. In aims >= 5.0.2, a more concise shortcut is also available:volume.np
(this is available on all types providing numpy bindings actually).The array returned is a reference to the actual data block, so any modification to its contents also affects the Volume contents, so it is generally an easy way of manipulating volume voxels because all the power of the numpy module can be used on Volumes. The obsoloete
arraydata()
method used to return a numpy array just like it is in memory, that is a 4D (or more) array generally indexed by[t][z][y][x]
(but it depands how it has been built), which is generally not what you like and is not consistent with AIMS indexing. Contrarily, usingvolume.np
sets strides in the returned numpy array, so that indexing is in the “normal” order[x][y][z][t]
, while still sharing the same memory block. The Volume object now also wraps the numpy accessors to the volume object itself, so thatvolume[x, y, z, t]
is the same asnupmy.asarray(volume)[x, y, z, t]
.new in PyAims 4.7
Since PyAims 4.7 the numpy arrays bindings have notably improved, and are now able to bind arrays to voxels types which are not scalar numeric types. Volumes of RGB, RGBA, HSV, or Point3df now have numpy bindings. The bound object have generally a “numpy struct” binding, that is not the usual C++/python object binding, but instead a structure managed by numpy which also supports indexing. For most objects we are using, they also have an array stucture (a RGB is an array with 3 int8 items), and are bound under a sturcture with a unique field, named “v” (for “vector”):
>>> v = aims.Volume('RGB', 100, 100, 10) >>> v[0, 0, 0, 0] ([0, 0, 0],)
Such an array may be indexed by the field name, which returns another array with scalar values and additional dimensions:
>>> v['v'].dtype dtype('uint8') >>> v['v'].shape (100, 100, 10, 1, 3)
Both arrays share their memory with the aims volume.
Header
Volumes also store a header which can contain various information (including sizes and voxel sizes). The header is a dictionary-like generic object (
Object
) which can be accessed by theheader()
method. This header object also has a read-write access with some restrictions inherent to theObject
mechanism. It will be saved with the volume contents when the volume is saved on disk.Volumes support a number of arithmetic operators like +, - etc. when the operands types and sizes match: for instance:
>>> # V1 and V2 are two volumes >>> V3 = V1 + V2 # adds two volumes >>> V2 -= V1 >>> V3 = V1 + 3 # adds 3 to aceh voxel >>> V3 = V1 * V2 # itemwise multiplication
Some type conversions can be performed on volumes, for istance to convert a Volume_S16 to a Volume_FLOAT. The simplest, to convert to another data type, is to use the
astype()
method.To convert a volume into diffent structure types, such as
Buckets
, use the converter classesConverter_<type1>_<type2>
andShallowConverter_<type1>_<type2>
with <type1> and <type2> being volume or other object types: for instanceConverter_Volume_S16_Volume_FLOAT
. The converter can also be called using type arguments:>>> vol1 = aims.AimsData('S16', 100, 100, 10) >>> c = aims.Converter(intype=vol1, outtype='BucketMap_VOID') >>> vol2 = c(vol1)
Volume from a numpy array
It is also possible to build a Volume from a numpy array:
>>> v = aims.Volume(numpy.zeros((100, 100, 10)))
Note that passing a 1D numpy array of ints will build a volume mapping the array contents, whereas passing a python list or tuple of ints will interpret the list as a shape for the volume:
>>> v = aims.Volume(numpy.array([100, 100, 10]).astype('int32')) >>> print(v.getSize()) [ 3, 1, 1, 1 ] >>> print(v.np) [100 100 10] >>> v = aims.Volume([100, 100, 10]) >>> print(v.getSize()) [ 100, 100, 10, 1 ]
Array ordering:
In pyaims <= 5.0.x the Volume classes were only working with the X axis (the first) being contiguous, and, for numpy, should be interpreted as “Fortran-contiguous”. So to convert a numpy array into a Volume and keep the same axes ordering, you had to convert it to Fortran order first:
>>> v = aims.Volume(numpy.zeros((2, 3, 4, dtype='int32'))) # v.getSize() used to return [4, 3, 2, 1] >>> v = aims.Volume(np.asfortranarray(numpy.zeros((2, 3, 4), dtype='int32'))) >>> print(v.getSize()) [2, 3, 4, 1]
In pyaims 5.1 this limitation is gone, you can omit the fortran order conversion. Strides are taken into account in the C++ volume. But you have to be careful with such volumes as many C++ programs assume internally that the X axis is contiguous in memory, which is not true in this situation. These programs and functions may not work, crash, or produce incorrect results when used with non-contiguous X axis volumes.
- class Position4Di¶
Bases:
wrapper
4 ints for position or size, used for Volume views.
- all()¶
- allocatorContext()¶
- any()¶
- arraydata()¶
Note
arraydata() returns a numpy array to the internal memory block, with “inverted” shape and strides.
WARNING: this is an obsolete method, which behaviour has changed. Most of the time you need numpy.asarray(volume), or more simply: volume.np, which actually provides an array with the same indices ordering. Here it is a transposed one.
Given the internal ordering of Aims Volumes, the resulting numpy array is indexed as [t][z][y][x]. This order corresponds to the numpy “fortran” order:
order='F'
If you need the inverse, more natural, [x][y][z][t] ordering, use the following:>>> volarray = volume.np
or:
>>> volarray = numpy.array(volume, copy=False)
or:
>>> volarray = numpy.asarray(volume)
Using arraydata(), as the indices are reversed, if you do something like:
vol2 = aims.Volume(vol.arraydata())
You will build a transposed volume.
- astype(dtype, copy=False)¶
Easy conversion method for volumes. Works in a similar was as numpy arrays astype() methods, except that the “copy” parameter defaults to False.
- Parameters:
dtype (string or type object) – may be a volume or voxel type, specified either as a type oject (int, aims.Volume_S32, numpy.int16), or as a string (“S16”…).
copy (bool) – if False, a ShallowConverter will be used: if dtype matches the current volume type, a shared reference to self will be returned. Otherwise a new copy will be returned.
- Return type:
A volume of the converted type
- at(posx, posy=0, posz=0, post=0)¶
Returns the volume value for the selected voxel.
at(posx1, posx2, posx3, posx4, posx5, posx6=0, posx7=0, posx8=0)
Returns the volume value for the selected voxel.
at(vector_int)
Returns the volume value for the selected voxel.
- checkResize()¶
- copyHeaderFrom()¶
- fill(value)¶
Fill Volume_S16 using the given value.
- fillBorder(value)¶
Fill the surrounding of the volume view in the reference volume (if any) using the given value.
- fromObject()¶
- getBorders()¶
- getSize()¶
Number of voxels in each dimension (list of 4 ints)
- getSizeT()¶
- getSizeX()¶
- getSizeY()¶
- getSizeZ()¶
- getStrides()¶
- getVoxelSize()¶
Voxel sizes in mm (list of 4 floats)
- header()¶
The header contains all meta-data.
- max()¶
- min()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- posInRefVolume()¶
If the volume is a view into another (larger) one, this returns the position in “parent” one.
- refVolume()¶
If the volume is a view into another (larger) one, this returns the “parent” one.
- setPosInRefVolume()¶
Set position in parent volume
- setValue(value, x, y=0, z=0, t=0)¶
Set the voxel value at the given position.
setValue(value, [x1, x2, x3, x4, x5, x6…])
Set the voxel value at the given position.
- setVoxelSize(vs_list)¶
- setVoxelSize(vx, vy=1., vz=1., vt=1.) None
Set voxel sizes in mm (list of at least 4 floats)
- property shape¶
- class soma.aims.Volume_S32(*args)¶
Bases:
RCObject
Generalities
The various Volume_<type> classes are bindings to the C++ template classes carto::Volume. It represents a 4D volume (1D to 4D, actually) storing a specific type of data: for instance S16 is signed 16 bit short ints, FLOAT is 32 bit floats, etc.
Volumes are read and written using the
Reader
andWriter
classes, which are in turn used by the simpleread()
andwrite()
functions.A volume of a given type can be built either using its specialized class constructor, or the general
Volume()
function which can take a voxel type in its arguments: the following are equivalent:>>> v = aims.Volume_S16(100, 100, 10) >>> v = aims.Volume('S16', 100, 100, 10) >>> v = aims.Volume(100, 100, 10, dtype='S16') >>> v = aims.Volume([100, 100, 10], dtype='S16') >>> import numpy >>> v = aims.Volume(numpy.int16, 100, 100, 10)
Numpy arrays and volumes
A volume is an array of voxels, which can be accessed via the
at()
method. For standard numeric types, it is also possible to get the voxels array as a numpy array, using the__array__()
method, or more conveniently,numpy.asarray(volume)
ornumpy.array(volume, copy=False)
. In aims >= 5.0.2, a more concise shortcut is also available:volume.np
(this is available on all types providing numpy bindings actually).The array returned is a reference to the actual data block, so any modification to its contents also affects the Volume contents, so it is generally an easy way of manipulating volume voxels because all the power of the numpy module can be used on Volumes. The obsoloete
arraydata()
method used to return a numpy array just like it is in memory, that is a 4D (or more) array generally indexed by[t][z][y][x]
(but it depands how it has been built), which is generally not what you like and is not consistent with AIMS indexing. Contrarily, usingvolume.np
sets strides in the returned numpy array, so that indexing is in the “normal” order[x][y][z][t]
, while still sharing the same memory block. The Volume object now also wraps the numpy accessors to the volume object itself, so thatvolume[x, y, z, t]
is the same asnupmy.asarray(volume)[x, y, z, t]
.new in PyAims 4.7
Since PyAims 4.7 the numpy arrays bindings have notably improved, and are now able to bind arrays to voxels types which are not scalar numeric types. Volumes of RGB, RGBA, HSV, or Point3df now have numpy bindings. The bound object have generally a “numpy struct” binding, that is not the usual C++/python object binding, but instead a structure managed by numpy which also supports indexing. For most objects we are using, they also have an array stucture (a RGB is an array with 3 int8 items), and are bound under a sturcture with a unique field, named “v” (for “vector”):
>>> v = aims.Volume('RGB', 100, 100, 10) >>> v[0, 0, 0, 0] ([0, 0, 0],)
Such an array may be indexed by the field name, which returns another array with scalar values and additional dimensions:
>>> v['v'].dtype dtype('uint8') >>> v['v'].shape (100, 100, 10, 1, 3)
Both arrays share their memory with the aims volume.
Header
Volumes also store a header which can contain various information (including sizes and voxel sizes). The header is a dictionary-like generic object (
Object
) which can be accessed by theheader()
method. This header object also has a read-write access with some restrictions inherent to theObject
mechanism. It will be saved with the volume contents when the volume is saved on disk.Volumes support a number of arithmetic operators like +, - etc. when the operands types and sizes match: for instance:
>>> # V1 and V2 are two volumes >>> V3 = V1 + V2 # adds two volumes >>> V2 -= V1 >>> V3 = V1 + 3 # adds 3 to aceh voxel >>> V3 = V1 * V2 # itemwise multiplication
Some type conversions can be performed on volumes, for istance to convert a Volume_S16 to a Volume_FLOAT. The simplest, to convert to another data type, is to use the
astype()
method.To convert a volume into diffent structure types, such as
Buckets
, use the converter classesConverter_<type1>_<type2>
andShallowConverter_<type1>_<type2>
with <type1> and <type2> being volume or other object types: for instanceConverter_Volume_S16_Volume_FLOAT
. The converter can also be called using type arguments:>>> vol1 = aims.AimsData('S16', 100, 100, 10) >>> c = aims.Converter(intype=vol1, outtype='BucketMap_VOID') >>> vol2 = c(vol1)
Volume from a numpy array
It is also possible to build a Volume from a numpy array:
>>> v = aims.Volume(numpy.zeros((100, 100, 10)))
Note that passing a 1D numpy array of ints will build a volume mapping the array contents, whereas passing a python list or tuple of ints will interpret the list as a shape for the volume:
>>> v = aims.Volume(numpy.array([100, 100, 10]).astype('int32')) >>> print(v.getSize()) [ 3, 1, 1, 1 ] >>> print(v.np) [100 100 10] >>> v = aims.Volume([100, 100, 10]) >>> print(v.getSize()) [ 100, 100, 10, 1 ]
Array ordering:
In pyaims <= 5.0.x the Volume classes were only working with the X axis (the first) being contiguous, and, for numpy, should be interpreted as “Fortran-contiguous”. So to convert a numpy array into a Volume and keep the same axes ordering, you had to convert it to Fortran order first:
>>> v = aims.Volume(numpy.zeros((2, 3, 4, dtype='int32'))) # v.getSize() used to return [4, 3, 2, 1] >>> v = aims.Volume(np.asfortranarray(numpy.zeros((2, 3, 4), dtype='int32'))) >>> print(v.getSize()) [2, 3, 4, 1]
In pyaims 5.1 this limitation is gone, you can omit the fortran order conversion. Strides are taken into account in the C++ volume. But you have to be careful with such volumes as many C++ programs assume internally that the X axis is contiguous in memory, which is not true in this situation. These programs and functions may not work, crash, or produce incorrect results when used with non-contiguous X axis volumes.
- class Position4Di¶
Bases:
wrapper
4 ints for position or size, used for Volume views.
- all()¶
- allocatorContext()¶
- any()¶
- arraydata()¶
Note
arraydata() returns a numpy array to the internal memory block, with “inverted” shape and strides.
WARNING: this is an obsolete method, which behaviour has changed. Most of the time you need numpy.asarray(volume), or more simply: volume.np, which actually provides an array with the same indices ordering. Here it is a transposed one.
Given the internal ordering of Aims Volumes, the resulting numpy array is indexed as [t][z][y][x]. This order corresponds to the numpy “fortran” order:
order='F'
If you need the inverse, more natural, [x][y][z][t] ordering, use the following:>>> volarray = volume.np
or:
>>> volarray = numpy.array(volume, copy=False)
or:
>>> volarray = numpy.asarray(volume)
Using arraydata(), as the indices are reversed, if you do something like:
vol2 = aims.Volume(vol.arraydata())
You will build a transposed volume.
- astype(dtype, copy=False)¶
Easy conversion method for volumes. Works in a similar was as numpy arrays astype() methods, except that the “copy” parameter defaults to False.
- Parameters:
dtype (string or type object) – may be a volume or voxel type, specified either as a type oject (int, aims.Volume_S32, numpy.int16), or as a string (“S16”…).
copy (bool) – if False, a ShallowConverter will be used: if dtype matches the current volume type, a shared reference to self will be returned. Otherwise a new copy will be returned.
- Return type:
A volume of the converted type
- at(posx, posy=0, posz=0, post=0)¶
Returns the volume value for the selected voxel.
at(posx1, posx2, posx3, posx4, posx5, posx6=0, posx7=0, posx8=0)
Returns the volume value for the selected voxel.
at(vector_int)
Returns the volume value for the selected voxel.
- checkResize()¶
- copyHeaderFrom()¶
- fill(value)¶
Fill Volume_S32 using the given value.
- fillBorder(value)¶
Fill the surrounding of the volume view in the reference volume (if any) using the given value.
- fromObject()¶
- getBorders()¶
- getSize()¶
Number of voxels in each dimension (list of 4 ints)
- getSizeT()¶
- getSizeX()¶
- getSizeY()¶
- getSizeZ()¶
- getStrides()¶
- getVoxelSize()¶
Voxel sizes in mm (list of 4 floats)
- header()¶
The header contains all meta-data.
- max()¶
- min()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- posInRefVolume()¶
If the volume is a view into another (larger) one, this returns the position in “parent” one.
- refVolume()¶
If the volume is a view into another (larger) one, this returns the “parent” one.
- setPosInRefVolume()¶
Set position in parent volume
- setValue(value, x, y=0, z=0, t=0)¶
Set the voxel value at the given position.
setValue(value, [x1, x2, x3, x4, x5, x6…])
Set the voxel value at the given position.
- setVoxelSize(vs_list)¶
- setVoxelSize(vx, vy=1., vz=1., vt=1.) None
Set voxel sizes in mm (list of at least 4 floats)
- property shape¶
- class soma.aims.Volume_U16(*args)¶
Bases:
RCObject
Generalities
The various Volume_<type> classes are bindings to the C++ template classes carto::Volume. It represents a 4D volume (1D to 4D, actually) storing a specific type of data: for instance S16 is signed 16 bit short ints, FLOAT is 32 bit floats, etc.
Volumes are read and written using the
Reader
andWriter
classes, which are in turn used by the simpleread()
andwrite()
functions.A volume of a given type can be built either using its specialized class constructor, or the general
Volume()
function which can take a voxel type in its arguments: the following are equivalent:>>> v = aims.Volume_S16(100, 100, 10) >>> v = aims.Volume('S16', 100, 100, 10) >>> v = aims.Volume(100, 100, 10, dtype='S16') >>> v = aims.Volume([100, 100, 10], dtype='S16') >>> import numpy >>> v = aims.Volume(numpy.int16, 100, 100, 10)
Numpy arrays and volumes
A volume is an array of voxels, which can be accessed via the
at()
method. For standard numeric types, it is also possible to get the voxels array as a numpy array, using the__array__()
method, or more conveniently,numpy.asarray(volume)
ornumpy.array(volume, copy=False)
. In aims >= 5.0.2, a more concise shortcut is also available:volume.np
(this is available on all types providing numpy bindings actually).The array returned is a reference to the actual data block, so any modification to its contents also affects the Volume contents, so it is generally an easy way of manipulating volume voxels because all the power of the numpy module can be used on Volumes. The obsoloete
arraydata()
method used to return a numpy array just like it is in memory, that is a 4D (or more) array generally indexed by[t][z][y][x]
(but it depands how it has been built), which is generally not what you like and is not consistent with AIMS indexing. Contrarily, usingvolume.np
sets strides in the returned numpy array, so that indexing is in the “normal” order[x][y][z][t]
, while still sharing the same memory block. The Volume object now also wraps the numpy accessors to the volume object itself, so thatvolume[x, y, z, t]
is the same asnupmy.asarray(volume)[x, y, z, t]
.new in PyAims 4.7
Since PyAims 4.7 the numpy arrays bindings have notably improved, and are now able to bind arrays to voxels types which are not scalar numeric types. Volumes of RGB, RGBA, HSV, or Point3df now have numpy bindings. The bound object have generally a “numpy struct” binding, that is not the usual C++/python object binding, but instead a structure managed by numpy which also supports indexing. For most objects we are using, they also have an array stucture (a RGB is an array with 3 int8 items), and are bound under a sturcture with a unique field, named “v” (for “vector”):
>>> v = aims.Volume('RGB', 100, 100, 10) >>> v[0, 0, 0, 0] ([0, 0, 0],)
Such an array may be indexed by the field name, which returns another array with scalar values and additional dimensions:
>>> v['v'].dtype dtype('uint8') >>> v['v'].shape (100, 100, 10, 1, 3)
Both arrays share their memory with the aims volume.
Header
Volumes also store a header which can contain various information (including sizes and voxel sizes). The header is a dictionary-like generic object (
Object
) which can be accessed by theheader()
method. This header object also has a read-write access with some restrictions inherent to theObject
mechanism. It will be saved with the volume contents when the volume is saved on disk.Volumes support a number of arithmetic operators like +, - etc. when the operands types and sizes match: for instance:
>>> # V1 and V2 are two volumes >>> V3 = V1 + V2 # adds two volumes >>> V2 -= V1 >>> V3 = V1 + 3 # adds 3 to aceh voxel >>> V3 = V1 * V2 # itemwise multiplication
Some type conversions can be performed on volumes, for istance to convert a Volume_S16 to a Volume_FLOAT. The simplest, to convert to another data type, is to use the
astype()
method.To convert a volume into diffent structure types, such as
Buckets
, use the converter classesConverter_<type1>_<type2>
andShallowConverter_<type1>_<type2>
with <type1> and <type2> being volume or other object types: for instanceConverter_Volume_S16_Volume_FLOAT
. The converter can also be called using type arguments:>>> vol1 = aims.AimsData('S16', 100, 100, 10) >>> c = aims.Converter(intype=vol1, outtype='BucketMap_VOID') >>> vol2 = c(vol1)
Volume from a numpy array
It is also possible to build a Volume from a numpy array:
>>> v = aims.Volume(numpy.zeros((100, 100, 10)))
Note that passing a 1D numpy array of ints will build a volume mapping the array contents, whereas passing a python list or tuple of ints will interpret the list as a shape for the volume:
>>> v = aims.Volume(numpy.array([100, 100, 10]).astype('int32')) >>> print(v.getSize()) [ 3, 1, 1, 1 ] >>> print(v.np) [100 100 10] >>> v = aims.Volume([100, 100, 10]) >>> print(v.getSize()) [ 100, 100, 10, 1 ]
Array ordering:
In pyaims <= 5.0.x the Volume classes were only working with the X axis (the first) being contiguous, and, for numpy, should be interpreted as “Fortran-contiguous”. So to convert a numpy array into a Volume and keep the same axes ordering, you had to convert it to Fortran order first:
>>> v = aims.Volume(numpy.zeros((2, 3, 4, dtype='int32'))) # v.getSize() used to return [4, 3, 2, 1] >>> v = aims.Volume(np.asfortranarray(numpy.zeros((2, 3, 4), dtype='int32'))) >>> print(v.getSize()) [2, 3, 4, 1]
In pyaims 5.1 this limitation is gone, you can omit the fortran order conversion. Strides are taken into account in the C++ volume. But you have to be careful with such volumes as many C++ programs assume internally that the X axis is contiguous in memory, which is not true in this situation. These programs and functions may not work, crash, or produce incorrect results when used with non-contiguous X axis volumes.
- class Position4Di¶
Bases:
wrapper
4 ints for position or size, used for Volume views.
- all()¶
- allocatorContext()¶
- any()¶
- arraydata()¶
Note
arraydata() returns a numpy array to the internal memory block, with “inverted” shape and strides.
WARNING: this is an obsolete method, which behaviour has changed. Most of the time you need numpy.asarray(volume), or more simply: volume.np, which actually provides an array with the same indices ordering. Here it is a transposed one.
Given the internal ordering of Aims Volumes, the resulting numpy array is indexed as [t][z][y][x]. This order corresponds to the numpy “fortran” order:
order='F'
If you need the inverse, more natural, [x][y][z][t] ordering, use the following:>>> volarray = volume.np
or:
>>> volarray = numpy.array(volume, copy=False)
or:
>>> volarray = numpy.asarray(volume)
Using arraydata(), as the indices are reversed, if you do something like:
vol2 = aims.Volume(vol.arraydata())
You will build a transposed volume.
- astype(dtype, copy=False)¶
Easy conversion method for volumes. Works in a similar was as numpy arrays astype() methods, except that the “copy” parameter defaults to False.
- Parameters:
dtype (string or type object) – may be a volume or voxel type, specified either as a type oject (int, aims.Volume_S32, numpy.int16), or as a string (“S16”…).
copy (bool) – if False, a ShallowConverter will be used: if dtype matches the current volume type, a shared reference to self will be returned. Otherwise a new copy will be returned.
- Return type:
A volume of the converted type
- at(posx, posy=0, posz=0, post=0)¶
Returns the volume value for the selected voxel.
at(posx1, posx2, posx3, posx4, posx5, posx6=0, posx7=0, posx8=0)
Returns the volume value for the selected voxel.
at(vector_int)
Returns the volume value for the selected voxel.
- checkResize()¶
- copyHeaderFrom()¶
- fill(value)¶
Fill Volume_U16 using the given value.
- fillBorder(value)¶
Fill the surrounding of the volume view in the reference volume (if any) using the given value.
- fromObject()¶
- getBorders()¶
- getSize()¶
Number of voxels in each dimension (list of 4 ints)
- getSizeT()¶
- getSizeX()¶
- getSizeY()¶
- getSizeZ()¶
- getStrides()¶
- getVoxelSize()¶
Voxel sizes in mm (list of 4 floats)
- header()¶
The header contains all meta-data.
- max()¶
- min()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- posInRefVolume()¶
If the volume is a view into another (larger) one, this returns the position in “parent” one.
- refVolume()¶
If the volume is a view into another (larger) one, this returns the “parent” one.
- setPosInRefVolume()¶
Set position in parent volume
- setValue(value, x, y=0, z=0, t=0)¶
Set the voxel value at the given position.
setValue(value, [x1, x2, x3, x4, x5, x6…])
Set the voxel value at the given position.
- setVoxelSize(vs_list)¶
- setVoxelSize(vx, vy=1., vz=1., vt=1.) None
Set voxel sizes in mm (list of at least 4 floats)
- property shape¶
- class soma.aims.Volume_U32(*args)¶
Bases:
RCObject
Generalities
The various Volume_<type> classes are bindings to the C++ template classes carto::Volume. It represents a 4D volume (1D to 4D, actually) storing a specific type of data: for instance S16 is signed 16 bit short ints, FLOAT is 32 bit floats, etc.
Volumes are read and written using the
Reader
andWriter
classes, which are in turn used by the simpleread()
andwrite()
functions.A volume of a given type can be built either using its specialized class constructor, or the general
Volume()
function which can take a voxel type in its arguments: the following are equivalent:>>> v = aims.Volume_S16(100, 100, 10) >>> v = aims.Volume('S16', 100, 100, 10) >>> v = aims.Volume(100, 100, 10, dtype='S16') >>> v = aims.Volume([100, 100, 10], dtype='S16') >>> import numpy >>> v = aims.Volume(numpy.int16, 100, 100, 10)
Numpy arrays and volumes
A volume is an array of voxels, which can be accessed via the
at()
method. For standard numeric types, it is also possible to get the voxels array as a numpy array, using the__array__()
method, or more conveniently,numpy.asarray(volume)
ornumpy.array(volume, copy=False)
. In aims >= 5.0.2, a more concise shortcut is also available:volume.np
(this is available on all types providing numpy bindings actually).The array returned is a reference to the actual data block, so any modification to its contents also affects the Volume contents, so it is generally an easy way of manipulating volume voxels because all the power of the numpy module can be used on Volumes. The obsoloete
arraydata()
method used to return a numpy array just like it is in memory, that is a 4D (or more) array generally indexed by[t][z][y][x]
(but it depands how it has been built), which is generally not what you like and is not consistent with AIMS indexing. Contrarily, usingvolume.np
sets strides in the returned numpy array, so that indexing is in the “normal” order[x][y][z][t]
, while still sharing the same memory block. The Volume object now also wraps the numpy accessors to the volume object itself, so thatvolume[x, y, z, t]
is the same asnupmy.asarray(volume)[x, y, z, t]
.new in PyAims 4.7
Since PyAims 4.7 the numpy arrays bindings have notably improved, and are now able to bind arrays to voxels types which are not scalar numeric types. Volumes of RGB, RGBA, HSV, or Point3df now have numpy bindings. The bound object have generally a “numpy struct” binding, that is not the usual C++/python object binding, but instead a structure managed by numpy which also supports indexing. For most objects we are using, they also have an array stucture (a RGB is an array with 3 int8 items), and are bound under a sturcture with a unique field, named “v” (for “vector”):
>>> v = aims.Volume('RGB', 100, 100, 10) >>> v[0, 0, 0, 0] ([0, 0, 0],)
Such an array may be indexed by the field name, which returns another array with scalar values and additional dimensions:
>>> v['v'].dtype dtype('uint8') >>> v['v'].shape (100, 100, 10, 1, 3)
Both arrays share their memory with the aims volume.
Header
Volumes also store a header which can contain various information (including sizes and voxel sizes). The header is a dictionary-like generic object (
Object
) which can be accessed by theheader()
method. This header object also has a read-write access with some restrictions inherent to theObject
mechanism. It will be saved with the volume contents when the volume is saved on disk.Volumes support a number of arithmetic operators like +, - etc. when the operands types and sizes match: for instance:
>>> # V1 and V2 are two volumes >>> V3 = V1 + V2 # adds two volumes >>> V2 -= V1 >>> V3 = V1 + 3 # adds 3 to aceh voxel >>> V3 = V1 * V2 # itemwise multiplication
Some type conversions can be performed on volumes, for istance to convert a Volume_S16 to a Volume_FLOAT. The simplest, to convert to another data type, is to use the
astype()
method.To convert a volume into diffent structure types, such as
Buckets
, use the converter classesConverter_<type1>_<type2>
andShallowConverter_<type1>_<type2>
with <type1> and <type2> being volume or other object types: for instanceConverter_Volume_S16_Volume_FLOAT
. The converter can also be called using type arguments:>>> vol1 = aims.AimsData('S16', 100, 100, 10) >>> c = aims.Converter(intype=vol1, outtype='BucketMap_VOID') >>> vol2 = c(vol1)
Volume from a numpy array
It is also possible to build a Volume from a numpy array:
>>> v = aims.Volume(numpy.zeros((100, 100, 10)))
Note that passing a 1D numpy array of ints will build a volume mapping the array contents, whereas passing a python list or tuple of ints will interpret the list as a shape for the volume:
>>> v = aims.Volume(numpy.array([100, 100, 10]).astype('int32')) >>> print(v.getSize()) [ 3, 1, 1, 1 ] >>> print(v.np) [100 100 10] >>> v = aims.Volume([100, 100, 10]) >>> print(v.getSize()) [ 100, 100, 10, 1 ]
Array ordering:
In pyaims <= 5.0.x the Volume classes were only working with the X axis (the first) being contiguous, and, for numpy, should be interpreted as “Fortran-contiguous”. So to convert a numpy array into a Volume and keep the same axes ordering, you had to convert it to Fortran order first:
>>> v = aims.Volume(numpy.zeros((2, 3, 4, dtype='int32'))) # v.getSize() used to return [4, 3, 2, 1] >>> v = aims.Volume(np.asfortranarray(numpy.zeros((2, 3, 4), dtype='int32'))) >>> print(v.getSize()) [2, 3, 4, 1]
In pyaims 5.1 this limitation is gone, you can omit the fortran order conversion. Strides are taken into account in the C++ volume. But you have to be careful with such volumes as many C++ programs assume internally that the X axis is contiguous in memory, which is not true in this situation. These programs and functions may not work, crash, or produce incorrect results when used with non-contiguous X axis volumes.
- class Position4Di¶
Bases:
wrapper
4 ints for position or size, used for Volume views.
- all()¶
- allocatorContext()¶
- any()¶
- arraydata()¶
Note
arraydata() returns a numpy array to the internal memory block, with “inverted” shape and strides.
WARNING: this is an obsolete method, which behaviour has changed. Most of the time you need numpy.asarray(volume), or more simply: volume.np, which actually provides an array with the same indices ordering. Here it is a transposed one.
Given the internal ordering of Aims Volumes, the resulting numpy array is indexed as [t][z][y][x]. This order corresponds to the numpy “fortran” order:
order='F'
If you need the inverse, more natural, [x][y][z][t] ordering, use the following:>>> volarray = volume.np
or:
>>> volarray = numpy.array(volume, copy=False)
or:
>>> volarray = numpy.asarray(volume)
Using arraydata(), as the indices are reversed, if you do something like:
vol2 = aims.Volume(vol.arraydata())
You will build a transposed volume.
- astype(dtype, copy=False)¶
Easy conversion method for volumes. Works in a similar was as numpy arrays astype() methods, except that the “copy” parameter defaults to False.
- Parameters:
dtype (string or type object) – may be a volume or voxel type, specified either as a type oject (int, aims.Volume_S32, numpy.int16), or as a string (“S16”…).
copy (bool) – if False, a ShallowConverter will be used: if dtype matches the current volume type, a shared reference to self will be returned. Otherwise a new copy will be returned.
- Return type:
A volume of the converted type
- at(posx, posy=0, posz=0, post=0)¶
Returns the volume value for the selected voxel.
at(posx1, posx2, posx3, posx4, posx5, posx6=0, posx7=0, posx8=0)
Returns the volume value for the selected voxel.
at(vector_int)
Returns the volume value for the selected voxel.
- checkResize()¶
- copyHeaderFrom()¶
- fill(value)¶
Fill Volume_U32 using the given value.
- fillBorder(value)¶
Fill the surrounding of the volume view in the reference volume (if any) using the given value.
- fromObject()¶
- getBorders()¶
- getSize()¶
Number of voxels in each dimension (list of 4 ints)
- getSizeT()¶
- getSizeX()¶
- getSizeY()¶
- getSizeZ()¶
- getStrides()¶
- getVoxelSize()¶
Voxel sizes in mm (list of 4 floats)
- header()¶
The header contains all meta-data.
- max()¶
- min()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- posInRefVolume()¶
If the volume is a view into another (larger) one, this returns the position in “parent” one.
- refVolume()¶
If the volume is a view into another (larger) one, this returns the “parent” one.
- setPosInRefVolume()¶
Set position in parent volume
- setValue(value, x, y=0, z=0, t=0)¶
Set the voxel value at the given position.
setValue(value, [x1, x2, x3, x4, x5, x6…])
Set the voxel value at the given position.
- setVoxelSize(vs_list)¶
- setVoxelSize(vx, vy=1., vz=1., vt=1.) None
Set voxel sizes in mm (list of at least 4 floats)
- property shape¶
- class soma.aims.Volume_U8(*args)¶
Bases:
RCObject
Generalities
The various Volume_<type> classes are bindings to the C++ template classes carto::Volume. It represents a 4D volume (1D to 4D, actually) storing a specific type of data: for instance S16 is signed 16 bit short ints, FLOAT is 32 bit floats, etc.
Volumes are read and written using the
Reader
andWriter
classes, which are in turn used by the simpleread()
andwrite()
functions.A volume of a given type can be built either using its specialized class constructor, or the general
Volume()
function which can take a voxel type in its arguments: the following are equivalent:>>> v = aims.Volume_S16(100, 100, 10) >>> v = aims.Volume('S16', 100, 100, 10) >>> v = aims.Volume(100, 100, 10, dtype='S16') >>> v = aims.Volume([100, 100, 10], dtype='S16') >>> import numpy >>> v = aims.Volume(numpy.int16, 100, 100, 10)
Numpy arrays and volumes
A volume is an array of voxels, which can be accessed via the
at()
method. For standard numeric types, it is also possible to get the voxels array as a numpy array, using the__array__()
method, or more conveniently,numpy.asarray(volume)
ornumpy.array(volume, copy=False)
. In aims >= 5.0.2, a more concise shortcut is also available:volume.np
(this is available on all types providing numpy bindings actually).The array returned is a reference to the actual data block, so any modification to its contents also affects the Volume contents, so it is generally an easy way of manipulating volume voxels because all the power of the numpy module can be used on Volumes. The obsoloete
arraydata()
method used to return a numpy array just like it is in memory, that is a 4D (or more) array generally indexed by[t][z][y][x]
(but it depands how it has been built), which is generally not what you like and is not consistent with AIMS indexing. Contrarily, usingvolume.np
sets strides in the returned numpy array, so that indexing is in the “normal” order[x][y][z][t]
, while still sharing the same memory block. The Volume object now also wraps the numpy accessors to the volume object itself, so thatvolume[x, y, z, t]
is the same asnupmy.asarray(volume)[x, y, z, t]
.new in PyAims 4.7
Since PyAims 4.7 the numpy arrays bindings have notably improved, and are now able to bind arrays to voxels types which are not scalar numeric types. Volumes of RGB, RGBA, HSV, or Point3df now have numpy bindings. The bound object have generally a “numpy struct” binding, that is not the usual C++/python object binding, but instead a structure managed by numpy which also supports indexing. For most objects we are using, they also have an array stucture (a RGB is an array with 3 int8 items), and are bound under a sturcture with a unique field, named “v” (for “vector”):
>>> v = aims.Volume('RGB', 100, 100, 10) >>> v[0, 0, 0, 0] ([0, 0, 0],)
Such an array may be indexed by the field name, which returns another array with scalar values and additional dimensions:
>>> v['v'].dtype dtype('uint8') >>> v['v'].shape (100, 100, 10, 1, 3)
Both arrays share their memory with the aims volume.
Header
Volumes also store a header which can contain various information (including sizes and voxel sizes). The header is a dictionary-like generic object (
Object
) which can be accessed by theheader()
method. This header object also has a read-write access with some restrictions inherent to theObject
mechanism. It will be saved with the volume contents when the volume is saved on disk.Volumes support a number of arithmetic operators like +, - etc. when the operands types and sizes match: for instance:
>>> # V1 and V2 are two volumes >>> V3 = V1 + V2 # adds two volumes >>> V2 -= V1 >>> V3 = V1 + 3 # adds 3 to aceh voxel >>> V3 = V1 * V2 # itemwise multiplication
Some type conversions can be performed on volumes, for istance to convert a Volume_S16 to a Volume_FLOAT. The simplest, to convert to another data type, is to use the
astype()
method.To convert a volume into diffent structure types, such as
Buckets
, use the converter classesConverter_<type1>_<type2>
andShallowConverter_<type1>_<type2>
with <type1> and <type2> being volume or other object types: for instanceConverter_Volume_S16_Volume_FLOAT
. The converter can also be called using type arguments:>>> vol1 = aims.AimsData('S16', 100, 100, 10) >>> c = aims.Converter(intype=vol1, outtype='BucketMap_VOID') >>> vol2 = c(vol1)
Volume from a numpy array
It is also possible to build a Volume from a numpy array:
>>> v = aims.Volume(numpy.zeros((100, 100, 10)))
Note that passing a 1D numpy array of ints will build a volume mapping the array contents, whereas passing a python list or tuple of ints will interpret the list as a shape for the volume:
>>> v = aims.Volume(numpy.array([100, 100, 10]).astype('int32')) >>> print(v.getSize()) [ 3, 1, 1, 1 ] >>> print(v.np) [100 100 10] >>> v = aims.Volume([100, 100, 10]) >>> print(v.getSize()) [ 100, 100, 10, 1 ]
Array ordering:
In pyaims <= 5.0.x the Volume classes were only working with the X axis (the first) being contiguous, and, for numpy, should be interpreted as “Fortran-contiguous”. So to convert a numpy array into a Volume and keep the same axes ordering, you had to convert it to Fortran order first:
>>> v = aims.Volume(numpy.zeros((2, 3, 4, dtype='int32'))) # v.getSize() used to return [4, 3, 2, 1] >>> v = aims.Volume(np.asfortranarray(numpy.zeros((2, 3, 4), dtype='int32'))) >>> print(v.getSize()) [2, 3, 4, 1]
In pyaims 5.1 this limitation is gone, you can omit the fortran order conversion. Strides are taken into account in the C++ volume. But you have to be careful with such volumes as many C++ programs assume internally that the X axis is contiguous in memory, which is not true in this situation. These programs and functions may not work, crash, or produce incorrect results when used with non-contiguous X axis volumes.
- class Position4Di¶
Bases:
wrapper
4 ints for position or size, used for Volume views.
- all()¶
- allocatorContext()¶
- any()¶
- arraydata()¶
Note
arraydata() returns a numpy array to the internal memory block, with “inverted” shape and strides.
WARNING: this is an obsolete method, which behaviour has changed. Most of the time you need numpy.asarray(volume), or more simply: volume.np, which actually provides an array with the same indices ordering. Here it is a transposed one.
Given the internal ordering of Aims Volumes, the resulting numpy array is indexed as [t][z][y][x]. This order corresponds to the numpy “fortran” order:
order='F'
If you need the inverse, more natural, [x][y][z][t] ordering, use the following:>>> volarray = volume.np
or:
>>> volarray = numpy.array(volume, copy=False)
or:
>>> volarray = numpy.asarray(volume)
Using arraydata(), as the indices are reversed, if you do something like:
vol2 = aims.Volume(vol.arraydata())
You will build a transposed volume.
- astype(dtype, copy=False)¶
Easy conversion method for volumes. Works in a similar was as numpy arrays astype() methods, except that the “copy” parameter defaults to False.
- Parameters:
dtype (string or type object) – may be a volume or voxel type, specified either as a type oject (int, aims.Volume_S32, numpy.int16), or as a string (“S16”…).
copy (bool) – if False, a ShallowConverter will be used: if dtype matches the current volume type, a shared reference to self will be returned. Otherwise a new copy will be returned.
- Return type:
A volume of the converted type
- at(posx, posy=0, posz=0, post=0)¶
Returns the volume value for the selected voxel.
at(posx1, posx2, posx3, posx4, posx5, posx6=0, posx7=0, posx8=0)
Returns the volume value for the selected voxel.
at(vector_int)
Returns the volume value for the selected voxel.
- checkResize()¶
- copyHeaderFrom()¶
- fill(value)¶
Fill Volume_U8 using the given value.
- fillBorder(value)¶
Fill the surrounding of the volume view in the reference volume (if any) using the given value.
- fromObject()¶
- getBorders()¶
- getSize()¶
Number of voxels in each dimension (list of 4 ints)
- getSizeT()¶
- getSizeX()¶
- getSizeY()¶
- getSizeZ()¶
- getStrides()¶
- getVoxelSize()¶
Voxel sizes in mm (list of 4 floats)
- header()¶
The header contains all meta-data.
- max()¶
- min()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- posInRefVolume()¶
If the volume is a view into another (larger) one, this returns the position in “parent” one.
- refVolume()¶
If the volume is a view into another (larger) one, this returns the “parent” one.
- setPosInRefVolume()¶
Set position in parent volume
- setValue(value, x, y=0, z=0, t=0)¶
Set the voxel value at the given position.
setValue(value, [x1, x2, x3, x4, x5, x6…])
Set the voxel value at the given position.
Set a voxel value at given position
Set a voxel value at given position
- setVoxelSize(vs_list)¶
- setVoxelSize(vx, vy=1., vz=1., vt=1.) None
Set voxel sizes in mm (list of at least 4 floats)
- property shape¶
- class soma.aims.Writer[source]¶
Bases:
object
- write(obj, filename, format=None, options={})[source]¶
Writes the object <obj> in a file named <filename>, whatever the type of <obj>, as format <format>. All objects types and formats supported by the Aims IO system can be used. <obj> may be a reference-counter to an object type supported by the IO system. Additional specific options may be passed to the underlying IO system in an optional <options> dictionary.
- class soma.aims.aims¶
Bases:
simplewrapper
- class AffineTransformation3d(*args)¶
Bases:
Transformation3d
- affine()¶
- fromColumnVector()¶
- fromMatrix(value)¶
- header()¶
- inverse()¶
- isDirect()¶
- isIdentity()¶
Test if the transformation can safely be omitted
This method must only return true if the transformation behaves exactly like an identity transformation (notably, the transform methods will always return the input coordinates unchanged).
NOTE: Implementors of derived classes may choose to always return false if a test would be difficult to implement or expensive to run.
- rotation()¶
- rotationaroundx()¶
- rotationaroundy()¶
- rotationaroundz()¶
- scale()¶
- setRotationAffine()¶
- setToIdentity()¶
- setTranslation()¶
- toColumnVector()¶
- toMatrix()¶
This function return a copy of the transformation matrix
- toVector()¶
- transformDouble()¶
- transformFloat()¶
- transformNormal()¶
- transformNormalDouble()¶
- transformNormalFloat()¶
- transformNormalPoint3dd()¶
- transformNormalPoint3df()¶
- transformPoint3d()¶
- transformPoint3dd()¶
- transformPoint3df()¶
- transformUnitNormal()¶
- transformVector()¶
- transformVectorDouble()¶
- transformVectorFloat()¶
- transformVectorPoint3dd()¶
- transformVectorPoint3df()¶
- translation()¶
- AimsConnectedComponent()¶
- void AimsConnectedComponent(data, connectivity, valids, backgrnd=0,
bin=True, minSize=0, numMax=0, verbose=True)
Connected components extraction. The function modifies the input data, and does not return a new one.
- Parameters:
- void AimsConnectedComponent(data, connectivity, backgrnd=0, bin=True,
minSize=0, maxSize=0, numMax=0, verbose=True)
Connected components extraction. The function modifies the input data, and does not return a new one.
- Parameters:
- void AimsConnectedComponent(data, connectivity, backgrnd=0, bin=True,
minSize=0, maxSize=0, numMax=0, verbose=True)
Connected components extraction, Bucket version. The function modifies the input data, and does not return a new one.
- Parameters:
- void AimsConnectedComponent(data, connectivity, valids, backgrnd=0,
bin=True, minSize=0, numMax=0, verbose=True)
Connected components extraction. The function modifies the input data, and does not return a new one.
- Parameters:
- void AimsConnectedComponent(data, connectivity, backgrnd=0, bin=True,
minSize=0, maxSize=0, numMax=0, verbose=True)
Connected components extraction. The function modifies the input data, and does not return a new one.
- Parameters:
- void AimsConnectedComponent(data, connectivity, backgrnd=0, bin=True,
minSize=0, maxSize=0, numMax=0, verbose=True)
Connected components extraction, Bucket version. The function modifies the input data, and does not return a new one.
- Parameters:
- void AimsConnectedComponent(data, connectivity, valids, backgrnd=0,
bin=True, minSize=0, numMax=0, verbose=True)
Connected components extraction. The function modifies the input data, and does not return a new one.
- Parameters:
- void AimsConnectedComponent(data, connectivity, backgrnd=0, bin=True,
minSize=0, maxSize=0, numMax=0, verbose=True)
Connected components extraction. The function modifies the input data, and does not return a new one.
- Parameters:
- void AimsConnectedComponent(data, connectivity, backgrnd=0, bin=True,
minSize=0, maxSize=0, numMax=0, verbose=True)
Connected components extraction, Bucket version. The function modifies the input data, and does not return a new one.
- Parameters:
- void AimsConnectedComponent(data, connectivity, valids, backgrnd=0,
bin=True, minSize=0, numMax=0, verbose=True)
Connected components extraction. The function modifies the input data, and does not return a new one.
- Parameters:
- void AimsConnectedComponent(data, connectivity, backgrnd=0, bin=True,
minSize=0, maxSize=0, numMax=0, verbose=True)
Connected components extraction. The function modifies the input data, and does not return a new one.
- Parameters:
- void AimsConnectedComponent(data, connectivity, backgrnd=0, bin=True,
minSize=0, maxSize=0, numMax=0, verbose=True)
Connected components extraction, Bucket version. The function modifies the input data, and does not return a new one.
- class BucketUtil¶
Bases:
wrapper
Utility class related to buckets
- volumeFromBucket()¶
- volume, offser = BucketUtil.volumeFromBucket(bucket, borderwidth=0,
enable_shift=True)
Bucket to volume conversion. Compared to Converter_BucketMap_Volume, this function has options to handle min bounding box, and allows to have borders.
If enable_shift is False, the volume will start at coordinates (0, 0, 0), without an offset (thus the volume may be much lager than needed, or may not contain the whole bucket if it has negative coordinates). In such case, pos is not used (thus passing 0 is OK).
volume = BucketUtil.volumeFromBucket(bucket, bbmin, bmax, borderwidth=0)
Bucket to volume conversion. Compared to Converter_BucketMap_Volume, this function has options to handle bounding box, and allows to have borders.
- class BundleListener¶
Bases:
wrapper
Serial processing of bundles.
BundleListener listens events from a
BundleProducer
object, typically emitted when a new bundle starts or ends, a fiber starts or ends etc.To use it, BundleListener has to be subclassed and some of the following methods overloaded: * bundleStarted * bundleTerminated * fiberStarted * fiberTerminated * newFiberPoint * noMoreBundle
To connect the listener to a producer, use
BundleProducer::addBundleListener()
.Inherited classes may inherit both BundleListener and BundleProducer, if they are part of a processing chain.
- bundleStarted(producer, bundle_info)¶
- bundleTerminated(producer, bundle_info)¶
- fiberStarted(producer, bundle_info, fiber_info)¶
- fiberTerminated(producer, bundle_info, fiber_info)¶
- newFiberPoint(producer, bundle_info, fiber_info, point)¶
- noMoreBundle(producer)¶
- class BundleMotion¶
Bases:
BundleProducer
,BundleListener
- addFiberPoint()¶
- bundleStarted(producer, bundle_info)¶
- bundleTerminated(producer, bundle_info)¶
- fiberStarted(producer, bundle_info, fiber_info)¶
- fiberTerminated(producer, bundle_info, fiber_info)¶
- newFiberPoint(producer, bundle_info, fiber_info, point)¶
- noMoreBundle(producer)¶
- startBundle()¶
- startFiber()¶
- terminateBundle()¶
- terminateFiber()¶
- class BundleProducer¶
Bases:
wrapper
Serial processing of bundles.
BundleProducer emits events to a
BundleListener
object while walking through a bundles set structure (or a bundles file), typically when a new bundle starts or ends, a fiber starts or ends etc.To connect the listener to a producer, use
BundleProducer::addBundleListener()
.Inherited classes may inherit both BundleListener and BundleProducer, if they are part of a processing chain.
- addBundleListener(listener)¶
Connects a
BundleProducer
to aBunsdleListener
.
- addFiberPoint()¶
- noMoreBundle()¶
- startBundle()¶
- startFiber()¶
- terminateBundle()¶
- terminateFiber()¶
- class BundleROISelect¶
Bases:
BundleProducer
,BundleListener
- addFiberPoint()¶
- bundleStarted(producer, bundle_info)¶
- bundleTerminated(producer, bundle_info)¶
- fiberStarted(producer, bundle_info, fiber_info)¶
- fiberTerminated(producer, bundle_info, fiber_info)¶
- newFiberPoint(producer, bundle_info, fiber_info, point)¶
- noMoreBundle(producer)¶
- startBundle()¶
- startFiber()¶
- terminateBundle()¶
- terminateFiber()¶
- class BundleROISplit¶
Bases:
BundleProducer
,BundleListener
- addFiberPoint()¶
- bundleStarted(producer, bundle_info)¶
- bundleTerminated(producer, bundle_info)¶
- fiberStarted(producer, bundle_info, fiber_info)¶
- fiberTerminated(producer, bundle_info, fiber_info)¶
- newFiberPoint(producer, bundle_info, fiber_info, point)¶
- noMoreBundle(producer)¶
- startBundle()¶
- startFiber()¶
- terminateBundle()¶
- terminateFiber()¶
- class BundleReader¶
Bases:
BundleProducer
Reads a bundles file, and emits events while walking through its data.
BundleReader is a
BundleProducer
, so can be listened by anyBundleListener
. It may read several bundles/fibers formats, using a lower-levelBundleProducer
dedicated to a specific format.Currently
.bundles
(AIMS/Connectomist) and.trk
(Trackvis) formats are supported.- addFiberPoint()¶
- formatExtensions(format='ALL')¶
return a set of file extensions associated with the given format. If the format is “ALL” (default) then all extensions of all supported formats are returned. If the format does not exist, an empty set is returned, and no error is issued.
- noMoreBundle()¶
- read()¶
read() is the entry point to fibers processing, and triggers the producer machinery.
- startBundle()¶
- startFiber()¶
- supportedFormats()¶
return a set of fiber tracts formats names supported by the BundlesReader.
- terminateBundle()¶
- terminateFiber()¶
- class BundleSampler¶
Bases:
BundleProducer
,BundleListener
- addFiberPoint()¶
- bundleStarted(producer, bundle_info)¶
- bundleTerminated(producer, bundle_info)¶
- fiberStarted(producer, bundle_info, fiber_info)¶
- fiberTerminated(producer, bundle_info, fiber_info)¶
- newFiberPoint(producer, bundle_info, fiber_info, point)¶
- noMoreBundle(producer)¶
- startBundle()¶
- startFiber()¶
- terminateBundle()¶
- terminateFiber()¶
- class BundleToGraph¶
Bases:
BundleListener
,PropertySet
Bundles structure building as a Graph
The
Graph
structure is used to represent bundles and fibers when we need to keep their complete structure in memory. This structure is especially used for 3D rendering in Anatomist.BundleToGraph is a
BundleListener
, thus has to be connected to aBundleProducer
to work (typically, aBundleReader
).Note that the BundleProducer / BundleListener system work as processing chains, and allows to keep only a small set of data in memory at one time. The Graph structure, on the contrary, keeps all information in memory, so may need a large amount of memory.
- bundleStarted(producer, bundle_info)¶
- bundleTerminated(producer, bundle_info)¶
- fiberStarted(producer, bundle_info, fiber_info)¶
- fiberTerminated(producer, bundle_info, fiber_info)¶
- newFiberPoint(producer, bundle_info, fiber_info, point)¶
- noMoreBundle(producer)¶
- class BundleToGraphWriter¶
Bases:
BundleToGraph
- bundleStarted(producer, bundle_info)¶
- bundleTerminated(producer, bundle_info)¶
- fiberStarted(producer, bundle_info, fiber_info)¶
- fiberTerminated(producer, bundle_info, fiber_info)¶
- newFiberPoint(producer, bundle_info, fiber_info, point)¶
- noMoreBundle(producer)¶
- setFileString()¶
- class BundleTransformer(direct_transformation)¶
Bases:
BundleListener
,BundleProducer
Apply a spatial transformation to fiber bundles.
Each point along the bundles is transformed according to the supplied transformation.
This is a BundleListener / BundleProducer stream processing class which applies vector field deformation to bundle data. It can be typically connected to a BundleReader and a BundleWriter.
- addFiberPoint()¶
- bundleStarted(producer, bundle_info)¶
- bundleTerminated(producer, bundle_info)¶
- fiberStarted(producer, bundle_info, fiber_info)¶
- fiberTerminated(producer, bundle_info, fiber_info)¶
- newFiberPoint(producer, bundle_info, fiber_info, point)¶
- noMoreBundle(producer)¶
- startBundle()¶
- startFiber()¶
- terminateBundle()¶
- terminateFiber()¶
- class BundleWriter¶
Bases:
BundleListener
,PropertySet
Writes bundles information to a bundles file.
BundleWriter is a
BundleListener
, thus must be connected to aBundleProducer
, and is fed by it.It will write the
.bundles
format.- bundleStarted(producer, bundle_info)¶
- bundleTerminated(producer, bundle_info)¶
- fiberStarted(producer, bundle_info, fiber_info)¶
- fiberTerminated(producer, bundle_info, fiber_info)¶
- newFiberPoint(producer, bundle_info, fiber_info, point)¶
- noMoreBundle(producer)¶
- setFileString(filename)¶
Set the output file name.
- class BundlesSlicer¶
Bases:
BundleListener
- addBundlesSlicerListener()¶
- bundleStarted(producer, bundle_info)¶
- bundleTerminated(producer, bundle_info)¶
- fiberStarted(producer, bundle_info, fiber_info)¶
- fiberTerminated(producer, bundle_info, fiber_info)¶
- newFiberPoint(producer, bundle_info, fiber_info, point)¶
- noMoreBundle(producer)¶
- class BundlesSlicerListener¶
Bases:
wrapper
- newBundleSlice()¶
- noMoreBundleSlice()¶
- startBundleSlicing()¶
- terminateBundleSlicing()¶
- class CiftiTools(matrix, smap={})¶
Bases:
wrapper
- Parameters:
mat (rc_ptr_SparseOrDenseMatrix) – matrix with CIFTI header (typically, read from CIFTI format via aims.read())
smap (map_STRING_S32) – brain structure name to mesh number map: defaults to the result of defaultBrainStructureToMeshMap()
CIFTI-2 shaped matrices manipulation tools.
This class eases manipulation of matrices (SparseOrDenseMatrix) with CIFTI information in their header. CIFTI information specify the nature of data contained in the matrix, and can bring ROIs or parcellations information.
Mainly one can obtain textures to map matrix information onto meshes. Textures may be ROI information (label textures, TimeTexture_S32), or matrix values textures, possibly expanded onto brain regions (TimeTexture_FLOAT in this case).
- brainStructureMap()¶
- buildDimensionObjectFromLabelsTexture()¶
- defaultBrainStructureToMeshMap()¶
Define the brain structure to mesh mapping: several meshes may be involved in CIFTI data mapping (typically a left hemisphere mesh and a right
- Returns:
mesh_map – mesh identifier to index mapping
- Return type:
map_STRING_S32
- dimensionType()¶
- expandedValueTextureFromDimension(dim, other_dim_index_pos)¶
Get matrix data in textures, possibly expanded to regions if needed.
Parcels data will be expanded to all vertices of each parcel, etc. The resulting textures can be mapped on appropriate brain meshes.
- Parameters:
dim (int) – dimension in the matrix to get info for
other_dim_index_pos (vector_S32) – position in fixed dimensions. Actually all dimensions must be specified (the size of this list must match the number of dimensions) but the specified dimension position will not be used (since all values will be extracted in textures), and possibly another one (scalars, series, labels dimension will be extracted in time steps or several textures).
- Returns:
textures – Scalar or time series data will be stored in texture timepoints. Labels data will be stored in separate textures because they provide possibly different colormaps. In this case the returned list will have the size meshes_number * labels_number, and will be stored in this order: [mesh0_label0, mesh1_label0, .. meshN_label0, mesh0_label1, ..
meshN_label1, .. mesh0_label0, .. meshN_labelM]
- Return type:
- getBrainStructureMeshNumberOfNodes()¶
- getBrainStructures(dim, keepSurfaces=True, keepVoxels=True)¶
Retreive brain structures list in a brain models dimension
- getDimensionObject()¶
- getIndicesForBrainStructure(dim, struct_name)¶
Get the list of indices corresponding to a given brain structure in the matrix, on a given dimension.
- getIndicesForSurfaceIndices(dim, surface_num, roi_indices)¶
Get the list of matrix indices corresponding to a given region on a mesh, for a given dimension.
- Parameters:
- Returns:
indices – list of indices in the matrix
- Return type:
- isMatchingSurface()¶
- isMatchingSurfaceOrTexture()¶
- isMatchingTexture()¶
- matrix()¶
- roiTextureFromDimension(dim)¶
Get ROI information for a given matrix dimension.
If the matrix dimension defines ROIs (parcels, brain regions), textures defining these regions are built.
If the matrix dimension defines labels, an empty texture will be created, with appropriate colormap information
If the matrix dimensions defines scalars or series, this function will probably not be useful.
- Parameters:
dim (int) – dimension in the matrix to get info for
- Returns:
textures – textures of regions, possibly with colormaps in headers, for regions, parcels etc. One texture per mesh. For scalars or series, the list will be empty since no particular ROI description is contained in the header for this dimension.
- Return type:
- setBrainStructureMap()¶
- setMatrix()¶
- valuesDimNum()¶
- valuesDimSize()¶
- class ConeSamplable¶
Bases:
Samplable_FLOAT_3
- contains()¶
- class Connectivity¶
Bases:
wrapper
- CONNECTIVITY_18_XYZ = 7¶
- CONNECTIVITY_26_XYZ = 8¶
- CONNECTIVITY_4_XY = 0¶
- CONNECTIVITY_4_XYdiag = 28¶
- CONNECTIVITY_4_XZ = 1¶
- CONNECTIVITY_4_XZdiag = 29¶
- CONNECTIVITY_4_YZ = 2¶
- CONNECTIVITY_4_YZdiag = 30¶
- CONNECTIVITY_5_XYminus = 17¶
- CONNECTIVITY_5_XYplus = 18¶
- CONNECTIVITY_5_XZminus = 21¶
- CONNECTIVITY_5_XZplus = 22¶
- CONNECTIVITY_5_XminusY = 15¶
- CONNECTIVITY_5_XminusZ = 19¶
- CONNECTIVITY_5_XplusY = 16¶
- CONNECTIVITY_5_XplusZ = 20¶
- CONNECTIVITY_5_YZminus = 25¶
- CONNECTIVITY_5_YZplus = 26¶
- CONNECTIVITY_5_YminusZ = 23¶
- CONNECTIVITY_5_YplusZ = 24¶
- CONNECTIVITY_6_XYZ = 3¶
- CONNECTIVITY_8_XY = 4¶
- CONNECTIVITY_8_XYZ = 27¶
- CONNECTIVITY_8_XZ = 5¶
- CONNECTIVITY_8_YZ = 6¶
- CONNECTIVITY_9_XY_Zminus = 9¶
- CONNECTIVITY_9_XY_Zplus = 10¶
- CONNECTIVITY_9_XZ_Yminus = 11¶
- CONNECTIVITY_9_XZ_Yplus = 12¶
- CONNECTIVITY_9_YZ_Xminus = 13¶
- CONNECTIVITY_9_YZ_Xplus = 14¶
- dir()¶
- nbNeighbors()¶
- offset()¶
- type()¶
- type_from_string()¶
- type_string()¶
- type_to_string()¶
- xyzOffset()¶
- class CoordinatesFieldMeshInterpoler¶
Bases:
MeshInterpoler
- class Curvature¶
Bases:
GeometricProperties
- doIt()¶
- getTextureProperties()¶
- regularize()¶
- class CurveSelection¶
Bases:
BundleProducer
,BundleListener
- addFiberPoint()¶
- bundleStarted(producer, bundle_info)¶
- bundleTerminated(producer, bundle_info)¶
- fiberStarted(producer, bundle_info, fiber_info)¶
- fiberTerminated(producer, bundle_info, fiber_info)¶
- newFiberPoint(producer, bundle_info, fiber_info, point)¶
- noMoreBundle(producer)¶
- startBundle()¶
- startFiber()¶
- terminateBundle()¶
- terminateFiber()¶
- class CutMesh¶
Bases:
wrapper
Cut meshes by a plane. The output of the operation is one cut mesh per input mesh, and possibly a border polygon mesh, and a plane intersection mesh.
The plane mesh is not always correct, it is now preferred to use GLU’s tesselation algorithm.
To use it:
initialize using a constructor and/or set input parameters (see also the CutTexturedMesh subclasses to handle textured meshes)
call cut() or cutBorder(), these are the methods actually doing things
get outputs using cutMeshes(), borderLine(), planeMesh() and CutTexturedMesh.cutTextures()
- borderLine()¶
- cut()¶
- cutBorder()¶
- cutMeshes()¶
- planeMesh()¶
- class FastMarching(connectivity='26', process_mid_interface=False)¶
Bases:
wrapper
FastMarching(process_mid_interface)
(2nd form: deprecated constructor, with connectivity 26.)
- Parameters:
connectivity (string) – “26”, “18”, “6”. The connectivity type is only used to build the interfaces between the work region and the seeds: the fast marching itself only uses 6-connectivity.
process_mid_interface (bool) – If process_mid_interface is false (the default), voronoi boundaries will not be available after propagation.
Fast marching algorithm implementation, for images.
The fast marching is a propagation algorithm which is typically used to perform distance maps. It may use a speed map to locally change the propagation speed and distance. It may also be used to perform a Voronoi diagam, and to get Voronoi regions boundaries.
It is used the following way:
instantiate a FastMarching object, with specified connectivity
if needed, set the speed map (or inverse speed map) using setSpeedMap() or setInvSpeedMap()
propagate using one of the doit() methods. It will return the distanc map.
Voronoi and boundaries can then be retreived using voronoiVol(), midInterface() or midInterfaceVol()
- clearSpeedMap()¶
- doit(vol, worklabel, inlabel, outlabel)¶
Perform fast marching propagation from a label image “vol”.
This is a simplified interface to the other, more general, doit() method.
Propagation will take place in the region “worklabel”, from seeds “inlabel” and “outlabel”.
- Parameters:
vol (rc_ptr_Volume_S16) – label volume to build distance map from. Contains seeds, propagation (work) region, and possibly forbidden regions
worklabel (int16) –
inlabel (int16) –
outlabel (int16) –
- Returns:
distance_map – resulting distance map
- Return type:
doit(vol, worklabels, seedlabels)
Perform fast marching propagation from a label image “vol”.
Propagation will take place in the regions listed in “worklabels”, from all seeds in the “seedlabels” list.
- Parameters:
vol (rc_ptr_Volume_S16) – label volume to build distance map from. Contains seeds, propagation (work) region, and possibly forbidden regions
worklabels (set_S16) – WARNING: the propagation labels in worklabels should be positive
seedlabels (set_S16) –
- Returns:
distance_map – resulting distance map
- Return type:
- invSpeedMap()¶
- midInterface(label1, label2)¶
get the interface between Voronoi regions label1 and label2, as a bucket.
The mid_interface option must have been used when instantiating the FastMarching object, and propagation maust have taken place.
- midInterfaceLabels()¶
Voronoi interfaces labels. Given as a vector of pairs of labels
- Returns:
labels – in the shape ((label1, label2), (label3, label4), …)
- Return type:
tuple of tuples
- midInterfaceVol(label1, label2)¶
get the interface between Voronoi regions label1 and label2, as a volume.
the mid_interface option must have been used when instantiating the FastMarching object, and propagation maust have taken place.
- setInvSpeedMap(invspeed)¶
Sets an initialized inverse speed map (overrides any previous speed map).
Once a speed map (or inverse speed map) has been setup manually, it will be used during propagation in doit(), for only one run. The speed map data contents will be modified during the process, and the map will not be reusable for other data (seed voxels will be printed in it). The input inverse speed map object will also be modified since it is a shared reference, the algorithm will directly work in it.
- Parameters:
invspeed (rc_ptr_Volume_FLOAT) –
- setSpeedMap(speed)¶
Sets an initialized speed map. The inverse speed will be deduced from it.
Once a speed map (or inverse speed map) has been setup manually, it will be used during propagation in doit(), for only one run. The speed map data contents will be modified during the process, and the map will not be reusable for other data (seed voxels will be printed in it).
- Parameters:
speed (rc_ptr_Volume_FLOAT) –
- setVerbose()¶
- verbose()¶
- voronoiVol()¶
get the resulting Voronoi regions (after propagation)
- class FastMarching_BucketMap_S16(connectivity='26', process_mid_interface=False)¶
Bases:
wrapper
FastMarching_BucketMap_S16(process_mid_interface)
(2nd form: deprecated constructor, with connectivity 26.)
- Parameters:
connectivity (string) – “26”, “18”, “6”. The connectivity type is only used to build the interfaces between the work region and the seeds: the fast marching itself only uses 6-connectivity.
process_mid_interface (bool) – If process_mid_interface is false (the default), voronoi boundaries will not be available after propagation.
Fast marching algorithm implementation, for buckets.
The fast marching is a propagation algorithm which is typically used to perform distance maps. It may use a speed map to locally change the propagation speed and distance. It may also be used to perform a Voronoi diagam, and to get Voronoi regions boundaries.
It is used the following way:
instantiate a FastMarching object, with specified connectivity
if needed, set the speed map (or inverse speed map) using setSpeedMap() or setInvSpeedMap()
propagate using one of the doit() methods. It will return the distanc map.
Voronoi and boundaries can then be retreived using voronoiVol(), midInterface() or midInterfaceVol()
- clearSpeedMap()¶
- doit(vol, worklabel, inlabel, outlabel)¶
Perform fast marching propagation from a label bucket “vol”.
This is a simplified interface to the other, more general, doit() method.
Propagation will take place in the region “worklabel”, from seeds “inlabel” and “outlabel”.
- Parameters:
vol (rc_ptr_BucketMap_S16) – label bucket to build distance map from. Contains seeds, propagation (work) region. Propagation outside the bucket will be forbidden.
worklabel (int16) –
inlabel (int16) –
outlabel (int16) –
- Returns:
distance_map – resulting distance map
- Return type:
doit(vol, worklabels, seedlabels)
Perform fast marching propagation from a label bucket “vol”.
Propagation will take place in the regions listed in “worklabels”, from all seeds in the “seedlabels” list.
- Parameters:
vol (rc_ptr_BucketMap_S16) – label bucket to build distance map from. Contains seeds, propagation (work) region, and possibly forbidden regions
worklabels (set_S16) –
seedlabels (set_S16) –
- Returns:
distance_map – resulting distance map
- Return type:
- midInterface(label1, label2)¶
get the interface between Voronoi regions label1 and label2, as a bucket.
The mid_interface option must have been used when instantiating the FastMarching object, and propagation maust have taken place.
- midInterfaceLabels()¶
Voronoi interfaces labels. Given as a vector of pairs of labels
- Returns:
labels – in the shape ((label1, label2), (label3, label4), …)
- Return type:
tuple of tuples
- midInterfaceVol(label1, label2)¶
get the interface between Voronoi regions label1 and label2, as a volume.
the mid_interface option must have been used when instantiating the FastMarching object, and propagation maust have taken place.
- setInvSpeedMap(invspeed)¶
Sets an initialized inverse speed map (overrides any previous speed map).
- Parameters:
invspeed (rc_ptr_BucketMap_FLOAT) –
- setSpeedMap(speed)¶
Sets an initialized speed map. The inverse speed will be deduced from it.
- Parameters:
speed (rc_ptr_BucketMap_FLOAT) –
- setVerbose()¶
- verbose()¶
- voronoiVol()¶
get the resulting Voronoi regions (after propagation)
- class FfdTransformation(*args)¶
Bases:
Transformation3d
FFD vector field deformation transform
Free Form Deformation is the registration technique used to build the vector fields. This class is dedicated to the application of the vector field deformation to transform coordinates.
Vector fields are stored in volumes rc_ptr_Volume_POINT3DF.
- ctrlDeformations()¶
- deformation()¶
- dimX()¶
- dimY()¶
- dimZ()¶
- ffdCoord()¶
- getCtrlKnot()¶
- increaseResolution()¶
- isFlat()¶
- isIdentity()¶
Test if the transformation can safely be omitted
This method must only return true if the transformation behaves exactly like an identity transformation (notably, the transform methods will always return the input coordinates unchanged).
NOTE: Implementors of derived classes may choose to always return false if a test would be difficult to implement or expensive to run.
- isXFlat()¶
- isYFlat()¶
- isZFlat()¶
- printControlPointsGrid()¶
- sizeX()¶
- sizeY()¶
- sizeZ()¶
- transformDouble()¶
- transformFloat()¶
- transformPoint3d()¶
- transformPoint3dd()¶
- transformPoint3df()¶
- updateAllCtrlKnot()¶
- updateAllCtrlKnotFromDeformation()¶
- updateCtrlKnot()¶
- updateDimensions()¶
- write()¶
- writeDebugCtrlKnots()¶
- writeDebugDeformations()¶
- class Finder¶
Bases:
wrapper
- check()¶
- dataType()¶
- extensions()¶
- finderFormat()¶
- format()¶
- header()¶
- objectType()¶
- possibleDataTypes()¶
- registerFormat()¶
- setDataType()¶
- setFormat()¶
- setHeader()¶
- setObjectType()¶
- setPossibleDataTypes()¶
- unregisterFormat()¶
- class FoldArgOverSegment¶
Bases:
wrapper
- dilateBucket()¶
- findSplitLine()¶
- mergeVertices(v1, v2)¶
merge vertices into v1. v2 is removed from the graph.
- printSplitInSkeleton()¶
- splitLineOnBucket()¶
- splitSimpleSurface()¶
- splitVertex()¶
- subdivizeGraph()¶
- subdivizeVertex()¶
- class FoldGraphAttributes¶
Bases:
wrapper
- cleanup()¶
- doAll()¶
- getBrainDepth()¶
- getBrainDepthGradX()¶
- getBrainDepthGradY()¶
- getBrainDepthGradZ()¶
- getDepth()¶
- getDepthfactor()¶
- getDilatedDepth()¶
- getDilatedDepthGradX()¶
- getDilatedDepthGradY()¶
- getDilatedDepthGradZ()¶
- getNDepth()¶
- greyAndCSFVolumes()¶
- makeCorticalRelationAttributes()¶
- makeGlobalAttributes()¶
- makeJunctionAttributes()¶
- makeMeshes()¶
- makePliDePassageAttributes()¶
- makeSimpleSurfaceAttributes()¶
- makeSummaryGlobalAttributes()¶
- maxThreads()¶
- mesher()¶
- prepareBrainDepthMap()¶
- prepareDepthMap()¶
- rebuildCorticalRelations()¶
- setMaxThreads()¶
Sets the maxumum number of threads used in multithreaded-enabled parts. 1 means mono-threaded, 0 means une thread per CPU. A negative value means one thread per CPU, but never use more CPUs than the absolute value of the given number.
- thickness()¶
- class GeodesicPath(surface, texCurv, method, strain)¶
- class GeodesicPath(surface, method, strain)
Bases:
wrapper
Initializes the geodesic path structures for a given mesh geometry, using a constraint map (curvature, typically). Several methods are available.
- Parameters:
surface (AimsTimeSurface_3_VOID) – mesh to compute geodesic paths or distances on
texCurv (TimeTexture_FLOAT) – constraint map texture. If not specified, the curvature will be computed and used as constraint.
method (int) –
- 0:
unconstrained,
- 1:
minimize the constraint map, suitable for sulci using the curvature as constraint,
- 2:
maximize constraint map, suitable for gyri using the curvature as constraint,
- 3:
unconstrained
strain (int) – weight factor on the constraints map. In practice we use 3 for sulci and gyri.
Geodesic paths or distance maps, using the Dijkstra algorithm
Ex:
from soma import aims, aimsalgo mesh = aims.read('mesh.gii') gp = GeodesicPath(mesh, 0, 0) dmap = TimeTexture('FLOAT') // get a distance map from vertex no 12 dmax = gp.distanceMap_1_N_ind(12, dmap[0].data(), 0) aims.write(dmax, 'distance.gii')
It is possible to get distance maps, or paths between two or more points.
- distanceMap_1_N_ind()¶
Compute a distance map from a given point
- Parameters:
source (int) – index of the starting point (vertex number)
distanceMap (vector_FLOAT) – output distance map, the vector can be empty, it will be filled with as many values as the mesh vertices number.
type_distance (int) –
- 0:
weighted distance,
- 1:
euclidean distance
- Returns:
length – max distance
- Return type:
- longestPath_1_N_ind(source, targets, type_distance)¶
- Parameters:
source (unsigned) –
targets (vector_U32) –
type_distance (int) –
- Returns:
target (unsigned)
length (float)
- longestPath_N_N_ind(points, type_distance)¶
- Parameters:
points (vector_U32) –
type_distance (int) –
- Returns:
s (int)
d (int)
length (float)
- shortestPath_1_1_1_ind(source, middle, target)¶
- Parameters:
source (unsigned) –
middle (unsigned) –
target (unsigned) –
- Returns:
path
- Return type:
- shortestPath_1_1_ind(source, target)¶
- Parameters:
source (unsigned) –
target (unsigned) –
- Returns:
path
- Return type:
shortestPath_1_1_ind(source, target, subset)
- Parameters:
source (unsigned) –
target (unsigned) –
subset (TimeTexture_S16) –
- Returns:
path
- Return type:
- shortestPath_1_1_ind_xyz(source, target, indice, coord3D)¶
- Parameters:
source (unsigned) –
target (unsigned) –
indice (vector_U32 (output)) –
coord3D (vector_POINT3DF (output)) –
- shortestPath_1_1_len(source, target)¶
- Parameters:
source (unsigned) –
target (unsigned) –
- Returns:
length
- Return type:
- shortestPath_1_1_tex(source, target, texturevalue, tex)¶
- Parameters:
source (unsigned) –
target (unsigned) –
texturevalue (float) –
tex (TimeTexture_S16 (output)) –
- shortestPath_1_N_ind(source, targets)¶
- Parameters:
source (unsigned) –
targets (vector_U32) –
- Returns:
target (unsigned)
length (float)
- class GeometricProperties¶
Bases:
wrapper
- buildSortVerticesNeighborhood()¶
- doAlpha()¶
- doBeta()¶
- doDot()¶
- doGraph()¶
- doNeighbor()¶
- doPhi()¶
- doSimpleAlpha()¶
- doSurface()¶
- doTheta()¶
- getAlpha()¶
- getBeta()¶
- getMesh()¶
- getNeighbor()¶
- getRcMesh()¶
- getSimpleAlpha()¶
- getTriangleNeighbor()¶
- graphToMesh()¶
- sortPolygons()¶
- class GradientAdvection¶
Bases:
wrapper
- descend_scalar_field()¶
- doit()¶
- propagate_all_labels()¶
- setPropagationThreshold()¶
- setVerbose()¶
- class GraphManip¶
Bases:
wrapper
- attributeColor()¶
- buckets2Volume()¶
- completeGraph()¶
- getICBM2009cTemplateTransform()¶
transform = aims.GraphManip.getICBM2009cTemplateTransform(graph)
Extract the transformation to the MNI ICBM152 space, shifted to the “most standard” field of view of the template image, the one from the ICBM2009c_nlin_asym template from the MNI. Actually we find various fields of view for the templates. The one we use here is (193, 229, 193). The transform to the “real” ICBM space (0 roughly at AC) is provided in the output transformation header. This space has a fixed transformation with our Aims Talairach, along with the template volume size and voxel size. This space has a fixed transformation with our Aims Talairach. Includes shifts and axes inversions.
- getICBMTransform()¶
transform = aims.GraphManip.getICBMTransform(graph)
Extract the transformation to the MNI ICBM152 space. This space has a fixed transformation with our Aims Talairach.
- getPath()¶
- get_element_table()¶
Get the GraphElementTable as a dict. The dict has the following shape:
{ syntax_name: { id_name: GraphElementCode_object } }
GraphElementCode objects are given as dicts (str, str):
{ 'id': <same_as_key: filename (globals) or attribute for filename (locals)>, 'attribute': <attribute_name_in_graph_element>, 'objectType': <type of object>, 'dataType': <data type of object>, 'storageType': <'Global', 'Local', or 'GlobalPacked'>, 'local_file_attribute': <attribute giving the filename for local storage in each graph elememt>, 'global_index_attribute': <attribute giving the index for global storage in each graph elememt>, 'global_filename': <filename for global storage>, 'global_attribute': <attribute>, 'syntax': <syntax_name> }
- graphFromVolume()¶
graph = graphFromVolume(vol, background=0, trans=None) graphFromVolume(vol, graph, background=0, trans=None,
automaticBackgroundSearch=True)
builds a ROI graph from a volume of labels
- printGraphElementTable()¶
- setAttributeColor()¶
- storeAims()¶
- storeTalairach()¶
- talairach()¶
- volume2Buckets()¶
- class HarmonicCageMeshResampler¶
Bases:
wrapper
- computeCoordinates()¶
- coordinate()¶
- coordinates()¶
- getControl()¶
- get_image_coords()¶
- moveControl()¶
- set_keep_image_coords()¶
- class Hierarchy(*args, **kwargs)¶
Bases:
Tree
- find(name)¶
- find_color(name, default_color=<class 'KeyError'>)¶
- hasSyntax()¶
- setSyntax()¶
- class MaskIterator(*args)¶
Bases:
RCObject
- contains()¶
- isValid()¶
- next()¶
- regionName()¶
- restart()¶
- value()¶
- valueMillimeters()¶
- volumeDimension()¶
- voxelSize()¶
- class MeshInterpoler¶
Bases:
wrapper
- Linear = 0¶
- NearestNeighbour = 1¶
- project()¶
- projectedTriCoord1()¶
- projectedTriCoord2()¶
- projectedTriCoord3()¶
- projectedTriangles()¶
- reloadProjectionParams()¶
- resampleMesh()¶
- resampleTexture()¶
- setDiscontinuityThresholds()¶
- setMeshes()¶
- class PointsDistribution(force=None, move_constaint=None)¶
Bases:
wrapper
- Parameters:
force (aims.PointsDistribution.ForceFunction instance) – force / energy function between 2 points. Takes 2 points and a bool (has_link), and returns the force vector applied to the 1st point. Defaults to a Coulomb force (r_vec/r^3)
move_constraints (aims.PointsDistribution.MoveConstraints instance) – applies force to a point, and add additional constraints. Takes a point, a force vector, and a step (factor to the force), returns the new point position. Default: projects the force to be tangent to a unit sphere, and renormalizes the resulting point position to stock on the sphere.
Points repartition using forces in a given geometry (on a sphere for instance).
adapted from: http://www.nicoptere.net/blog/index.php/2008/09/20/50-distribution-points-sphere-actionscript http://www.nicoptere.net/AS3/distribution/Distribute.as
Points are moved according to forces, using an energy minimization method.
A few parameters have been added, to allow fitting spheres, or “free” geometries and forces.
Linked points can be defined, with different force behaviours.
- class CoulombAndRestoringForce¶
Bases:
ForceFunction
Utility function for sphere_distribution.
Individual Coulomb force between 2 points, plus a restoring force that avoids points expanding away like the universe
- energy()¶
Energy of the force between 2 points
Energy functions are the integral of corresponding forces - they are used to drive the minimization.
- class CoulombForce¶
Bases:
ForceFunction
Utility function for sphere_distribution.
Individual Coulomb force between 2 points
- energy()¶
Coulomb energy of the force between 2 points (1/r)
- force()¶
Coulomb electrostatic force between 2 points (r_vec/r^3)
- class ForceFunction¶
Bases:
wrapper
Utility force class for sphere_distribution.
Individual force and energy between 2 points
- energy()¶
Energy of the force between 2 points
Energy functions are the integral of corresponding forces - they are used to drive the minimization.
- class MoveConstraints¶
Bases:
wrapper
Utility function for sphere_distribution.
Add force f * step to the returned point position pt, and optionally apply some specific position constraints (stick to sphere…)
- position(pt, f, step)¶
The default is unconstrained: just move the requested amount
- Parameters:
pt (Point3df) – point to be moved
f (Point3df) – force which applies on the point
step (float) – move step factor
- Returns:
new_pos – Position after move and application of constraints
- Return type:
Point3df
- class SphereMove¶
Bases:
MoveConstraints
Move point constrained to a uinit sphere: project the force to be tangent to the sphere, move the point, then stick it onto the sphere.
- position(pt, f, step)¶
The default is unconstrained: just move the requested amount
- Parameters:
pt (Point3df) – point to be moved
f (Point3df) – force which applies on the point
step (float) – move step factor
- Returns:
new_pos – Position after move and application of constraints
- Return type:
Point3df
- distribute(pts, nsteps=100, step=0.01)¶
get a points distribution on a sphere.
- Parameters:
points (list of 3D points (Point3df)) –
nsteps (max number of optimization iterations) –
step (initial move step factor (is adapted during the minimization)) –
distribute(npoints, nsteps=100, step=0.01)
Same as above but point are randomly initialized on a sphere, using the init_points() function
- get_coulomb_energy()¶
- get_forces()¶
- init_points(npoints)¶
Randomly initialize npoints points on a unit sphere
- Parameters:
npoints (int) – number of points to initialize
- Returns:
points – points 3D positions
- Return type:
- setForceFunction(force)¶
Set the individual force function
- Parameters:
force (aims.PointsDistribution.ForceFunction instance) –
- setMoveConstraints(move_constaint)¶
Set the individual move constraints function
- Parameters:
move_constaint (aims.PointsDistribution.MoveConstraints instance) –
- set_links(links)¶
Set linked points set
Optional links. Linked points have different forces to make them closer. The links dict maps a point num to a set of linked points: {0: [1, 3], 1: [0, 5], 2: [4], 3: [0]} The map should be symmetrical.
- class Quaternion¶
Bases:
wrapper
- angle()¶
- axis()¶
- buildFromMatrix(m)¶
- Parameters:
m (vector_FLOAT) – 4x4 matrix in columns (OpenGL-style). Be careful that it is not the expected order for a numpy array using ravel(), which have to be transposed.
- buildFromMotion()¶
- compose(value, /)¶
Return self*value.
- fromAxis()¶
- inverse()¶
- norm()¶
- normalized()¶
- setVector()¶
- transform()¶
- transformInverse()¶
- vector()¶
- class RegularBinnedHistogram_DOUBLE¶
Bases:
Histogram_DOUBLE
- bins()¶
- doit()¶
- maxDataValue()¶
- minDataValue()¶
- setBins()¶
- unique()¶
- class RegularBinnedHistogram_FLOAT¶
Bases:
Histogram_FLOAT
- bins()¶
- doit()¶
- maxDataValue()¶
- minDataValue()¶
- setBins()¶
- unique()¶
- class RegularBinnedHistogram_S16¶
Bases:
Histogram_S16
- bins()¶
- doit()¶
- maxDataValue()¶
- minDataValue()¶
- setBins()¶
- unique()¶
- class RegularBinnedHistogram_S32¶
Bases:
Histogram_S32
- bins()¶
- doit()¶
- maxDataValue()¶
- minDataValue()¶
- setBins()¶
- unique()¶
- class RegularBinnedHistogram_U16¶
Bases:
Histogram_U16
- bins()¶
- doit()¶
- maxDataValue()¶
- minDataValue()¶
- setBins()¶
- unique()¶
- class RegularBinnedHistogram_U32¶
Bases:
Histogram_U32
- bins()¶
- doit()¶
- maxDataValue()¶
- minDataValue()¶
- setBins()¶
- unique()¶
- class RegularBinnedHistogram_U8¶
Bases:
Histogram_U8
- bins()¶
- doit()¶
- maxDataValue()¶
- minDataValue()¶
- setBins()¶
- unique()¶
- class ResamplerFactory_DOUBLE¶
Bases:
wrapper
ResamplerFactory classes are used to instantiate a Resampler object for the chosen interpolation type. The main method is getResampler().
- Cubic = 3¶
- Linear = 1¶
- MajorityLabel = 101¶
- Median = 201¶
- NearestNeighbor = 0¶
- Quadratic = 2¶
- Quartic = 4¶
- Quintic = 5¶
- SeventhOrder = 7¶
- SixthOrder = 6¶
- class ResamplerFactory_FLOAT¶
Bases:
wrapper
ResamplerFactory classes are used to instantiate a Resampler object for the chosen interpolation type. The main method is getResampler().
- Cubic = 3¶
- Linear = 1¶
- MajorityLabel = 101¶
- Median = 201¶
- NearestNeighbor = 0¶
- Quadratic = 2¶
- Quartic = 4¶
- Quintic = 5¶
- SeventhOrder = 7¶
- SixthOrder = 6¶
- class ResamplerFactory_HSV¶
Bases:
wrapper
ResamplerFactory classes are used to instantiate a Resampler object for the chosen interpolation type. The main method is getResampler().
- Cubic = 3¶
- Linear = 1¶
- MajorityLabel = 101¶
- Median = 201¶
- NearestNeighbor = 0¶
- Quadratic = 2¶
- Quartic = 4¶
- Quintic = 5¶
- SeventhOrder = 7¶
- SixthOrder = 6¶
- class ResamplerFactory_POINT3DF¶
Bases:
wrapper
ResamplerFactory classes are used to instantiate a Resampler object for the chosen interpolation type. The main method is getResampler().
- Cubic = 3¶
- Linear = 1¶
- MajorityLabel = 101¶
- Median = 201¶
- NearestNeighbor = 0¶
- Quadratic = 2¶
- Quartic = 4¶
- Quintic = 5¶
- SeventhOrder = 7¶
- SixthOrder = 6¶
- class ResamplerFactory_RGB¶
Bases:
wrapper
ResamplerFactory classes are used to instantiate a Resampler object for the chosen interpolation type. The main method is getResampler().
- Cubic = 3¶
- Linear = 1¶
- MajorityLabel = 101¶
- Median = 201¶
- NearestNeighbor = 0¶
- Quadratic = 2¶
- Quartic = 4¶
- Quintic = 5¶
- SeventhOrder = 7¶
- SixthOrder = 6¶
- class ResamplerFactory_RGBA¶
Bases:
wrapper
ResamplerFactory classes are used to instantiate a Resampler object for the chosen interpolation type. The main method is getResampler().
- Cubic = 3¶
- Linear = 1¶
- MajorityLabel = 101¶
- Median = 201¶
- NearestNeighbor = 0¶
- Quadratic = 2¶
- Quartic = 4¶
- Quintic = 5¶
- SeventhOrder = 7¶
- SixthOrder = 6¶
- class ResamplerFactory_S16¶
Bases:
wrapper
ResamplerFactory classes are used to instantiate a Resampler object for the chosen interpolation type. The main method is getResampler().
- Cubic = 3¶
- Linear = 1¶
- MajorityLabel = 101¶
- Median = 201¶
- NearestNeighbor = 0¶
- Quadratic = 2¶
- Quartic = 4¶
- Quintic = 5¶
- SeventhOrder = 7¶
- SixthOrder = 6¶
- class ResamplerFactory_S32¶
Bases:
wrapper
ResamplerFactory classes are used to instantiate a Resampler object for the chosen interpolation type. The main method is getResampler().
- Cubic = 3¶
- Linear = 1¶
- MajorityLabel = 101¶
- Median = 201¶
- NearestNeighbor = 0¶
- Quadratic = 2¶
- Quartic = 4¶
- Quintic = 5¶
- SeventhOrder = 7¶
- SixthOrder = 6¶
- class ResamplerFactory_U16¶
Bases:
wrapper
ResamplerFactory classes are used to instantiate a Resampler object for the chosen interpolation type. The main method is getResampler().
- Cubic = 3¶
- Linear = 1¶
- MajorityLabel = 101¶
- Median = 201¶
- NearestNeighbor = 0¶
- Quadratic = 2¶
- Quartic = 4¶
- Quintic = 5¶
- SeventhOrder = 7¶
- SixthOrder = 6¶
- class ResamplerFactory_U32¶
Bases:
wrapper
ResamplerFactory classes are used to instantiate a Resampler object for the chosen interpolation type. The main method is getResampler().
- Cubic = 3¶
- Linear = 1¶
- MajorityLabel = 101¶
- Median = 201¶
- NearestNeighbor = 0¶
- Quadratic = 2¶
- Quartic = 4¶
- Quintic = 5¶
- SeventhOrder = 7¶
- SixthOrder = 6¶
- class ResamplerFactory_U8¶
Bases:
wrapper
ResamplerFactory classes are used to instantiate a Resampler object for the chosen interpolation type. The main method is getResampler().
- Cubic = 3¶
- Linear = 1¶
- MajorityLabel = 101¶
- Median = 201¶
- NearestNeighbor = 0¶
- Quadratic = 2¶
- Quartic = 4¶
- Quintic = 5¶
- SeventhOrder = 7¶
- SixthOrder = 6¶
- class RoiDiff¶
Bases:
wrapper
- diff()¶
- globalStats()¶
- graph2LabelVolume()¶
- mismatch_bucket()¶
- roiNames()¶
- roiNamesInv()¶
- statsByLabel()¶
- writeCSV()¶
- class RoiIterator(*args)¶
Bases:
RCObject
- count()¶
- isValid()¶
- maskIterator()¶
- next()¶
- regionName()¶
- restart()¶
- setRegionNameAttributes(attributes)¶
set region name attribute in graph. Normally “name” or “label”. If several values are provided, attributes are searched in each graph vertex, in that order. If the attributes list is empty, then the graph “label_property” attribute will be used, and if it is not specified there, the default search list (“name”, “label”) will be used.
- class SimpleBundlesSlicer¶
Bases:
BundlesSlicer
- bundleStarted(producer, bundle_info)¶
- bundleTerminated(producer, bundle_info)¶
- fiberStarted(producer, bundle_info, fiber_info)¶
- fiberTerminated(producer, bundle_info, fiber_info)¶
- newFiberPoint(producer, bundle_info, fiber_info, point)¶
- noMoreBundle(producer)¶
- class SpamBase¶
Bases:
wrapper
- prodlikelihoods()¶
- set_bb_talairach_offset()¶
- set_bb_talairach_size()¶
- set_img_density()¶
- class SparseMatrix(*args)¶
Bases:
RCObject
- erase_element()¶
- fill()¶
- getColumn()¶
- getComposition()¶
- getNonZeroElementCount()¶
- getRow()¶
- getSize1()¶
- getSize2()¶
- getTrace()¶
- getTransposition()¶
- hasElement()¶
- header()¶
- isSquare()¶
- read()¶
- reallocate()¶
- setColumn()¶
- setDiagonal()¶
- setIdentity()¶
- setRow()¶
- setZero()¶
- transpose()¶
- write()¶
- class SparseOrDenseMatrix(*args)¶
Bases:
RCObject
- asDense()¶
- asSparse()¶
- denseMatrix()¶
- erase_element()¶
- freeColumn()¶
- freeRow()¶
- getColumn()¶
- getNonZeroElementCount()¶
- getRow()¶
- getSize()¶
- getSize1()¶
- getSize2()¶
- hasElement()¶
- header()¶
- isDense()¶
- isOptimalShape()¶
- muteToDense()¶
- muteToOptimalShape()¶
- muteToSparse()¶
- read()¶
- readAll()¶
- readColumn()¶
- readRow()¶
- reallocate()¶
- setColumn()¶
- setHeader()¶
- setMatrix()¶
- setRow()¶
- set_element()¶
- sparseMatrix()¶
- subMatrix()¶
- write()¶
- class SphereSamplable¶
Bases:
Samplable_FLOAT_3
- contains()¶
- class SplineFfd(*args)¶
Bases:
FfdTransformation
FFD vector field deformation transform
Free Form Deformation is the registration technique used to build the vector fields. This class is dedicated to the application of the vector field deformation to transform coordinates.
Vector fields are stored in volumes rc_ptr_Volume_POINT3DF.
This Spline FFD uses cubic spline interpolation between displacement vectors to process transformed coordinates. See TrilinearFfd for a variant using trilinear interpolation.
This class is the “base” vector field deformation class, which can perform point-to-point transformation. It is used by various higher-level classes or functions to work on higher-level objects:
To resample full 2D or 3D images, see the Resampler class and its derived classes (see also ResamplerFactory).
As a Transformation3d specialization, the main method of this class is the transform() method, which actually performs 3D coordinates transformation. The other methods can be seen as “internal machinery”.
see transformMesh, transformBucket, transformGraph and BundleTransformer to apply vector field deformations to various types of objects.
- spline3()¶
- transformDouble()¶
- transformFloat()¶
- transformPoint3d()¶
- transformPoint3dd()¶
- transformPoint3df()¶
- class StandardReferentials¶
Bases:
wrapper
- acPcReferential()¶
identifer (str) for the Taialairach/AIMS space
- acPcReferentialID()¶
identifer (UUID str) for the Talairach/AIMS space
- commonScannerBasedReferential()¶
- commonScannerBasedReferentialID()¶
- icbm2009cTemplateHeader()¶
hdr = aims.StandardReferentials.icbm2009cTemplateHeader() Return a header with size and characteristics of the ICBM2009c MNI template volume.
- mniTemplateReferential()¶
identifer (str) for the MNI/ICBM space
- mniTemplateReferentialID()¶
identifer (UUID str) for the MNI/ICBM space
- talairachReferential()¶
identifer (str) for the Talairach/CIFTI space
- talairachToICBM()¶
- talairachToICBM2009cTemplate()¶
trans = aims.StandardReferentials.talairachToICBM2009cTemplate()
Transformation between the ICBM152 standard space and the ICBM152 template space.
includes shifts and axes inversions.
This is the “most standard” field of view of the template image, the one from the ICBM2009c_nlin_asym template from the MNI. Actually we find various fields of view for the templates. The one we use here is (193, 229, 193). The transform to the “real” ICBM space (0 roughly at AC) is provided in the output transformation header. This space has a fixed transformation with our Aims Talairach, along with the template volume size and voxel size. This space has a fixed transformation with our Aims Talairach.
- class SurfaceGenerator¶
Bases:
wrapper
Surface Generator Object. Available Methods are :
cube(center_p, radius_f, smoothnormal_b=false)
cylinder(p1_p, p2_p, radius1_f, radius2_f, nfacets_i, closed_b, smooth_b=false)
cone(arrow_p, base_p, radius_f, nfacets_i, closed_b, smooth_b=false)
arrow(arrow_p, base_p, radius_f, arrowradius_f, nfacets_i, arrowlengthfract_f)
icosahedron(center_p, radius_f)
sphere(center_p, radius_f, nfacets_i)
icosphere(center_p, radius_f, nfacets_i)
With arguments suffix _f:float, _i:int, _b:bool, _p: Point3df or 3-tuple
Alternatively, all those may be called with a GenericObject as only parameter.
This doc might not be up-to-date, use the
printDescription()
method for more info.- arrow()¶
static arrow( dictionary ) See the description() and printDescription() methods for more information.
static arrow( Point3df arrowhead, Point3df base, float headradius, float arrowradius, unsigned nfaces, float arrowlengthfactor )
- circle_wireframe()¶
- Circle, or part of circle.
center, radius are classical. nseg is the number of segments in the circle polygon normal is a normal vector to the circle plane. startdir is a vector in the circle plane determining the beginning of angles (circle ray). startangle, stopangle are meant to make parts of circle
- cone()¶
static cone( dictionary ) See the description() and printDescription() methods for more information.
static cone( Point3df arrowhead, Point3df base, float radius, unsigned nfaces, bool closed, bool smooth=False )
- cube()¶
static cube( dictionary ) See the description() and printDescription() methods for more information.
static cube( Point3df center, float radius, bool smoothnormals=False )
- cylinder()¶
static cylinder( dictionary ) See the description() and printDescription() methods for more information.
static cylinder( Point3df center1, Point3df center2, float radius1, float radius2, unsigned nfaces, bool closed, bool smooth=False )
- description()¶
- description_wireframe()¶
- ellipse()¶
static ellipse( dictionary ) See the description() and printDescription() methods for more information.
static ellipse( Point3df center, float radius1, float radius2, unsigned nfaces, bool uniquevertices=False )
- generate()¶
- generate_wireframe()¶
- grid(dict)¶
See the description() and printDescription() methods for more information.
grid(Point3df boundingbox_min, Point3df boundingbox_max, Point3df grid_sampling) Regular, wireframe grid
- icosahedron()¶
static icosahedron( dictionary ) See the description() and printDescription() methods for more information.
static icosahedron( Point3df center, float radius )
- icosphere(dictionary)¶
See the description() and printDescription() methods for more information.
icosphere( Point3df center, float radius, unsigned nfaces=320 )
Compared to sphere() which performs meridian / parallels tesselation, icosphere over-segments an icosahedron to get equal, equilateral triangles.
- parallelepiped(boundingbox_min, boundingbox_max, smooth=False)¶
- Parameters:
boundingbox_min (Point3df) – “lower bound” corner position
boundingbox_min – “upper bound” corner position
smooth (bool) – if True, make smooth faces and shared vertices in corners
- parallelepiped_wireframe(Point3df boundingbox_min, Point3df boundingbox_max)¶
- printDescription()¶
- printDescription_wireframe()¶
- sphere()¶
static sphere( dictionary ) See the description() and printDescription() methods for more information.
static sphere( Point3df center, float radius, unsigned nfaces, bool uniquevertices=False )
- class SurfaceManip¶
Bases:
wrapper
Surface Manipulation Object. All mehtods are static in this class, it is just a means of grouping functions.
- checkMeshIntersect()¶
- cutMesh(in_mesh, plane, cut_mesh, border_line)¶
Cut a mesh by a plane and that’s all.
- Parameters:
in_mesh (AimsSurfaceTriangle) – Triangular mesh to be cut.
plane (Point4df) – cut plane equation (4 coefs)
cut_mesh (AimsSurfaceTriangle) – output cut mesh (the part satisfying the plane equation). Polygons crossing the plane will be cut into smaller ones.
border_line (AimsTimeSurface_2_VOID) – output cut section polygon
- Return type:
None
- invertSurfacePolygons(mesh)¶
Invert polygons order (flips 2 vertex indices in each triangle) to flip its interior / exterior notions (used by OpenGL rendering). The input mesh is modified in-place.
- joinTexturedMesh()¶
Join a mesh and a texture into a textured mesh
- lineDirections(segments_mesh)¶
calculate directions of a line mesh, for each vertex
- Parameters:
segments_mesh (AimsTimeSurface_2_VOID) –
- Returns:
directions
- Return type:
- meshArea()¶
Surface area of a triangular mesh, in mm^2
Surface areas of regions of a triangular mesh, in mm^2. Regions are given as a texture.
- meshDensity(mesh, as_distance=False)¶
Calculate a mesh density: inverse of the average edges distance.
- Parameters:
mesh (AimsSurfaceTriangle) –
as_distance (bool (optional)) – if True, the average distance is not inverted, thus the output is an average distance map.
- Returns:
density_texture
- Return type:
- meshEdgeLengthRatioTexture(numerator_mesh, denominator_mesh)¶
Calculate an edge length ratio in edges of two meshes with the same topology. The max length ratios of edges is kept for each vertex.
- Parameters:
numerator_mesh (AimsSurfaceTriangle) –
denominator_mesh (AimsSurfaceTriangle) –
- Returns:
ratio_texture
- Return type:
- meshExtract(mesh, texture, label_value)¶
Extracts a sub-mesh defined by a texture label value.
- Returns:
sub_mesh (AimsTimeSurface_3_VOID) – extracted sub-mesh
vertices (vector_ULONG) – indices of extracted vertices
- meshMerge(input_output_mesh, input_mesh)¶
Concatenates the second mesh to the first one. The first argument will be modified.
- Parameters:
input_output_mesh (AimsTimeSurface_3_VOID) – first mesh. Will be modified to be the output.
input_mesh (AimsTimeSurface_3_VOID) – second mesh to be appended to the first one.
- Return type:
None
- meshPlanarPolygon(plane, polygon)¶
Tesselate a planar polygon to fill it by a triangular mesh
- Parameters:
plane (Point4df) – plane equation
polygon (AimsTimeSurface_2_VOID) – planar polygon to tesselate. Typically, the output of cutMesh()
- Returns:
planar_mesh – the mesh filling the polygon
- Return type:
AimsSurfaceTriangle
- meshTextureBoundary(mesh, label_texture, region_value)¶
Extracts the boundary of region of value <region_value> of the input texture, on the mesh.
If region_value is negative, take boundaries of all regions. The input texture is a label texture.
- Parameters:
mesh (AimsSurfaceTriangle) – input mesh to extract boundary on
label_texture (TimeTexture_S16, TimeTexture_S32, or TimeTexture_FLOAT) – label texture defining regions on the mesh
region_value (int16, int32 or float) – label of the desired region
- Returns:
boundary – output segments mesh (filar mesh) for the boundary
- Return type:
- meshTransform(mesh, transformation)¶
Apply linear coordinates transformation to a mesh. The input mesh will be modified in-place.
- Parameters:
mesh (AimsTimeSurface_3_VOID or AimsTimeSurface_2_VOID) – mesh to be transformed. Will be modified.
transformation (AffineTransformation3d) – Linear transformation matrix
- Return type:
None
- meshVolume(mesh)¶
Volume inside a triangular mesh, in mm^3. The mesh must enclode a closed volume, with no holes, otherwise the volume processing will “leak” and will be wrong.
- nearestPointToMesh()¶
- rasterizeMesh(mesh, volume, value=2)¶
Rasterize polygons into a volume.
- Parameters:
mesh (AimsTimeSurface_*) –
volume (Volume_S16) – Volume to write mesh imprint to
value (int) – label value used to write the mesh imprint in the volume
- rasterizeMeshWireframe(mesh, volume, value=1)¶
Rasterize polygons edges into a volume.
- Parameters:
mesh (AimsTimeSurface_*) –
volume (Volume_S16) – Volume to write mesh imprint to
value (int) – label value used to write the mesh imprint in the volume
- refineMeshTri4(mesh, selected_polygons=None)¶
Refine a mesh by subdivising every triangle into 4 smaller ones.
- Parameters:
mesh (AimsSurfaceTriangle) – mesh to be refined
selected_polygons (vector_U32) – optional list of polygons indices to be selectively refined. Others will not be changed, unless they are at the border of a refined one, in which case they have to be split in some way.
- Returns:
refined_mesh – refined mesh
- Return type:
AimsSurfaceTriangle
- sortPolygonsAlongDirection(mesh, timestep, direction)¶
Sort polygons along a given direction. Polygons centers will be used for sorting. Only one timestep is performed (to be fast).
- Parameters:
mesh (AimsTimeSurface_*) – The mesh will be modified.
timestep (int) –
direction (Point3df) –
sortPolygonsAlongDirection(mesh, timestep, direction)
Sort polygons along a given direction. Polygons centers will be used for sorting. Only one timestep is performed (to be fast).
- Parameters:
mesh (AimstimeSurface_*) – The mesh will be modified.
timestep (int) –
direction (Point3df) –
sortPolygonsAlongDirection(mesh, timestep, direction)
Sort polygons along a given direction. Polygons centers will be used for sorting. Only one timestep is performed (to be fast).
- Parameters:
mesh (AimstimeSurface_*) – The mesh will be modified.
timestep (int) –
direction (Point3df) –
- splitTexturedMesh()¶
Split a textured mesh into a mesh and a texture
- surfaceNeighbours()¶
- class TransformationChain3d(*args)¶
Bases:
Transformation3d
Container for a composition of multiple transformations.
This container holds a list of transformations, and acts as the composition of all transformations. Transformations are composed from the front to the back of the list:
chain = TransformationChain3d() chain.push_back(t1) chain.push_back(t2) # chain->transform(p) == t2.transform(t1.transform(p))
warning: Do not modify the transformations once you have passed them to push_back() or push_front(): it is unspecified if the changes will be noticed by TransformationChain3d (a reference to the same object may be kept internally, or a copy could be made). This behaviour will allow optimizations to be implemented (e.g. composing adjacent affine transformations by multiplying their matrices).
- getInverse()¶
- invertible()¶
- isIdentity()¶
Test if the transformation can safely be omitted
This method must only return true if the transformation behaves exactly like an identity transformation (notably, the transform methods will always return the input coordinates unchanged).
NOTE: Implementors of derived classes may choose to always return false if a test would be difficult to implement or expensive to run.
- pop_back()¶
Remove the last transformation from the list
- pop_front()¶
Remove the first transformation from the list
- push_back(transformation)¶
Add a transformation to the back of the list (applied last)
- push_front(transformation)¶
Add a transformation to the front of the list (applied first)
- simplify()¶
Compute a simpler transformation that is equivalent to the chain.
The transformation chain is simplified by applying the following rules, so that it should provide equivalent results to the original chain, up to numerical precision:
The simplification is applied recursively to any sub-chain.
Transformations of the simplified sub-chains are inserted at the top level (i.e. the simplified chain is flat, it contains no sub-chains).
Consecutive affine transformations are composed using matrix multiplication.
Identity transforms (i.e. transforms for which Transformation::isIdentity() returns true) are removed from the list.
If the simplified chain consists of only one transformation, no chain is returned, the contained transformation is returned directly. However, the transformation is not necessarily the same instance that was inserted in the chain (it will be a copy if it is an AffineTransformation3d).
If the simplified chain is empty, an empty chain is returned.
No deep copy is made, so the result can contain pointers to the same transformations as the original chain.
- size()¶
- transformDouble()¶
- transformFloat()¶
- transformPoint3d()¶
- transformPoint3dd()¶
- transformPoint3df()¶
- class TransformationGraph3d(*args, **kwargs)¶
Bases:
Graph
Manage transformations (affine and non-linear) transformations graph.
It maintains a graph of directed transformations (vertices are referentials, edges are 3D transformations).
It can be populated from a dictionary (Object) which can be read from a JSON or YAML file, and performs lazy-loading: transformations are actually loaded when they are used, more precisely in getTransformation() and when building a chain of composed transformations.
The graph is oriented, and does not manage inverse transforms. We could thing this could be done automatically for affine or other inversible transformations, but the lazy loading feature does not allow to know if a not yet loaded transform will be inversible or not. So this has to be done manually for now.
The graph populates with composed transforms when they are used: indirect paths from a referential to another are generated when needed, and stored in the graph as “deduced” transforms. Later access will thus use this cache instead of reccomputing it. A drawback, thus, is that the graph has to be used “statically”: any modification in the graph structure, or in any of its transformations, should invalidate a number of deduced, cached ones, which we do not handle for now (it’s a quite difficult problem to manage it efficiently). To date the only solution is to completely clear the cached transforms (clearCache()) after any modification.
The TransformationGraph3d structure is a Graph, and its elements are Vertex or Edge objects. To manipulate transformations, the API generally allows to use identifiers (generally UUIDs) for elements, and the Transformation objects are accessed through the “transformation” property of edges, or using the transformation() convenience method:
ref1 = tgraph.referentialById(“23df7ce8-e405-bc31-3863-d543e3cc89e5”) trans_edge = tgraph.getTransformation(
“23df7ce8-e405-bc31-3863-d543e3cc89e5”, “52929a27-6838-1d08-d6fc-7905ed9413a0”)
- if trans_edge:
trans = tgraph.transformation(trans_edge)
see also: https://hbp-spatial-backend.apps.hbp.eu/swagger-ui#/api_v1/get_v1_transform_point
- asDict()¶
convert to a dict-like structure compatible with loadTransformationsGraph()
- Parameters:
affine_only (bool) – if true, inclue only affine transformations
allow_read (bool) – if true, and if affine_only or embed_affines is also true, all affine transformations will be read in order to determine which are affine. Otherwise only those already loaded in memory (via the lazy reading mechanism) will be known to be affine. This parameter has no effect on non-affine transformations.
embed_affines (bool) –
- if true, affine transformations are not recorded as a
file name (.trm format), but as an embedded 4x4 matrix.
- clearCache(chain_only=False)¶
remove deduced transformations (built from composition).
If chain_only is true, then inverses of direct transforms are not removed.
- clone()¶
- currentValue()¶
- getScalar()¶
- getString()¶
- getTransformChain()¶
Get a transformation chain between two vertices.
You normally don’t need to call this method directly, il is called through getTransformation( src_ref, dst_ref, true ). This method however does not modify the transformations graph and does not register the combined transformation. It will, however, load lazy-loading transformations.
- getTransformation()¶
edge = tgraph.getTransformation(src_ref, dst_ref, allow_compose=False)
Get the transformation between source_ref and dst_ref. If it is not a registered transformation, return None. src_ref annd dst_ref may be string IDs or Vertex objects.
If allow_compose is True and the transformation is not found, then a transformations chain path is looked for. If a matching one is found, it is then registered in the graph to allow fast access later. The drawback of this register operation is that it cannot react to changes in the transformation chain (if a new transformation is added and could make a shorter path, it will not be taken into account).
- getTransformation_raw(src_ref, dst_ref)¶
same as getTransformation(), but do not perform lazy loading
- hasSyntax()¶
- has_key()¶
- intKey()¶
- isArray()¶
- isDictionary()¶
- isDictionaryIterator()¶
- isDynArray()¶
- isIterable()¶
- isIterator()¶
- isValid()¶
- key()¶
- loadAffineTransformations()¶
Load all affine transformations.
- loadTransformationsGraph()¶
Load a full transformations graph from a dict-like object.
The description dict may typically be read from a .json or a .yaml file.
The description is organized as a 2-level dictionary:
{ source_ref_id: { dest_ref_id1: transformation_filename1, dest_ref_id2: transformation_filename2, }, ... }
A referential ID is a string which may represent an UUID, or a name.
A transformatioon filename may be an affine (.trm) or non-linear (.ima) transformation file, or an empty string to represent an identity transformation.
The transformation files are found relatively to the directory given as the dirname parameter.
Alternatively to file names, an affine transformation may be given directly as its 4x4 matrix, written as a line vector (all 16 coefficients in a vecotr, describing the matrix horizontally). Ex:
{ source_ref_id: { dest_ref_id1: [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], }, ... }
- objectIterator()¶
- referentialById()¶
Get the vertex (referential) with given ID
- registerInverseTransformations(loadAffines=False)¶
register inverse transformations when they can be obtained.
This can be done only for loaded transformations. So the lazy loading feature will prevent for it to work on not already loaded transformations, since we cannot know if they are invertible before they are loaded.
For this reason, the loadAffines parameter allows to load affine transforms and register their inverses.
- registerTransformation()¶
Add (or register) the given transformation in the transformations graph.
transform may be a filename, or a Transformation instance. a Transformation is supposed to be a non-linear FFD (Free Form Deformation), not a linear transformation. If transform is a string, it may be: - an empty string will be an identity transformation - a .trm file will be an affine transformation, and will be passed to
the builtin Anatomist system
another file (.ima) will be a FFD transformation file and will be registered as its filename. Loading will happen only when the transformation is used, in get_transformation().
- setSyntax()¶
- size()¶
- transformation()¶
Get the Transformation3d object inside an edge. The returned reference counting pointer may contain a null pointer.
Get the Transformation3d object for the given UUID. The returned reference counting pointer may contain a null pointer.
- transformationById()¶
Get the edge (transformation) with given ID
- type()¶
- updateIds()¶
Update the internal UUIDs cache. Needs to be done after changes in elements UUIDs or insertion / deletions
- class TrilinearFfd(*args)¶
Bases:
FfdTransformation
FFD vector field deformation transform
Free Form Deformation is the registration technique used to build the vector fields. This class is dedicated to the application of the vector field deformation to transform coordinates.
This is a variant of SplineFfd which is performing trilinear interpolation between displacement vectors. See SplineFfd for details.
- transformDouble()¶
- transformFloat()¶
- transformPoint3d()¶
- transformPoint3dd()¶
- transformPoint3df()¶
- class VertexRemover¶
Bases:
wrapper
A class to remove a vertex from a mesh, and remeshing the hole.
NB: remeshing is not always possible, therefore removing a given point in a mesh is not always possible. Therefore, it may be important to check the return value of operator() to check if the point has actually been removed.
- geometricProperties()¶
- floodFill()¶
- getLinearInterpolator()¶
- getMaskIterator()¶
- getRoiIterator()¶
- giftiColormap()¶
- class knn¶
Bases:
simplewrapper
- mask()¶
- maskWithVolume()¶
- class meshdistance¶
Bases:
simplewrapper
- MeshDilation()¶
- MeshDistance()¶
dist_tex = MeshDistance(mesh, inittex, allowUnreached)
inittex values have the following meaning:
0: propagation domain n>0: seed (distance 0) -1: forbidden
- MeshErosion()¶
- MeshVoronoi(mesh, inittex, background, forbidden, dist, connexity, object)¶
- MeshVoronoi(mesh, inittex, dist, connexity, object) None
Compute a geodesic voronoi diagram (dist = MAX_FLOAT,object=true ) of objects defined in inittex. The background has the label Back and the objects have a positive label. The distance can be euclidean geodesic (connexity=false) or just the connexity of the triangulation(connexity=true) This function can as well be used for dilation(object=true) / erosion(object=false) using the parameter dist as the size of the structuring element.
- Parameters:
mesh (AimsSurfaceTriangle) –
inittex (TimeTexture_S16) –
background (short) –
forbidden (short) –
dist (float) –
connexity (bool) –
object (bool) –
- Returns:
voronoi_texture
- Return type:
- MeshVoronoiStepbyStep()¶
- textureMax()¶
- transformBoundingBox()¶
- class soma.aims.carto¶
Bases:
simplewrapper
- class AllocatorContext¶
Bases:
wrapper
Allocation context specifications. This object is used when memory must be allocated for large objects (volumes, arrays…), especially for data which will be read from disk. It allows to specify how the memory will be used (read-only, read-write, how much…) to allow to decide whether any memory mapping techniques should be used or not.
- accessMode()¶
- allocatorType()¶
- allowsMemoryMapping()¶
- dataSource()¶
- dataSourceInfo()¶
- isAllocated()¶
- setAccessMode()¶
- setAllowsMemoryMapping()¶
- setDataSource()¶
- setDataSourceInfo()¶
- setUseFactor()¶
- useFactor()¶
- class AllocatorStrategy¶
Bases:
wrapper
Memory management strategy helper. Contains mainly constants and a memory query function.
- CopyMap = 2¶
- class DataAccess¶
Bases:
int
Data access mode
- InternalModif:
random access in memory, disk data (memmapped) should not be overwritten.
- ReadOnly:
read only in memory. Accessing data in write mode may cause a crash.
- ReadWrite:
read/write both in memory and on disk, if memmapped.
- NotOwner:
data is unallocated, or its ownership belongs to a proxy object.
- InternalModif = 0¶
- MAP = 1¶
- MAP_COPY = 2¶
- MAP_RO = 3¶
- MAP_RW = 4¶
- MEM = 0¶
- class MappingMode¶
Bases:
int
Memory mapping modes
- Memory, (MEM):
in-memory allocation
- CopyMap, (MAP, MAP_COPY):
data is copied into a memmaped file (accessed read/write)
- ReadOnlyMap, (MAP_RO):
read-only memory mapping
- ReadWriteMap, (MAP_RW):
read/write memory mapping: modifying the memory also modifies the file on disk.
- Unallocated:
not allocated.
- Memory = 0¶
- NotOwner = 3¶
- ReadOnly = 1¶
- ReadOnlyMap = 3¶
- ReadWrite = 2¶
- ReadWriteMap = 4¶
- Unallocated = 5¶
- allocator()¶
Create an AllocatorContext object with the required mapping mode
- memSizes()¶
Check the current system memory and return the amount of RAM, free RAM, and swap.
- class FormatDictionary_AffineTransformation3d¶
Bases:
wrapper
- readExtensions()¶
- readFormats()¶
- writeExtensions()¶
- writeFormats()¶
- class FormatDictionary_AimsTimeSurface_2_FLOAT¶
Bases:
wrapper
- readExtensions()¶
- readFormats()¶
- writeExtensions()¶
- writeFormats()¶
- class FormatDictionary_AimsTimeSurface_2_POINT2DF¶
Bases:
wrapper
- readExtensions()¶
- readFormats()¶
- writeExtensions()¶
- writeFormats()¶
- class FormatDictionary_AimsTimeSurface_2_VOID¶
Bases:
wrapper
- readExtensions()¶
- readFormats()¶
- writeExtensions()¶
- writeFormats()¶
- class FormatDictionary_AimsTimeSurface_3_FLOAT¶
Bases:
wrapper
- readExtensions()¶
- readFormats()¶
- writeExtensions()¶
- writeFormats()¶
- class FormatDictionary_AimsTimeSurface_3_POINT2DF¶
Bases:
wrapper
- readExtensions()¶
- readFormats()¶
- writeExtensions()¶
- writeFormats()¶
- class FormatDictionary_AimsTimeSurface_3_VOID¶
Bases:
wrapper
- readExtensions()¶
- readFormats()¶
- writeExtensions()¶
- writeFormats()¶
- class FormatDictionary_AimsTimeSurface_4_FLOAT¶
Bases:
wrapper
- readExtensions()¶
- readFormats()¶
- writeExtensions()¶
- writeFormats()¶
- class FormatDictionary_AimsTimeSurface_4_POINT2DF¶
Bases:
wrapper
- readExtensions()¶
- readFormats()¶
- writeExtensions()¶
- writeFormats()¶
- class FormatDictionary_AimsTimeSurface_4_VOID¶
Bases:
wrapper
- readExtensions()¶
- readFormats()¶
- writeExtensions()¶
- writeFormats()¶
- class FormatDictionary_BucketMap_DOUBLE¶
Bases:
wrapper
- readExtensions()¶
- readFormats()¶
- writeExtensions()¶
- writeFormats()¶
- class FormatDictionary_BucketMap_FLOAT¶
Bases:
wrapper
- readExtensions()¶
- readFormats()¶
- writeExtensions()¶
- writeFormats()¶
- class FormatDictionary_BucketMap_S16¶
Bases:
wrapper
- readExtensions()¶
- readFormats()¶
- writeExtensions()¶
- writeFormats()¶
- class FormatDictionary_BucketMap_S32¶
Bases:
wrapper
- readExtensions()¶
- readFormats()¶
- writeExtensions()¶
- writeFormats()¶
- class FormatDictionary_BucketMap_U16¶
Bases:
wrapper
- readExtensions()¶
- readFormats()¶
- writeExtensions()¶
- writeFormats()¶
- class FormatDictionary_BucketMap_U32¶
Bases:
wrapper
- readExtensions()¶
- readFormats()¶
- writeExtensions()¶
- writeFormats()¶
- class FormatDictionary_BucketMap_VOID¶
Bases:
wrapper
- readExtensions()¶
- readFormats()¶
- writeExtensions()¶
- writeFormats()¶
- class FormatDictionary_Graph¶
Bases:
wrapper
- readExtensions()¶
- readFormats()¶
- writeExtensions()¶
- writeFormats()¶
- class FormatDictionary_Hierarchy¶
Bases:
wrapper
- readExtensions()¶
- readFormats()¶
- writeExtensions()¶
- writeFormats()¶
- class FormatDictionary_Object¶
Bases:
wrapper
- readExtensions()¶
- readFormats()¶
- writeExtensions()¶
- writeFormats()¶
- class FormatDictionary_SparseMatrix¶
Bases:
wrapper
- readExtensions()¶
- readFormats()¶
- writeExtensions()¶
- writeFormats()¶
- class FormatDictionary_SparseOrDenseMatrix¶
Bases:
wrapper
- readExtensions()¶
- readFormats()¶
- writeExtensions()¶
- writeFormats()¶
- class FormatDictionary_TimeTexture_DOUBLE¶
Bases:
wrapper
- readExtensions()¶
- readFormats()¶
- writeExtensions()¶
- writeFormats()¶
- class FormatDictionary_TimeTexture_FLOAT¶
Bases:
wrapper
- readExtensions()¶
- readFormats()¶
- writeExtensions()¶
- writeFormats()¶
- class FormatDictionary_TimeTexture_POINT2DF¶
Bases:
wrapper
- readExtensions()¶
- readFormats()¶
- writeExtensions()¶
- writeFormats()¶
- class FormatDictionary_TimeTexture_S16¶
Bases:
wrapper
- readExtensions()¶
- readFormats()¶
- writeExtensions()¶
- writeFormats()¶
- class FormatDictionary_TimeTexture_S32¶
Bases:
wrapper
- readExtensions()¶
- readFormats()¶
- writeExtensions()¶
- writeFormats()¶
- class FormatDictionary_TimeTexture_U16¶
Bases:
wrapper
- readExtensions()¶
- readFormats()¶
- writeExtensions()¶
- writeFormats()¶
- class FormatDictionary_TimeTexture_U32¶
Bases:
wrapper
- readExtensions()¶
- readFormats()¶
- writeExtensions()¶
- writeFormats()¶
- class FormatDictionary_TimeTexture_U8¶
Bases:
wrapper
- readExtensions()¶
- readFormats()¶
- writeExtensions()¶
- writeFormats()¶
- class FormatDictionary_Transformation3d¶
Bases:
wrapper
- readExtensions()¶
- readFormats()¶
- writeExtensions()¶
- writeFormats()¶
- class FormatDictionary_TransformationGraph3d¶
Bases:
wrapper
- readExtensions()¶
- readFormats()¶
- writeExtensions()¶
- writeFormats()¶
- class FormatDictionary_Volume_CDOUBLE¶
Bases:
wrapper
- readExtensions()¶
- readFormats()¶
- writeExtensions()¶
- writeFormats()¶
- class FormatDictionary_Volume_CFLOAT¶
Bases:
wrapper
- readExtensions()¶
- readFormats()¶
- writeExtensions()¶
- writeFormats()¶
- class FormatDictionary_Volume_DOUBLE¶
Bases:
wrapper
- readExtensions()¶
- readFormats()¶
- writeExtensions()¶
- writeFormats()¶
- class FormatDictionary_Volume_FLOAT¶
Bases:
wrapper
- readExtensions()¶
- readFormats()¶
- writeExtensions()¶
- writeFormats()¶
- class FormatDictionary_Volume_HSV¶
Bases:
wrapper
- readExtensions()¶
- readFormats()¶
- writeExtensions()¶
- writeFormats()¶
- class FormatDictionary_Volume_POINT3DF¶
Bases:
wrapper
- readExtensions()¶
- readFormats()¶
- writeExtensions()¶
- writeFormats()¶
- class FormatDictionary_Volume_RGB¶
Bases:
wrapper
- readExtensions()¶
- readFormats()¶
- writeExtensions()¶
- writeFormats()¶
- class FormatDictionary_Volume_RGBA¶
Bases:
wrapper
- readExtensions()¶
- readFormats()¶
- writeExtensions()¶
- writeFormats()¶
- class FormatDictionary_Volume_S16¶
Bases:
wrapper
- readExtensions()¶
- readFormats()¶
- writeExtensions()¶
- writeFormats()¶
- class FormatDictionary_Volume_S32¶
Bases:
wrapper
- readExtensions()¶
- readFormats()¶
- writeExtensions()¶
- writeFormats()¶
- class FormatDictionary_Volume_U16¶
Bases:
wrapper
- readExtensions()¶
- readFormats()¶
- writeExtensions()¶
- writeFormats()¶
- class FormatDictionary_Volume_U32¶
Bases:
wrapper
- readExtensions()¶
- readFormats()¶
- writeExtensions()¶
- writeFormats()¶
- class FormatDictionary_Volume_U8¶
Bases:
wrapper
- readExtensions()¶
- readFormats()¶
- writeExtensions()¶
- writeFormats()¶
- class GenericObject(*args, **kwargs)¶
Bases:
RCObject
Generic dynamic polymorphic object.
GenericObject should not be used directly, but rather through the
soma.aims.Object
proxy.See
soma.aims.Object
for a complete documentation.- append()¶
- currentValue()¶
- get()¶
- getScalar()¶
- getString()¶
- getSyntax()¶
- hasSyntax()¶
- has_key()¶
- index()¶
- intKey()¶
- isArray()¶
- isDictionary()¶
- isDictionaryIterator()¶
- isDynArray()¶
- isIterable()¶
- isIterator()¶
- isNone()¶
- isScalar()¶
- isString()¶
- isValid()¶
- items()¶
- iteritems()¶
- iterkeys()¶
- itervalues()¶
- key()¶
- keys()¶
- objectIterator()¶
- setSyntax()¶
- size()¶
- type()¶
- update(x)¶
- values()¶
- class IOObjectTypesDictionary¶
Bases:
wrapper
- hasReadType()¶
- hasWriteType()¶
- readTypes()¶
- writeTypes()¶
- class Info¶
Bases:
wrapper
Information class, which provides information about the AIMS / Cartobase libraries, such as libraries versions, plugins, data paths, etc.
May be used in 2 ways: * use static methods: Info.printVersions(), Info.printInfos() to directly output info on the standard output * get a list of Info objects using Info.infos() then use the specific methods on the Info objects. There may be several Info objects since higher-level libraries and applications may add their own ones.
- infos()¶
Static method. Get a list of Info objects, each library may provide one (or several).
- printBuiltins()¶
Print on the standard output buitin optional features, selected when the library has been built.
- printInfos()¶
Static method. Print all information on the standard output.
- printOtherInfo()¶
Print on the standard output additional information (such as IO properties, settings options, etc).
- printPaths()¶
Print on the standard output configured data paths.
- printVersion()¶
Print on the standard output the library version.
- printVersions()¶
Static method. Print versions of libraries
- class Object¶
Bases:
rc_ptr_GenericObject
Generic dynamic polymorphic object proxy.
Object is a proxy and a reference counter to a GenericObject. In most cases, Object and GenericObject are interchangeable and play the same role, there are two objects for technical reasons in the C++ layer, but in Python it whould make no difference.
The C++ generic object is an implementation of a mutable dynamic container which can hold any type of concrete data, with a generic access API which abstracts the concrete type of the object stored within it.
According to the underlying object type, Object can behave like a number, a string, or a container: sequence or dictionary. The python bindings can therefore support the sequence protocol, or the dictionary protocol, like a ‘real’ python object.
The only part which makes it visibly different from a python object is the conversions with stored objects, which are generally C++ objects (but can also be any python objects). Transparent conversions are done when possible.
We will take an example to show how to use it: a volume header. Suppose the files volume.img/volume.hdr[/volume.img.minf] represent a 3D volume (a MRI volume, typically, here in Analyze/SPM or Nifti format). We will read it using aims, and access its header data, which comes as a generic object.
>>> from __future__ import print_function # work using python 2 or 3 >>> from soma import aims >>> vol = aims.read('volume.img') >>> hdr = vol.header()
Now
vol
is the volume, andhdr
its header, of typeObject
.>>> type(hdr) <class 'soma.aims.Object'> >>> print(hdr) { 'voxel_size' : [ 1.875, 1.875, 4, 1 ], 'file_type' : 'SPM', 'byte_swapping' : 0, 'volume_dimension' : [ 128, 128, 16, 1 ], 'vox_units' : 'mm ', 'cal_units' : '', 'data_type' : 'S16', 'disk_data_type' : 'S16', 'bits_allocated' : 2, 'tr' : 1, 'minimum' : 0, 'maximum' : 13645, 'scale_factor' : 1, 'scale_factor_applied' : 0, 'db_name' : '', 'aux_file' : '', 'orient' : 3, 'generated' : '', 'scannum' : '', 'patient_id' : '', 'exp_date' : '', 'exp_time' : '', 'views' : 0, 'start_field' : 32768, 'field_skip' : 8192, 'omax' : 0, 'omin' : 0, 'smax' : 32, 'smin' : 0, 'SPM_data_type' : '', 'possible_data_types' : [ 'S16' ], 'spm_radio_convention' : 1, 'spm_origin' : [ 65, 65, 9 ], 'origin' : [ 64, 63, 7 ] }
hdr
prints like a dictionary, but is not really a python dictionary object. However it behaves like a dictionary:>>> print(hdr['voxel_size']) [ 1.875, 1.875, 4, 1 ] >>> print(hdr['data_type']) S16 >>> print(hdr['voxel_size'][0]) 1.875 >>> for x in hdr: >>> print(x) >>> voxel_size file_type byte_swapping volume_dimension vox_units cal_units data_type disk_data_type bits_allocated tr minimum maximum scale_factor scale_factor_applied db_name aux_file orient generated scannum patient_id exp_date exp_time views start_field field_skip omax omin smax smin SPM_data_type possible_data_types spm_radio_convention spm_origin origin >>> for x,y in hdr.items(): >>> print(x, ':', y) >>> voxel_size : [ 1.875, 1.875, 4, 1 ] file_type : 'SPM' byte_swapping : 0 volume_dimension : [ 128, 128, 16, 1 ] vox_units : 'mm ' cal_units : '' data_type : 'S16' disk_data_type : 'S16' bits_allocated : 2 tr : 1 minimum : 0 maximum : 13645 scale_factor : 1 scale_factor_applied : 0 db_name : '' aux_file : '' orient : 3 generated : '' scannum : '' patient_id : '' exp_date : '' exp_time : '' views : 0 start_field : 32768 field_skip : 8192 omax : 0 omin : 0 smax : 32 smin : 0 SPM_data_type : '' possible_data_types : [ 'S16' ] spm_radio_convention : 1 spm_origin : [ 65, 65, 9 ] origin : [ 64, 63, 7 ]
Elements returned by the dictionary queries can have various types, althrough they are all stored internally in a C++ structure through
soma.aims.Object
wrappers. But when the underlying type of the element is known and can be retreived as a python object (either a standard python type or a python binding of a C++ class), it is done automatically. Such conversion is not possible when the underlying object has no python binding and is a pure C++ object, or when there is no conversion function. In this case, an Object is returned and contains the selected data.Conversions are done using conversion methods that you generally do not need to call by hand: getScalar(), getString(), or the more general conversion method
soma.aims.Object.getPython()
. Elements types that cannot be converted to python concrete types are retreived in their Object container.The generic conversion function in
Object
:getPython
, is a static method and can be extended.Elements in
Object
containers can generally be read and written:>>> hdr['data_type'] = 'FLOAT' >>> hdr['data_type'] 'FLOAT'
This generally suits your needs. But in a few cases there will be a problem in internal types handling in the C++ layer.
Here, the underlying C++ generic object which did hold a C++ string (
std::string
)'S16'
is now replaced by another generic object built from the python string'FLOAT'
, and which now wraps an element of typePyObject
(orPyString
). It just behaves the same way, so this operation is perfectly valid, but if C++ programs expect it to be a C++std::string
, they may fail.Moreover, when writing back to existing concrete objects, some additional conversions may take place: for instance
hdr['voxel_size']
is a C++ object of typestd::vector<float>
, so writing tohdr['voxel_size'][0]
needs to enure we are actually writing afloat
, and if not, convert to it if possible.You can query a type identifier for a generic object via the
type()
method:>>> hdr.type() 'PropertySet'
Objects that can be converted from C++ generic objects to python are not necessarily known in advance. A conversion table is kept in the global variable
soma.aims.convertersObjectToPython
(in the aims module) and can be extended. Therefore other python modules using aims (such as sigraph) can extend this conversion table.Details and tricks
There are some limitations and “unexpected behaviours” caused by the underlying C++ implementation of generic objects, and general behaviour differences between Python and C++. The following is expert-level details, so read it only if you have problems or you are a C++ expert with good knowledge of the cartobase C++ library…
Generic object - specialized object conversions
Putting a specific object in a generic Object makes a copy of it the first time it is done, because C++ generic objects contain the specialized elements. Once this has been done once, generic objects are shared and not copied anymore, which is consistent with the normal python behaviour. The non-pythonic thing is the first insertion in a generic object:
>>> a = aims.vector_FLOAT([12.6, -5.7]) >>> print(a) [ 12.6, -5.7 ] >>> hdr['foo'] = a # here a is copied into hdr['foo'] >>> a.append( 6.8 ) # a is changed but not hdr >>> print(a) [ 12.6, -5.7, 6.8 ] >>> print(hdr['foo']) [ 12.6, -5.7 ] >>> hdr['dummy'] = hdr['foo'] >>> hdr['foo'].append(4.2) >>> print(hdr['dummy']) # this time hdr['dummy'] is changed [ 12.6, -5.7, 4.2 ]
To overcome the first copy problem, you may have to reassign the initial variable to the copy instance:
>>> a = aims.vector_FLOAT([1.2, 2.3, 3.4]) >>> hdr['foo'] = a >>> a = hdr['foo'] >>> print(hdr['foo']) [ 1.2, 2.3, 3.4 ] >>> a[1] = 12.8 >>> print(a) [ 1.2, 12.8, 3.4 ] >>> print(hdr['foo']) [ 1.2, 12.8, 3.4 ]
There are exceptions to this behaviour:
pure python objects, like lists or dictionaries are never copied since it is only a pointer to them (the C PyObject * pointer) which is stored.
small builtin types: numbers and strings are always copied since they are always converted and copied, not wrapped, when passed from python to C++ and vice versa.
The get() method
On
Object
theget
method is ambiguous and has 2 meanings:get() without arguments is a wrapping to the C++
rc_ptr::get()
which returns the underlying wrapped object (here, aGenericObject
)get(key, default=None) is the dict-like method that is available on
GenericObject
since aims 4.6.1.
Depending on the arguments the Object method will redirect to the right one, thus:
myobject.get() # gets the GenericObject myobject.get('key') # gets the dict item under keyt 'key' myobject.get().get('key') # does both, but this is what the previous line # already does, so the result is the same
To avoid this ambiguity,
Object.get()
andrc_ptr.get()
have been renamed_get()
years ago (in aims 4.0 I think) butget()
is still present for compatibility. This use (without argument) is obsolete and may be removed in the future.- getPython()¶
Conversion to python types: extracts what is in the Object (when possible). The global dictionary
soma.aims.convertersObjectToPython
stores converters
- isNone()¶
- static ptrToObject(x)¶
- static rcToObject(x)¶
- static toObject(x)¶
- class Paths¶
Bases:
simplewrapper
- findResourceFile()¶
- findResourceFiles()¶
- home()¶
- memmap()¶
- resourceSearchPath()¶
- tempDir()¶
- class PropertySet¶
Bases:
wrapper
- clearProperties()¶
- copyBuiltinProperties()¶
- getProperty()¶
- hasProperty()¶
- objectIterator()¶
- removeProperty()¶
- setProperty()¶
- size()¶
- PyObjectfromObject()¶
- class RCObject(*args)¶
Bases:
wrapper
Bases:
RCObject
- debugMessageLevel()¶
- class fdinhibitor(fd, permanent=False)¶
Bases:
wrapper
fd: file descriptor to inhibit, permanent: if false, don’t reopen the stream when deleting the fdinhibitor
usage: from soma import aims fdi = aims.carto.fdinhibitor(sys.stderr.fileno()) fdi.close() # call a function which prints something on stderr which we don’t want to # appear fdi.open() sys.stderr.write(‘after reopenn’) # works again
Temporarily closes a file descriptor (typically, stdout/stderr). Currently, this low-level implementation doesn’t work with all C++ streams: on some systems C++ streams stay in a bad state afterwards and are silent forever. Standard IO streams (cin, cout, cerr) are checked and protected against this problem.
- class ResetCallback¶
Bases:
wrapper
- close()¶
- hasResetCallback()¶
- notify()¶
- open()¶
- registerResetCallback()¶
- unregisterResetCallback()¶
- none()¶
Returns a null aims.Object
- class rc_ptr_MaskIterator¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- class rc_ptr_RoiIterator¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- setDebugMessageLevel()¶
- setOrientationInformation(header, orient)¶
force or alter a specific voxels orientation on disk (if the output format supports it), by changing the internal “storage_to_memory” matrix, in a more or less convenient way, with different syntaxes:
“flipx yflip”: flips orientations of x and y axes.
-“neuro”, “neurological” or “left-to-right”: force neuro orientation. - “radio”, “radiological” or “right-to-left”: force radio orientation. - “-1 1 -1”: set a flip matrix flipping x and z axes (set the diagonal). - “-1 0 0 0 1 0 0 0 -1”: same by specifying the full rotation matrix. - “-1 0 0 255 0 1 0 0 0 0 -1 123 0 0 0 1”: same by specifying
the full 4x4 matrix.
By default, all orientation matrices are applied relatively to the current voxels orientation. To set absolute matrices (from the AIMS conventional orientation), specify “abs:” before the matrix. Ex:
“abs: -1 1 -1”
“abs: -1 0 0 255 0 1 0 0 0 0 -1 123 0 0 0 1”
- setVerbose()¶
- verbose()¶
- soma.aims.convertersObjectToPython = {'POINT2DF': <built-in function fromObject>, 'POINT3DF': <built-in function fromObject>, 'POINT4DF': <built-in function fromObject>, 'PyObject': <built-in function PyObjectfromObject>, 'S16': <built-in function asInt>, 'S32': <built-in function asInt>, 'U16': <built-in function asInt>, 'U32': <built-in function asInt>, 'boolean': <built-in function asBool>, 'rc_ptr of Mesh of FLOAT': <built-in function fromObject>, 'rc_ptr of Mesh of POINT2DF': <built-in function fromObject>, 'rc_ptr of Mesh of VOID': <built-in function fromObject>, 'rc_ptr of Mesh4 of FLOAT': <built-in function fromObject>, 'rc_ptr of Mesh4 of POINT2DF': <built-in function fromObject>, 'rc_ptr of Mesh4 of VOID': <built-in function fromObject>, 'rc_ptr of Segments of FLOAT': <built-in function fromObject>, 'rc_ptr of Segments of POINT2DF': <built-in function fromObject>, 'rc_ptr of Segments of VOID': <built-in function fromObject>, 'rc_ptr of Transformation3d': <built-in function fromObject>, 'rc_ptr of bucket of DOUBLE': <built-in function fromObject>, 'rc_ptr of bucket of FLOAT': <built-in function fromObject>, 'rc_ptr of bucket of S16': <built-in function fromObject>, 'rc_ptr of bucket of S32': <built-in function fromObject>, 'rc_ptr of bucket of U16': <built-in function fromObject>, 'rc_ptr of bucket of U32': <built-in function fromObject>, 'rc_ptr of bucket of VOID': <built-in function fromObject>, 'rc_ptr of mesh of VOID': <built-in function fromObject>, 'rc_ptr of texture of FLOAT': <built-in function fromObject>, 'rc_ptr of texture of POINT2DF': <built-in function fromObject>, 'rc_ptr of texture of S16': <built-in function fromObject>, 'rc_ptr of texture of S32': <built-in function fromObject>, 'rc_ptr of texture of U32': <built-in function fromObject>, 'string': <function <lambda>>}¶
Conversion function map. These converters are used to convert between a C++ object inside a generic object to their Python equivalent. They are typically used when accessing a sub-object:
>>> from soma import aims >>> v = aims.Object(aims.vector_STRING()) >>> v.append('toto') >>> v.append('bubu') >>> type(v) soma.aims.Object >>> v.type() 'vector of string' >>> v[0] 'toto' >>> type(v[0]) str
In this example, v contains a C++ object of type std::vector<std::string>. Its elements are accessed via a wrapping which is using a C++ generic object (carto::Object). But in python we obtain a str (pyton string): the string has been taken out of the generic object using this conversion map (and then converted automatically to str by the SIP tool).
- soma.aims.floodFill()¶
- soma.aims.getLinearInterpolator()¶
- soma.aims.getMaskIterator()¶
- soma.aims.getRoiIterator()¶
- soma.aims.get_transform_to(aims_obj, ref)[source]¶
Get a transformation object in an AIMS object header to the given referential identifier. Objects need to have a header() method following the aims conventions (
referentials
andtransformations
elements beingn lists).- Parameters:
aims_obj (Aims object with a header) – object we want to get the transformation from
ref (str) – target refetential identifier. May be an UUID string, or a known identifier such as “Talairach-MNI template-SPM” (see aims.StandardReferentials attributes)
- Returns:
transform – the transformation object, or None if no matching one is found
- Return type:
- soma.aims.giftiColormap()¶
- class soma.aims.list_AimsTimeSurface_3_VOID¶
Bases:
wrapper
- append()¶
- assign()¶
- index()¶
- list()¶
- remove()¶
- size()¶
- class soma.aims.list_AimsTimeSurface_3_VOID_iterator¶
Bases:
wrapper
- class soma.aims.list_DOUBLE_iterator¶
Bases:
wrapper
- class soma.aims.list_EdgePtr_iterator¶
Bases:
wrapper
- class soma.aims.list_FLOAT_iterator¶
Bases:
wrapper
- class soma.aims.list_GraphPtr¶
Bases:
wrapper
- append()¶
- assign()¶
- index()¶
- list()¶
- remove()¶
- size()¶
- class soma.aims.list_GraphPtr_iterator¶
Bases:
wrapper
- class soma.aims.list_POINT3DF¶
Bases:
wrapper
- append()¶
- assign()¶
- index()¶
- list()¶
- remove()¶
- size()¶
- class soma.aims.list_POINT3DF_iterator¶
Bases:
wrapper
- class soma.aims.list_POINT3D_iterator¶
Bases:
wrapper
- class soma.aims.list_PluginFile¶
Bases:
wrapper
- append()¶
- assign()¶
- index()¶
- list()¶
- remove()¶
- size()¶
- class soma.aims.list_PluginFile_iterator¶
Bases:
wrapper
- class soma.aims.list_S32_iterator¶
Bases:
wrapper
- class soma.aims.list_STRING_iterator¶
Bases:
wrapper
- class soma.aims.list_U32_iterator¶
Bases:
wrapper
- class soma.aims.list_rc_ptr_Graph¶
Bases:
wrapper
- append()¶
- assign()¶
- index()¶
- list()¶
- remove()¶
- size()¶
- class soma.aims.list_rc_ptr_Graph_iterator¶
Bases:
wrapper
- class soma.aims.list_vector_POINT3DF¶
Bases:
wrapper
- append()¶
- assign()¶
- index()¶
- list()¶
- remove()¶
- size()¶
- class soma.aims.list_vector_POINT3DF_iterator¶
Bases:
wrapper
- class soma.aims.list_vector_STRING¶
Bases:
wrapper
- append()¶
- assign()¶
- index()¶
- list()¶
- remove()¶
- size()¶
- class soma.aims.list_vector_STRING_iterator¶
Bases:
wrapper
- soma.aims.mask()¶
- soma.aims.maskWithVolume()¶
- class soma.aims.pyaims¶
Bases:
simplewrapper
- class DebuggingVolume(*args)¶
Bases:
Volume_S16
- created = False¶
- deleted = False¶
- class soma.aims.range(stop)¶
- class soma.aims.range(start, stop[, step]) range object
Bases:
object
Return an object that produces a sequence of integers from start (inclusive) to stop (exclusive) by step. range(i, j) produces i, i+1, i+2, …, j-1. start defaults to 0, and stop is omitted! range(4) produces 0, 1, 2, 3. These are exactly the valid indices for a list of 4 elements. When step is given, it specifies the increment (or decrement).
- count(value) integer -- return number of occurrences of value ¶
- index(value) integer -- return index of value. ¶
Raise ValueError if the value is not present.
- start¶
- step¶
- stop¶
- soma.aims.rc_ptr(*args, **kwargs)[source]¶
Create an instance of aims reference-counting object (rc_ptr_<type>) from a type parameter, which may be specified as the dtype keyword argument, or as one of the arguments if one is identitied as a type.
Type definitions should match those accepted by typeCode().
- class soma.aims.rc_ptr_AffineTransformation3d¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- soma.aims.rc_ptr_AimsTimeSurface_2¶
alias of
rc_ptr_AimsTimeSurface_2_VOID
- class soma.aims.rc_ptr_AimsTimeSurface_2_FLOAT¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- class soma.aims.rc_ptr_AimsTimeSurface_2_POINT2DF¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- class soma.aims.rc_ptr_AimsTimeSurface_2_VOID¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- soma.aims.rc_ptr_AimsTimeSurface_3¶
alias of
rc_ptr_AimsTimeSurface_3_VOID
- class soma.aims.rc_ptr_AimsTimeSurface_3_FLOAT¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- class soma.aims.rc_ptr_AimsTimeSurface_3_POINT2DF¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- class soma.aims.rc_ptr_AimsTimeSurface_3_VOID¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- soma.aims.rc_ptr_AimsTimeSurface_4¶
alias of
rc_ptr_AimsTimeSurface_4_VOID
- class soma.aims.rc_ptr_AimsTimeSurface_4_FLOAT¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- class soma.aims.rc_ptr_AimsTimeSurface_4_POINT2DF¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- class soma.aims.rc_ptr_AimsTimeSurface_4_VOID¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- class soma.aims.rc_ptr_BucketMap_DOUBLE¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- class soma.aims.rc_ptr_BucketMap_FLOAT¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- class soma.aims.rc_ptr_BucketMap_S16¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- class soma.aims.rc_ptr_BucketMap_S32¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- class soma.aims.rc_ptr_BucketMap_U16¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- class soma.aims.rc_ptr_BucketMap_U32¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- class soma.aims.rc_ptr_BucketMap_VOID¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- class soma.aims.rc_ptr_DataSource¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- class soma.aims.rc_ptr_DataSourceInfo¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- class soma.aims.rc_ptr_Edge¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- class soma.aims.rc_ptr_GenericObject¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- class soma.aims.rc_ptr_Graph¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- class soma.aims.rc_ptr_Interpolator¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- class soma.aims.rc_ptr_Site¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- class soma.aims.rc_ptr_SiteIterator¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- class soma.aims.rc_ptr_SparseMatrix¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- class soma.aims.rc_ptr_SparseOrDenseMatrix¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- class soma.aims.rc_ptr_TimeTexture_DOUBLE¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- class soma.aims.rc_ptr_TimeTexture_FLOAT¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- class soma.aims.rc_ptr_TimeTexture_POINT2DF¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- class soma.aims.rc_ptr_TimeTexture_S16¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- class soma.aims.rc_ptr_TimeTexture_S32¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- class soma.aims.rc_ptr_TimeTexture_U16¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- class soma.aims.rc_ptr_TimeTexture_U32¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- class soma.aims.rc_ptr_TimeTexture_U8¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- class soma.aims.rc_ptr_Transformation3d¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- class soma.aims.rc_ptr_Tree¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- class soma.aims.rc_ptr_Vertex¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- class soma.aims.rc_ptr_Volume_BOOL¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- class soma.aims.rc_ptr_Volume_CDOUBLE¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- class soma.aims.rc_ptr_Volume_CFLOAT¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- class soma.aims.rc_ptr_Volume_DOUBLE¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- class soma.aims.rc_ptr_Volume_FLOAT¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- class soma.aims.rc_ptr_Volume_HSV¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- class soma.aims.rc_ptr_Volume_POINT3DF¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- class soma.aims.rc_ptr_Volume_RGB¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- class soma.aims.rc_ptr_Volume_RGBA¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- class soma.aims.rc_ptr_Volume_S16¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- class soma.aims.rc_ptr_Volume_S32¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- class soma.aims.rc_ptr_Volume_U16¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- class soma.aims.rc_ptr_Volume_U32¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- class soma.aims.rc_ptr_Volume_U8¶
Bases:
wrapper
- get(*args, **kwargs)¶
get() is ambiguous: rc_ptr / Object has the get() method, providing access to the underlying object. GenericObject has the method get(key, default=None) as a dictionary-like object. This proxy calls the right one depending on arguments.
- isNull()¶
- release()¶
- reset()¶
- soma.aims.read(filename, border=0, frame=-1, dtype=None, allocmode=None, options=None, object=None)[source]¶
Equivalent to:
r = Reader(allocmode=allocmode, options=options) return r.read(filename, border=border, frame=frame, dtype=dtype, object=object)
Ex:
read a volume:
vol = aims.read('file.nii')
read a mesh:
mesh = aims.read('file.gii')
read part of a volume, with borders (warning, all formats do not allow it):
vol = aims.read( 'file.nii', options={'border': 2, 'ox': 100, 'sx': 100, 'oy': 50, 'sy': 150, 'oz': 20, 'sz': 60})
or (equivalent):
vol = aims.read( 'file.nii?border=2&ox=100&sx=100&oy=50&sy=150&oz=20&sz=60')
read a view inside a larger volume (warning, all formats do not allow it, and they may produce inpredictible results, and probably crashes):
border = aims.Volume_S16(500, 500, 200) view = aims.VolumeView(border, [50, 50, 50], [256, 256, 124]) aims.read('file.nii', object=view, options={'keep_allocation': True})
- soma.aims.readSpmNormalization(matfilename, source=None, destref=None, srcref=None)[source]¶
Read a SPM *_sn.mat normalization file and converts it to an Aims AffineTransformation3d. The converted transformation has for source the AIMS referential of the source image, and for destination the template referential of the SPM .mat file. All coordinates are in millimeters.
The source image information may be provided either as its filename, its header object, or the image itself. It should carry the needed information: source volume storage_to_memory transformation matrix, voxel_size, etc. If None is passed as source (the default), then the source image name will be built from the .mat filename and will be read if found.
matfilename: string
file name of the *_sn.mat normalization file to reading
source: filename (string), or Volume
Volume
, or volume header (MappingType)file name of the *_sn.mat normalization file to reading
destref: string or UUID (
Uuid
)destination referential for the transformation. If not specified, none will be set. If provided as a symbolic name (‘Talairach-MNI template-SPM’), it will be converted to an UUID string.
srcref: string or UUID
source referential for the transformation. If not specified, an attempt will be made to take it from the source image, otherwise it will not be set. If provided as a symbolic name (‘Talairach-MNI template-SPM’), it will be converted to an UUID string.
returns:
AffineTransformation3d
objectthe converted transformation
- class soma.aims.set_DOUBLE_iterator¶
Bases:
wrapper
- class soma.aims.set_EdgePtr_iterator¶
Bases:
wrapper
- class soma.aims.set_FLOAT_iterator¶
Bases:
wrapper
- class soma.aims.set_S16_iterator¶
Bases:
wrapper
- class soma.aims.set_S32_iterator¶
Bases:
wrapper
- class soma.aims.set_STRING_iterator¶
Bases:
wrapper
- class soma.aims.set_U32_iterator¶
Bases:
wrapper
- class soma.aims.set_VertexPtr_iterator¶
Bases:
wrapper
- class soma.aims.soma¶
Bases:
simplewrapper
- class DataSource(*args)¶
Bases:
RCObject
Abstraction layer for various data sources (file, buffer, socket…).
It can be seen as a stream, and is inspired by the QIODevice of Qt library.
Abstract class.
- DirectAccess = 1¶
- Read = 1¶
- ReadWrite = 3¶
- SequentialAccess = 2¶
- Write = 2¶
- allowsMemoryMapping()¶
returns True if memory mapping is allowed on this kind of stream
- at()¶
offset = at()
returns the current position in the stream
bool at(pos)
Sets the current position in the stream (when supported). Returns True if successful.
- atEnd()¶
True if the current position is at the end of the stream
- clone()¶
duplicate the DataSource object
- close()¶
Close the stream
- eof()¶
when the end of stream is reached
- flush()¶
flush the stream for buffered output
- getch()¶
read one char and returns it
- isOpen()¶
tells if the stream is open / ok.
- iterateMode()¶
bitwise combination of possible access: direct (1) or sequential (2) access
- mode()¶
access mode(s) (read/write): bitwise OR of Mode values
- none()¶
An empty ref-counter that is more convenient than calling a constructor of rc_ptr_DataSource (useful when calling functions)
- open(mode)¶
Opens the stream (when supported) in the specified Mode
- readBlock(data, maxlen)¶
- Parameters:
data (char*) – read buffer (C++)
maxlen (unsigned long int) – number of bytes to read
- Returns:
num – number of bytes actually read
- Return type:
long int
- reset()¶
reset the stream and get to the start
- size()¶
size (or len) of the data inn stream, in bytes
- ungetch(ch)¶
un-read one char: put it back in the read buffer, and rewind one char
- url()¶
URL of filename for the stream, when available
- writeBlock(data, len)¶
- Parameters:
data (const char * (C++)) – buffer to be written
len (unsigned long int) – size of the buffer to be written
- Returns:
num – number of bytes actually written
- Return type:
long int
- class DataSourceInfo¶
Bases:
wrapper
- DataSourceInfo(ds, dim=[]):
Build a DataSourceInfo from a DataSource, and dimensions
DSList is set as containing only ds pointed by “default” key. Capabilities are set uninitialized. If dim is given, a header is built with keys size[X,Y,Z,T]. Else the header is none().
- DataSourceInfo(ds, header):
Build a DataSourceInfo from a DataSource and an existing header
- DataSourceInfo(fname):
Builds a DataSourceInfo from a filename
- Parameters:
ds (rc_ptr_DataSource) –
dim (vector_S32) – dimensions (for a volume), up to 4 dimensions
header (Object) –
fname (string) –
Informative object used by IO system
This object is used by FormatChecker, FormatReader or FormatWriter to describe a DataSource. It contains a DataSourceList which contains at first a single default DataSource, a Object header and a DataSourceCapabilities.
The list is built by a FormatChecker and contains all the files involved in the reading/writing process (header, data, …)
The header is built by a FormatChecker and contains meta information.
The DSC contains properties dependant of the format, the specific file, the reading process (partial reading), etc.
It is possible to fix some or all of these three objects so that they are not recomputed by the FormatChecker.
see DataSourceInfoLoader DataSourceList DataSourceCapabilities
- header()¶
get the header dict of the underlying data
- identifiedFormat()¶
file format name
- list()¶
get the DataSourceList of the underlying data
- setIdentifiedFormat(format)¶
force the identified format name
- url()¶
main filename or URL
- class DataSourceInfoLoader¶
Bases:
wrapper
Generic information retreiver / checker for all data sources and file formats
It replaces aims.Finder.
DataSourceInfoLoader provides a plug-in system for new formats and data types. Formats are hidden in the plugins and should never be accessed directly.
Usage: check() the DataSourceInfo and then process according to the object type (“Volume of S16”, “Mesh”, “Texture”, “Bucket”, …).
Use the generic Reader once the data type is known, the right format will be selected automatically.
Avoiding manually switching on objects and data types is possible using the ReaderAlgorithm interface and presumably, template functions.
Here is an example of how to use the DataSourceInfoLoader class:
from soma import aims from soma.aims import soma f = soma.DataSourceInfoLoader() info = f.check("toto.nii") if not info.header(): print "could not load", info.url() else: object_type = info.header()["object_type"] if object_type == aims.typeCode(aims.Volume_S16): vr = soma.Reader_Volume_S16(info) try: vol = vr.read() print "volume read" except: print "Error loading", info.url() elif object_type == aims.typeCode(aims.Object): # do your thing print "Object" else: print info.url(), "is of type", object_type, \ "which is not handled"
see DataSourceInfo, Reader, ReaderAlgorithm
- Error = 2¶
- Ok = 1¶
- Unchecked = 0¶
- check(dsi, options=aims.carto.none(), passbegin=1, passend=3)¶
Finds the right format checker
It is possible to specify wich passes to process through passbegin and passend. * pass 1: extension * pass 2: empty extension * pass 3: all writers see DataSourceInfo DataSourceList DataSourceCapabilities
- Parameters:
dsi (DataSourceInfo containing header, DSlist and .) – capabilities. It allows us to have none, some or all information already computed. It is for the DSIloader to deal with the all case, and for the FormatCheckers to deal with some and none cases.
options (A dictionary containing options. They may not be of) – any use to the checker, but soma are (resolution_level).
- Returns:
A DataSourceInfo object containing a header, a list of
DataSource and a list of Capabilities.
- errorMessage()¶
error message from the last check
- extensions(format)¶
Query supported file extensions for a format
- Parameters:
format (string) – format to query
- Returns:
exts – set of extensions names
- Return type:
- launchException()¶
raise the read exception which was most probably the cause of a check() failure
- readMinf(ds, base=aims.none(), options=aims.none())¶
read a .minf file dictionary
- Parameters:
ds (DataSource) – minf file DataSource
base (Object) – base dict to be completed by .minf information
options (Object) – options dict
- Returns:
minf – the minf file contents as a dictionary
- Return type:
- state()¶
state of the DataSourceInfoLoader reading trial
- class DataSourceList¶
Bases:
wrapper
- DataSourceList():
Builds a map containing only (“default”, empty pointer)
- DataSourceList(ds, type=”default”):
Builds a 1-element map This allows to construct easily a 1 element list, useful when declaring a Reader which creator takes a source as parameter.
- Parameters:
ds (rc_ptr_DataSource) – Element to insert
type (string) – Category of the source. default key is “default”: used at Reader construction
This class allows to manipulate “lists” of pointers to DataSource.
It has the design of a dictionary in order to sort sources by content (header, minf, data, …). Since those contents depend on the format, the keywords used are defined by specific checkers and readers.
see FormatChecker FormatReader
The only global keyword is “default” which is used to store the DataSource defining (at construction) a reader.
see Reader
Note
The “default” keyword always contains at least one entry, which may be empty. I haven’t for now found any use to several “default” entries.
Access to a source is done using dataSource(…) methods. Sources are ordered by increasing order of insertion and numbering starts at 0.
- addDataSource(key, ds)¶
Adds an element to the dictionary If new keyword, creates it.
- Parameters:
key (string) – keyword
ds (rc_ptr_DataSource) – DataSource to be added
- dataSource()¶
datasource(key=”default”, i=0)
Accessing an element of the list If keyword doesn’t exist, or is empty, or coordinate is undefined, launches exception.
- Parameters:
key (string (optional)) – keyword
i (int (optional)) – number of the element in list. Numbering starts at 0
- empty()¶
Returns true only if no keyword inserted.
Warning
May return false while no DataSource present
True if there is no key in the dictionary
- exists(key)¶
True if the key exists in the dictionary
- reset()¶
clear the dictionary: all keys and contents are removed.
- size(key)¶
number of elements with the key key
- typecount()¶
number of keys in the types dictionary
- types()¶
Returns existing keywords.
Warning
There may be existing keywords with no DataSource
- class FDDataSource(*args)¶
Bases:
DataSource
DataSource specialization for file descriptor stream
- allowsMemoryMapping()¶
returns True if memory mapping is allowed on this kind of stream
- at()¶
offset = at()
returns the current position in the stream
bool at(pos)
Sets the current position in the stream (when supported). Returns True if successful.
- clone()¶
duplicate the DataSource object
- close()¶
Close the stream
- descriptor()¶
get the file descriptor
- getch()¶
read one char and returns it
- isFile()¶
True if the DataSource is a file
- isOpen()¶
tells if the stream is open / ok.
- iterateMode()¶
bitwise combination of possible access: direct (1) or sequential (2) access
- open(mode)¶
Opens the stream (when supported) in the specified Mode
- readBlock(data, maxlen)¶
- Parameters:
data (char*) – read buffer (C++)
maxlen (unsigned long int) – number of bytes to read
- Returns:
num – number of bytes actually read
- Return type:
long int
- setDescriptor(fd)¶
Set the file descriptor fd (int)
- size()¶
size (or len) of the data inn stream, in bytes
- ungetch(ch)¶
un-read one char: put it back in the read buffer, and rewind one char
- writeBlock(data, len)¶
- Parameters:
data (const char * (C++)) – buffer to be written
len (unsigned long int) – size of the buffer to be written
- Returns:
num – number of bytes actually written
- Return type:
long int
- class FileDataSource(filename, offset=0, mode=aims.soma.DataSource.Read)¶
Bases:
DataSource
- Parameters:
filename (string) – file name on the filesystem
offset (soma.offset_t (optional)) – offset to start reading in the file
mode (aims.soma.DataSource.Mode (optional)) – read / write mode
DataSource specialization for a file.
- allowsMemoryMapping()¶
returns True if memory mapping is allowed on this kind of stream
- at()¶
offset = at()
returns the current position in the stream
bool at(pos)
Sets the current position in the stream (when supported). Returns True if successful.
- clone()¶
duplicate the DataSource object
- close()¶
Close the stream
- getch()¶
read one char and returns it
- initialOffset()¶
initial offset in the input file to start reading
- isOpen()¶
tells if the stream is open / ok.
- iterateMode()¶
bitwise combination of possible access: direct (1) or sequential (2) access
- open(mode)¶
Opens the stream (when supported) in the specified Mode
- readBlock(data, maxlen)¶
- Parameters:
data (char*) – read buffer (C++)
maxlen (unsigned long int) – number of bytes to read
- Returns:
num – number of bytes actually read
- Return type:
long int
- size()¶
size (or len) of the data inn stream, in bytes
- ungetch(ch)¶
un-read one char: put it back in the read buffer, and rewind one char
- url()¶
file name or URL of the file
- writeBlock(data, len)¶
- Parameters:
data (const char * (C++)) – buffer to be written
len (unsigned long int) – size of the buffer to be written
- Returns:
num – number of bytes actually written
- Return type:
long int
- class Reader_Object¶
Bases:
wrapper
Soma-IO Reader class. This is a C++ template class, which can read a specific type of data. All supported formats can be read.
Constructor parameters may be:
string: filename
rc_ptr_DataSource: generic DataSource
rc_ptr_DataSourceInfo: DataSource with info (more optimal when the data source has been identified and the header loaded)
- allocatorContext()¶
Get the allocation context
- attach(ds)¶
Attach a DataSource to read from (rc_ptr_DataSource)
attach(filename, offset=0)
Attach a new filename + offset for reading
- close()¶
Close the data source stream
- dataSource()¶
Get the data source (rc_ptr_DataSource)
- dataSourceInfo()¶
Get the dataSourceInfo, providing information on the read data
- flush()¶
Flush the read buffer
- options()¶
Get reading options (Object dictionary)
- read()¶
Read an object from source. Two main modes exist:
full: read a full new object and return it
in-place: read an existing object, in-place
A multi-pass procedure is used to identify and read the data from the data source:
pass 1: format hint
pass 2: extension
pass 3: empty extension
pass 4: all readers
- Parameters:
header (Object (optional)) – in-place mode: carto::Object, object to be read. OR: full mode: header (Object), optional
header –
passbegin (int (optional)) – begin at given step of the multi-pass identification/read procedure
passend (int (optional)) – end at given step of the multi-pass identification/read procedure
- Returns:
in-place mode – True upon success False upon failure (but readers will more likely throw an exception)
full mode – the read object
- setAllocatorContext(context)¶
Set allocation context for reading
- setOptions(options)¶
set reading options (Object dictionary)
- class Reader_Volume_CDOUBLE¶
Bases:
wrapper
Soma-IO Reader class. This is a C++ template class, which can read a specific type of data. All supported formats can be read.
Constructor parameters may be:
string: filename
rc_ptr_DataSource: generic DataSource
rc_ptr_DataSourceInfo: DataSource with info (more optimal when the data source has been identified and the header loaded)
- allocatorContext()¶
Get the allocation context
- attach(ds)¶
Attach a DataSource to read from (rc_ptr_DataSource)
attach(filename, offset=0)
Attach a new filename + offset for reading
- close()¶
Close the data source stream
- dataSource()¶
Get the data source (rc_ptr_DataSource)
- dataSourceInfo()¶
Get the dataSourceInfo, providing information on the read data
- flush()¶
Flush the read buffer
- options()¶
Get reading options (Object dictionary)
- read()¶
Read an object from source. Two main modes exist:
full: read a full new object and return it
in-place: read an existing object, in-place
A multi-pass procedure is used to identify and read the data from the data source:
pass 1: format hint
pass 2: extension
pass 3: empty extension
pass 4: all readers
- Parameters:
header (Object (optional)) – in-place mode: Volume_CDOUBLE, object to be read. OR: full mode: header (Object), optional
header –
passbegin (int (optional)) – begin at given step of the multi-pass identification/read procedure
passend (int (optional)) – end at given step of the multi-pass identification/read procedure
- Returns:
in-place mode – True upon success False upon failure (but readers will more likely throw an exception)
full mode – the read object
- setAllocatorContext(context)¶
Set allocation context for reading
- setOptions(options)¶
set reading options (Object dictionary)
- class Reader_Volume_CFLOAT¶
Bases:
wrapper
Soma-IO Reader class. This is a C++ template class, which can read a specific type of data. All supported formats can be read.
Constructor parameters may be:
string: filename
rc_ptr_DataSource: generic DataSource
rc_ptr_DataSourceInfo: DataSource with info (more optimal when the data source has been identified and the header loaded)
- allocatorContext()¶
Get the allocation context
- attach(ds)¶
Attach a DataSource to read from (rc_ptr_DataSource)
attach(filename, offset=0)
Attach a new filename + offset for reading
- close()¶
Close the data source stream
- dataSource()¶
Get the data source (rc_ptr_DataSource)
- dataSourceInfo()¶
Get the dataSourceInfo, providing information on the read data
- flush()¶
Flush the read buffer
- options()¶
Get reading options (Object dictionary)
- read()¶
Read an object from source. Two main modes exist:
full: read a full new object and return it
in-place: read an existing object, in-place
A multi-pass procedure is used to identify and read the data from the data source:
pass 1: format hint
pass 2: extension
pass 3: empty extension
pass 4: all readers
- Parameters:
header (Object (optional)) – in-place mode: Volume_CFLOAT, object to be read. OR: full mode: header (Object), optional
header –
passbegin (int (optional)) – begin at given step of the multi-pass identification/read procedure
passend (int (optional)) – end at given step of the multi-pass identification/read procedure
- Returns:
in-place mode – True upon success False upon failure (but readers will more likely throw an exception)
full mode – the read object
- setAllocatorContext(context)¶
Set allocation context for reading
- setOptions(options)¶
set reading options (Object dictionary)
- class Reader_Volume_DOUBLE¶
Bases:
wrapper
Soma-IO Reader class. This is a C++ template class, which can read a specific type of data. All supported formats can be read.
Constructor parameters may be:
string: filename
rc_ptr_DataSource: generic DataSource
rc_ptr_DataSourceInfo: DataSource with info (more optimal when the data source has been identified and the header loaded)
- allocatorContext()¶
Get the allocation context
- attach(ds)¶
Attach a DataSource to read from (rc_ptr_DataSource)
attach(filename, offset=0)
Attach a new filename + offset for reading
- close()¶
Close the data source stream
- dataSource()¶
Get the data source (rc_ptr_DataSource)
- dataSourceInfo()¶
Get the dataSourceInfo, providing information on the read data
- flush()¶
Flush the read buffer
- options()¶
Get reading options (Object dictionary)
- read()¶
Read an object from source. Two main modes exist:
full: read a full new object and return it
in-place: read an existing object, in-place
A multi-pass procedure is used to identify and read the data from the data source:
pass 1: format hint
pass 2: extension
pass 3: empty extension
pass 4: all readers
- Parameters:
header (Object (optional)) – in-place mode: Volume_DOUBLE, object to be read. OR: full mode: header (Object), optional
header –
passbegin (int (optional)) – begin at given step of the multi-pass identification/read procedure
passend (int (optional)) – end at given step of the multi-pass identification/read procedure
- Returns:
in-place mode – True upon success False upon failure (but readers will more likely throw an exception)
full mode – the read object
- setAllocatorContext(context)¶
Set allocation context for reading
- setOptions(options)¶
set reading options (Object dictionary)
- class Reader_Volume_FLOAT¶
Bases:
wrapper
Soma-IO Reader class. This is a C++ template class, which can read a specific type of data. All supported formats can be read.
Constructor parameters may be:
string: filename
rc_ptr_DataSource: generic DataSource
rc_ptr_DataSourceInfo: DataSource with info (more optimal when the data source has been identified and the header loaded)
- allocatorContext()¶
Get the allocation context
- attach(ds)¶
Attach a DataSource to read from (rc_ptr_DataSource)
attach(filename, offset=0)
Attach a new filename + offset for reading
- close()¶
Close the data source stream
- dataSource()¶
Get the data source (rc_ptr_DataSource)
- dataSourceInfo()¶
Get the dataSourceInfo, providing information on the read data
- flush()¶
Flush the read buffer
- options()¶
Get reading options (Object dictionary)
- read()¶
Read an object from source. Two main modes exist:
full: read a full new object and return it
in-place: read an existing object, in-place
A multi-pass procedure is used to identify and read the data from the data source:
pass 1: format hint
pass 2: extension
pass 3: empty extension
pass 4: all readers
- Parameters:
header (Object (optional)) – in-place mode: Volume_FLOAT, object to be read. OR: full mode: header (Object), optional
header –
passbegin (int (optional)) – begin at given step of the multi-pass identification/read procedure
passend (int (optional)) – end at given step of the multi-pass identification/read procedure
- Returns:
in-place mode – True upon success False upon failure (but readers will more likely throw an exception)
full mode – the read object
- setAllocatorContext(context)¶
Set allocation context for reading
- setOptions(options)¶
set reading options (Object dictionary)
- class Reader_Volume_HSV¶
Bases:
wrapper
Soma-IO Reader class. This is a C++ template class, which can read a specific type of data. All supported formats can be read.
Constructor parameters may be:
string: filename
rc_ptr_DataSource: generic DataSource
rc_ptr_DataSourceInfo: DataSource with info (more optimal when the data source has been identified and the header loaded)
- allocatorContext()¶
Get the allocation context
- attach(ds)¶
Attach a DataSource to read from (rc_ptr_DataSource)
attach(filename, offset=0)
Attach a new filename + offset for reading
- close()¶
Close the data source stream
- dataSource()¶
Get the data source (rc_ptr_DataSource)
- dataSourceInfo()¶
Get the dataSourceInfo, providing information on the read data
- flush()¶
Flush the read buffer
- options()¶
Get reading options (Object dictionary)
- read()¶
Read an object from source. Two main modes exist:
full: read a full new object and return it
in-place: read an existing object, in-place
A multi-pass procedure is used to identify and read the data from the data source:
pass 1: format hint
pass 2: extension
pass 3: empty extension
pass 4: all readers
- Parameters:
header (Object (optional)) – in-place mode: Volume_HSV, object to be read. OR: full mode: header (Object), optional
header –
passbegin (int (optional)) – begin at given step of the multi-pass identification/read procedure
passend (int (optional)) – end at given step of the multi-pass identification/read procedure
- Returns:
in-place mode – True upon success False upon failure (but readers will more likely throw an exception)
full mode – the read object
- setAllocatorContext(context)¶
Set allocation context for reading
- setOptions(options)¶
set reading options (Object dictionary)
- class Reader_Volume_POINT3DF¶
Bases:
wrapper
Soma-IO Reader class. This is a C++ template class, which can read a specific type of data. All supported formats can be read.
Constructor parameters may be:
string: filename
rc_ptr_DataSource: generic DataSource
rc_ptr_DataSourceInfo: DataSource with info (more optimal when the data source has been identified and the header loaded)
- allocatorContext()¶
Get the allocation context
- attach(ds)¶
Attach a DataSource to read from (rc_ptr_DataSource)
attach(filename, offset=0)
Attach a new filename + offset for reading
- close()¶
Close the data source stream
- dataSource()¶
Get the data source (rc_ptr_DataSource)
- dataSourceInfo()¶
Get the dataSourceInfo, providing information on the read data
- flush()¶
Flush the read buffer
- options()¶
Get reading options (Object dictionary)
- read()¶
Read an object from source. Two main modes exist:
full: read a full new object and return it
in-place: read an existing object, in-place
A multi-pass procedure is used to identify and read the data from the data source:
pass 1: format hint
pass 2: extension
pass 3: empty extension
pass 4: all readers
- Parameters:
header (Object (optional)) – in-place mode: Volume_POINT3DF, object to be read. OR: full mode: header (Object), optional
header –
passbegin (int (optional)) – begin at given step of the multi-pass identification/read procedure
passend (int (optional)) – end at given step of the multi-pass identification/read procedure
- Returns:
in-place mode – True upon success False upon failure (but readers will more likely throw an exception)
full mode – the read object
- setAllocatorContext(context)¶
Set allocation context for reading
- setOptions(options)¶
set reading options (Object dictionary)
- class Reader_Volume_RGB¶
Bases:
wrapper
Soma-IO Reader class. This is a C++ template class, which can read a specific type of data. All supported formats can be read.
Constructor parameters may be:
string: filename
rc_ptr_DataSource: generic DataSource
rc_ptr_DataSourceInfo: DataSource with info (more optimal when the data source has been identified and the header loaded)
- allocatorContext()¶
Get the allocation context
- attach(ds)¶
Attach a DataSource to read from (rc_ptr_DataSource)
attach(filename, offset=0)
Attach a new filename + offset for reading
- close()¶
Close the data source stream
- dataSource()¶
Get the data source (rc_ptr_DataSource)
- dataSourceInfo()¶
Get the dataSourceInfo, providing information on the read data
- flush()¶
Flush the read buffer
- options()¶
Get reading options (Object dictionary)
- read()¶
Read an object from source. Two main modes exist:
full: read a full new object and return it
in-place: read an existing object, in-place
A multi-pass procedure is used to identify and read the data from the data source:
pass 1: format hint
pass 2: extension
pass 3: empty extension
pass 4: all readers
- Parameters:
header (Object (optional)) – in-place mode: Volume_RGB, object to be read. OR: full mode: header (Object), optional
header –
passbegin (int (optional)) – begin at given step of the multi-pass identification/read procedure
passend (int (optional)) – end at given step of the multi-pass identification/read procedure
- Returns:
in-place mode – True upon success False upon failure (but readers will more likely throw an exception)
full mode – the read object
- setAllocatorContext(context)¶
Set allocation context for reading
- setOptions(options)¶
set reading options (Object dictionary)
- class Reader_Volume_RGBA¶
Bases:
wrapper
Soma-IO Reader class. This is a C++ template class, which can read a specific type of data. All supported formats can be read.
Constructor parameters may be:
string: filename
rc_ptr_DataSource: generic DataSource
rc_ptr_DataSourceInfo: DataSource with info (more optimal when the data source has been identified and the header loaded)
- allocatorContext()¶
Get the allocation context
- attach(ds)¶
Attach a DataSource to read from (rc_ptr_DataSource)
attach(filename, offset=0)
Attach a new filename + offset for reading
- close()¶
Close the data source stream
- dataSource()¶
Get the data source (rc_ptr_DataSource)
- dataSourceInfo()¶
Get the dataSourceInfo, providing information on the read data
- flush()¶
Flush the read buffer
- options()¶
Get reading options (Object dictionary)
- read()¶
Read an object from source. Two main modes exist:
full: read a full new object and return it
in-place: read an existing object, in-place
A multi-pass procedure is used to identify and read the data from the data source:
pass 1: format hint
pass 2: extension
pass 3: empty extension
pass 4: all readers
- Parameters:
header (Object (optional)) – in-place mode: Volume_RGBA, object to be read. OR: full mode: header (Object), optional
header –
passbegin (int (optional)) – begin at given step of the multi-pass identification/read procedure
passend (int (optional)) – end at given step of the multi-pass identification/read procedure
- Returns:
in-place mode – True upon success False upon failure (but readers will more likely throw an exception)
full mode – the read object
- setAllocatorContext(context)¶
Set allocation context for reading
- setOptions(options)¶
set reading options (Object dictionary)
- class Reader_Volume_S16¶
Bases:
wrapper
Soma-IO Reader class. This is a C++ template class, which can read a specific type of data. All supported formats can be read.
Constructor parameters may be:
string: filename
rc_ptr_DataSource: generic DataSource
rc_ptr_DataSourceInfo: DataSource with info (more optimal when the data source has been identified and the header loaded)
- allocatorContext()¶
Get the allocation context
- attach(ds)¶
Attach a DataSource to read from (rc_ptr_DataSource)
attach(filename, offset=0)
Attach a new filename + offset for reading
- close()¶
Close the data source stream
- dataSource()¶
Get the data source (rc_ptr_DataSource)
- dataSourceInfo()¶
Get the dataSourceInfo, providing information on the read data
- flush()¶
Flush the read buffer
- options()¶
Get reading options (Object dictionary)
- read()¶
Read an object from source. Two main modes exist:
full: read a full new object and return it
in-place: read an existing object, in-place
A multi-pass procedure is used to identify and read the data from the data source:
pass 1: format hint
pass 2: extension
pass 3: empty extension
pass 4: all readers
- Parameters:
header (Object (optional)) – in-place mode: Volume_S16, object to be read. OR: full mode: header (Object), optional
header –
passbegin (int (optional)) – begin at given step of the multi-pass identification/read procedure
passend (int (optional)) – end at given step of the multi-pass identification/read procedure
- Returns:
in-place mode – True upon success False upon failure (but readers will more likely throw an exception)
full mode – the read object
- setAllocatorContext(context)¶
Set allocation context for reading
- setOptions(options)¶
set reading options (Object dictionary)
- class Reader_Volume_S32¶
Bases:
wrapper
Soma-IO Reader class. This is a C++ template class, which can read a specific type of data. All supported formats can be read.
Constructor parameters may be:
string: filename
rc_ptr_DataSource: generic DataSource
rc_ptr_DataSourceInfo: DataSource with info (more optimal when the data source has been identified and the header loaded)
- allocatorContext()¶
Get the allocation context
- attach(ds)¶
Attach a DataSource to read from (rc_ptr_DataSource)
attach(filename, offset=0)
Attach a new filename + offset for reading
- close()¶
Close the data source stream
- dataSource()¶
Get the data source (rc_ptr_DataSource)
- dataSourceInfo()¶
Get the dataSourceInfo, providing information on the read data
- flush()¶
Flush the read buffer
- options()¶
Get reading options (Object dictionary)
- read()¶
Read an object from source. Two main modes exist:
full: read a full new object and return it
in-place: read an existing object, in-place
A multi-pass procedure is used to identify and read the data from the data source:
pass 1: format hint
pass 2: extension
pass 3: empty extension
pass 4: all readers
- Parameters:
header (Object (optional)) – in-place mode: Volume_S32, object to be read. OR: full mode: header (Object), optional
header –
passbegin (int (optional)) – begin at given step of the multi-pass identification/read procedure
passend (int (optional)) – end at given step of the multi-pass identification/read procedure
- Returns:
in-place mode – True upon success False upon failure (but readers will more likely throw an exception)
full mode – the read object
- setAllocatorContext(context)¶
Set allocation context for reading
- setOptions(options)¶
set reading options (Object dictionary)
- class Reader_Volume_U16¶
Bases:
wrapper
Soma-IO Reader class. This is a C++ template class, which can read a specific type of data. All supported formats can be read.
Constructor parameters may be:
string: filename
rc_ptr_DataSource: generic DataSource
rc_ptr_DataSourceInfo: DataSource with info (more optimal when the data source has been identified and the header loaded)
- allocatorContext()¶
Get the allocation context
- attach(ds)¶
Attach a DataSource to read from (rc_ptr_DataSource)
attach(filename, offset=0)
Attach a new filename + offset for reading
- close()¶
Close the data source stream
- dataSource()¶
Get the data source (rc_ptr_DataSource)
- dataSourceInfo()¶
Get the dataSourceInfo, providing information on the read data
- flush()¶
Flush the read buffer
- options()¶
Get reading options (Object dictionary)
- read()¶
Read an object from source. Two main modes exist:
full: read a full new object and return it
in-place: read an existing object, in-place
A multi-pass procedure is used to identify and read the data from the data source:
pass 1: format hint
pass 2: extension
pass 3: empty extension
pass 4: all readers
- Parameters:
header (Object (optional)) – in-place mode: Volume_U16, object to be read. OR: full mode: header (Object), optional
header –
passbegin (int (optional)) – begin at given step of the multi-pass identification/read procedure
passend (int (optional)) – end at given step of the multi-pass identification/read procedure
- Returns:
in-place mode – True upon success False upon failure (but readers will more likely throw an exception)
full mode – the read object
- setAllocatorContext(context)¶
Set allocation context for reading
- setOptions(options)¶
set reading options (Object dictionary)
- class Reader_Volume_U32¶
Bases:
wrapper
Soma-IO Reader class. This is a C++ template class, which can read a specific type of data. All supported formats can be read.
Constructor parameters may be:
string: filename
rc_ptr_DataSource: generic DataSource
rc_ptr_DataSourceInfo: DataSource with info (more optimal when the data source has been identified and the header loaded)
- allocatorContext()¶
Get the allocation context
- attach(ds)¶
Attach a DataSource to read from (rc_ptr_DataSource)
attach(filename, offset=0)
Attach a new filename + offset for reading
- close()¶
Close the data source stream
- dataSource()¶
Get the data source (rc_ptr_DataSource)
- dataSourceInfo()¶
Get the dataSourceInfo, providing information on the read data
- flush()¶
Flush the read buffer
- options()¶
Get reading options (Object dictionary)
- read()¶
Read an object from source. Two main modes exist:
full: read a full new object and return it
in-place: read an existing object, in-place
A multi-pass procedure is used to identify and read the data from the data source:
pass 1: format hint
pass 2: extension
pass 3: empty extension
pass 4: all readers
- Parameters:
header (Object (optional)) – in-place mode: Volume_U32, object to be read. OR: full mode: header (Object), optional
header –
passbegin (int (optional)) – begin at given step of the multi-pass identification/read procedure
passend (int (optional)) – end at given step of the multi-pass identification/read procedure
- Returns:
in-place mode – True upon success False upon failure (but readers will more likely throw an exception)
full mode – the read object
- setAllocatorContext(context)¶
Set allocation context for reading
- setOptions(options)¶
set reading options (Object dictionary)
- class Reader_Volume_U8¶
Bases:
wrapper
Soma-IO Reader class. This is a C++ template class, which can read a specific type of data. All supported formats can be read.
Constructor parameters may be:
string: filename
rc_ptr_DataSource: generic DataSource
rc_ptr_DataSourceInfo: DataSource with info (more optimal when the data source has been identified and the header loaded)
- allocatorContext()¶
Get the allocation context
- attach(ds)¶
Attach a DataSource to read from (rc_ptr_DataSource)
attach(filename, offset=0)
Attach a new filename + offset for reading
- close()¶
Close the data source stream
- dataSource()¶
Get the data source (rc_ptr_DataSource)
- dataSourceInfo()¶
Get the dataSourceInfo, providing information on the read data
- flush()¶
Flush the read buffer
- options()¶
Get reading options (Object dictionary)
- read()¶
Read an object from source. Two main modes exist:
full: read a full new object and return it
in-place: read an existing object, in-place
A multi-pass procedure is used to identify and read the data from the data source:
pass 1: format hint
pass 2: extension
pass 3: empty extension
pass 4: all readers
- Parameters:
header (Object (optional)) – in-place mode: Volume_U8, object to be read. OR: full mode: header (Object), optional
header –
passbegin (int (optional)) – begin at given step of the multi-pass identification/read procedure
passend (int (optional)) – end at given step of the multi-pass identification/read procedure
- Returns:
in-place mode – True upon success False upon failure (but readers will more likely throw an exception)
full mode – the read object
- setAllocatorContext(context)¶
Set allocation context for reading
- setOptions(options)¶
set reading options (Object dictionary)
- class Transformation(*args)¶
Bases:
RCObject
Base class for spatial transformations.
- header()¶
- isIdentity()¶
Test if the transformation can safely be omitted
This method must only return true if the transformation behaves exactly like an identity transformation (notably, the transform methods will always return the input coordinates unchanged).
NOTE: Implementors of derived classes may choose to always return false if a test would be difficult to implement or expensive to run.
- setHeader()¶
- class Transformation3d(*args)¶
Bases:
Transformation
Base class for spatial transformations in 3D.
- fromObject()¶
- toObject()¶
- transform()¶
- transformDouble()¶
- transformFloat()¶
- transformPoint3d()¶
- transformPoint3dd()¶
- transformPoint3df()¶
- transformPoints()¶
- class Writer_Object¶
Bases:
wrapper
Soma-IO Writer class. This is a C++ template class, which can write a specific type of data. All supported formats can be written.
Constructor parameters may be:
string: filename
rc_ptr_DataSource: generic DataSource
- attach(ds)¶
Attach a new data source (rc_ptr_DataSource) to write into
attach(filename)
Attach a new output file name to write into
- close()¶
Close the data source stream
- dataSource()¶
Get the data source (rc_ptr_DataSource)
- flush()¶
flush the write buffer
- write()¶
Write the given object to the data source (generally files)
A multi-pass procedure is used to identify and write the data to the data source:
pass 1: format hint
pass 2: extension
pass 3: empty extension
pass 4: all writes
- Parameters:
obj (carto::Object) – object to write
options (Object (optional)) – Options can be passed to specify some writing parameters. The most important is the format (“format” property): if it is specified, this format is tried first, so you can use it to force the format, otherwise it will be determined from the filename extension (if available). If no extension and no format are given, the first working format will be used.
passbegin (int (optional)) –
passend (int (optional)) –
- Return type:
True upon success, False upon failure, but an exception is more likely thrown in such case
- writtenObjectType()¶
After writing, get the object type code (string) of the data
- class Writer_Volume_CDOUBLE¶
Bases:
wrapper
Soma-IO Writer class. This is a C++ template class, which can write a specific type of data. All supported formats can be written.
Constructor parameters may be:
string: filename
rc_ptr_DataSource: generic DataSource
- attach(ds)¶
Attach a new data source (rc_ptr_DataSource) to write into
attach(filename)
Attach a new output file name to write into
- close()¶
Close the data source stream
- dataSource()¶
Get the data source (rc_ptr_DataSource)
- flush()¶
flush the write buffer
- write()¶
Write the given object to the data source (generally files)
A multi-pass procedure is used to identify and write the data to the data source:
pass 1: format hint
pass 2: extension
pass 3: empty extension
pass 4: all writes
- Parameters:
obj (Volume_CDOUBLE) – object to write
options (Object (optional)) – Options can be passed to specify some writing parameters. The most important is the format (“format” property): if it is specified, this format is tried first, so you can use it to force the format, otherwise it will be determined from the filename extension (if available). If no extension and no format are given, the first working format will be used.
passbegin (int (optional)) –
passend (int (optional)) –
- Return type:
True upon success, False upon failure, but an exception is more likely thrown in such case
- writtenObjectType()¶
After writing, get the object type code (string) of the data
- class Writer_Volume_CFLOAT¶
Bases:
wrapper
Soma-IO Writer class. This is a C++ template class, which can write a specific type of data. All supported formats can be written.
Constructor parameters may be:
string: filename
rc_ptr_DataSource: generic DataSource
- attach(ds)¶
Attach a new data source (rc_ptr_DataSource) to write into
attach(filename)
Attach a new output file name to write into
- close()¶
Close the data source stream
- dataSource()¶
Get the data source (rc_ptr_DataSource)
- flush()¶
flush the write buffer
- write()¶
Write the given object to the data source (generally files)
A multi-pass procedure is used to identify and write the data to the data source:
pass 1: format hint
pass 2: extension
pass 3: empty extension
pass 4: all writes
- Parameters:
obj (Volume_CFLOAT) – object to write
options (Object (optional)) – Options can be passed to specify some writing parameters. The most important is the format (“format” property): if it is specified, this format is tried first, so you can use it to force the format, otherwise it will be determined from the filename extension (if available). If no extension and no format are given, the first working format will be used.
passbegin (int (optional)) –
passend (int (optional)) –
- Return type:
True upon success, False upon failure, but an exception is more likely thrown in such case
- writtenObjectType()¶
After writing, get the object type code (string) of the data
- class Writer_Volume_DOUBLE¶
Bases:
wrapper
Soma-IO Writer class. This is a C++ template class, which can write a specific type of data. All supported formats can be written.
Constructor parameters may be:
string: filename
rc_ptr_DataSource: generic DataSource
- attach(ds)¶
Attach a new data source (rc_ptr_DataSource) to write into
attach(filename)
Attach a new output file name to write into
- close()¶
Close the data source stream
- dataSource()¶
Get the data source (rc_ptr_DataSource)
- flush()¶
flush the write buffer
- write()¶
Write the given object to the data source (generally files)
A multi-pass procedure is used to identify and write the data to the data source:
pass 1: format hint
pass 2: extension
pass 3: empty extension
pass 4: all writes
- Parameters:
obj (Volume_DOUBLE) – object to write
options (Object (optional)) – Options can be passed to specify some writing parameters. The most important is the format (“format” property): if it is specified, this format is tried first, so you can use it to force the format, otherwise it will be determined from the filename extension (if available). If no extension and no format are given, the first working format will be used.
passbegin (int (optional)) –
passend (int (optional)) –
- Return type:
True upon success, False upon failure, but an exception is more likely thrown in such case
- writtenObjectType()¶
After writing, get the object type code (string) of the data
- class Writer_Volume_FLOAT¶
Bases:
wrapper
Soma-IO Writer class. This is a C++ template class, which can write a specific type of data. All supported formats can be written.
Constructor parameters may be:
string: filename
rc_ptr_DataSource: generic DataSource
- attach(ds)¶
Attach a new data source (rc_ptr_DataSource) to write into
attach(filename)
Attach a new output file name to write into
- close()¶
Close the data source stream
- dataSource()¶
Get the data source (rc_ptr_DataSource)
- flush()¶
flush the write buffer
- write()¶
Write the given object to the data source (generally files)
A multi-pass procedure is used to identify and write the data to the data source:
pass 1: format hint
pass 2: extension
pass 3: empty extension
pass 4: all writes
- Parameters:
obj (Volume_FLOAT) – object to write
options (Object (optional)) – Options can be passed to specify some writing parameters. The most important is the format (“format” property): if it is specified, this format is tried first, so you can use it to force the format, otherwise it will be determined from the filename extension (if available). If no extension and no format are given, the first working format will be used.
passbegin (int (optional)) –
passend (int (optional)) –
- Return type:
True upon success, False upon failure, but an exception is more likely thrown in such case
- writtenObjectType()¶
After writing, get the object type code (string) of the data
- class Writer_Volume_HSV¶
Bases:
wrapper
Soma-IO Writer class. This is a C++ template class, which can write a specific type of data. All supported formats can be written.
Constructor parameters may be:
string: filename
rc_ptr_DataSource: generic DataSource
- attach(ds)¶
Attach a new data source (rc_ptr_DataSource) to write into
attach(filename)
Attach a new output file name to write into
- close()¶
Close the data source stream
- dataSource()¶
Get the data source (rc_ptr_DataSource)
- flush()¶
flush the write buffer
- write()¶
Write the given object to the data source (generally files)
A multi-pass procedure is used to identify and write the data to the data source:
pass 1: format hint
pass 2: extension
pass 3: empty extension
pass 4: all writes
- Parameters:
obj (Volume_HSV) – object to write
options (Object (optional)) – Options can be passed to specify some writing parameters. The most important is the format (“format” property): if it is specified, this format is tried first, so you can use it to force the format, otherwise it will be determined from the filename extension (if available). If no extension and no format are given, the first working format will be used.
passbegin (int (optional)) –
passend (int (optional)) –
- Return type:
True upon success, False upon failure, but an exception is more likely thrown in such case
- writtenObjectType()¶
After writing, get the object type code (string) of the data
- class Writer_Volume_POINT3DF¶
Bases:
wrapper
Soma-IO Writer class. This is a C++ template class, which can write a specific type of data. All supported formats can be written.
Constructor parameters may be:
string: filename
rc_ptr_DataSource: generic DataSource
- attach(ds)¶
Attach a new data source (rc_ptr_DataSource) to write into
attach(filename)
Attach a new output file name to write into
- close()¶
Close the data source stream
- dataSource()¶
Get the data source (rc_ptr_DataSource)
- flush()¶
flush the write buffer
- write()¶
Write the given object to the data source (generally files)
A multi-pass procedure is used to identify and write the data to the data source:
pass 1: format hint
pass 2: extension
pass 3: empty extension
pass 4: all writes
- Parameters:
obj (Volume_POINT3DF) – object to write
options (Object (optional)) – Options can be passed to specify some writing parameters. The most important is the format (“format” property): if it is specified, this format is tried first, so you can use it to force the format, otherwise it will be determined from the filename extension (if available). If no extension and no format are given, the first working format will be used.
passbegin (int (optional)) –
passend (int (optional)) –
- Return type:
True upon success, False upon failure, but an exception is more likely thrown in such case
- writtenObjectType()¶
After writing, get the object type code (string) of the data
- class Writer_Volume_RGB¶
Bases:
wrapper
Soma-IO Writer class. This is a C++ template class, which can write a specific type of data. All supported formats can be written.
Constructor parameters may be:
string: filename
rc_ptr_DataSource: generic DataSource
- attach(ds)¶
Attach a new data source (rc_ptr_DataSource) to write into
attach(filename)
Attach a new output file name to write into
- close()¶
Close the data source stream
- dataSource()¶
Get the data source (rc_ptr_DataSource)
- flush()¶
flush the write buffer
- write()¶
Write the given object to the data source (generally files)
A multi-pass procedure is used to identify and write the data to the data source:
pass 1: format hint
pass 2: extension
pass 3: empty extension
pass 4: all writes
- Parameters:
obj (Volume_RGB) – object to write
options (Object (optional)) – Options can be passed to specify some writing parameters. The most important is the format (“format” property): if it is specified, this format is tried first, so you can use it to force the format, otherwise it will be determined from the filename extension (if available). If no extension and no format are given, the first working format will be used.
passbegin (int (optional)) –
passend (int (optional)) –
- Return type:
True upon success, False upon failure, but an exception is more likely thrown in such case
- writtenObjectType()¶
After writing, get the object type code (string) of the data
- class Writer_Volume_RGBA¶
Bases:
wrapper
Soma-IO Writer class. This is a C++ template class, which can write a specific type of data. All supported formats can be written.
Constructor parameters may be:
string: filename
rc_ptr_DataSource: generic DataSource
- attach(ds)¶
Attach a new data source (rc_ptr_DataSource) to write into
attach(filename)
Attach a new output file name to write into
- close()¶
Close the data source stream
- dataSource()¶
Get the data source (rc_ptr_DataSource)
- flush()¶
flush the write buffer
- write()¶
Write the given object to the data source (generally files)
A multi-pass procedure is used to identify and write the data to the data source:
pass 1: format hint
pass 2: extension
pass 3: empty extension
pass 4: all writes
- Parameters:
obj (Volume_RGBA) – object to write
options (Object (optional)) – Options can be passed to specify some writing parameters. The most important is the format (“format” property): if it is specified, this format is tried first, so you can use it to force the format, otherwise it will be determined from the filename extension (if available). If no extension and no format are given, the first working format will be used.
passbegin (int (optional)) –
passend (int (optional)) –
- Return type:
True upon success, False upon failure, but an exception is more likely thrown in such case
- writtenObjectType()¶
After writing, get the object type code (string) of the data
- class Writer_Volume_S16¶
Bases:
wrapper
Soma-IO Writer class. This is a C++ template class, which can write a specific type of data. All supported formats can be written.
Constructor parameters may be:
string: filename
rc_ptr_DataSource: generic DataSource
- attach(ds)¶
Attach a new data source (rc_ptr_DataSource) to write into
attach(filename)
Attach a new output file name to write into
- close()¶
Close the data source stream
- dataSource()¶
Get the data source (rc_ptr_DataSource)
- flush()¶
flush the write buffer
- write()¶
Write the given object to the data source (generally files)
A multi-pass procedure is used to identify and write the data to the data source:
pass 1: format hint
pass 2: extension
pass 3: empty extension
pass 4: all writes
- Parameters:
obj (Volume_S16) – object to write
options (Object (optional)) – Options can be passed to specify some writing parameters. The most important is the format (“format” property): if it is specified, this format is tried first, so you can use it to force the format, otherwise it will be determined from the filename extension (if available). If no extension and no format are given, the first working format will be used.
passbegin (int (optional)) –
passend (int (optional)) –
- Return type:
True upon success, False upon failure, but an exception is more likely thrown in such case
- writtenObjectType()¶
After writing, get the object type code (string) of the data
- class Writer_Volume_S32¶
Bases:
wrapper
Soma-IO Writer class. This is a C++ template class, which can write a specific type of data. All supported formats can be written.
Constructor parameters may be:
string: filename
rc_ptr_DataSource: generic DataSource
- attach(ds)¶
Attach a new data source (rc_ptr_DataSource) to write into
attach(filename)
Attach a new output file name to write into
- close()¶
Close the data source stream
- dataSource()¶
Get the data source (rc_ptr_DataSource)
- flush()¶
flush the write buffer
- write()¶
Write the given object to the data source (generally files)
A multi-pass procedure is used to identify and write the data to the data source:
pass 1: format hint
pass 2: extension
pass 3: empty extension
pass 4: all writes
- Parameters:
obj (Volume_S32) – object to write
options (Object (optional)) – Options can be passed to specify some writing parameters. The most important is the format (“format” property): if it is specified, this format is tried first, so you can use it to force the format, otherwise it will be determined from the filename extension (if available). If no extension and no format are given, the first working format will be used.
passbegin (int (optional)) –
passend (int (optional)) –
- Return type:
True upon success, False upon failure, but an exception is more likely thrown in such case
- writtenObjectType()¶
After writing, get the object type code (string) of the data
- class Writer_Volume_U16¶
Bases:
wrapper
Soma-IO Writer class. This is a C++ template class, which can write a specific type of data. All supported formats can be written.
Constructor parameters may be:
string: filename
rc_ptr_DataSource: generic DataSource
- attach(ds)¶
Attach a new data source (rc_ptr_DataSource) to write into
attach(filename)
Attach a new output file name to write into
- close()¶
Close the data source stream
- dataSource()¶
Get the data source (rc_ptr_DataSource)
- flush()¶
flush the write buffer
- write()¶
Write the given object to the data source (generally files)
A multi-pass procedure is used to identify and write the data to the data source:
pass 1: format hint
pass 2: extension
pass 3: empty extension
pass 4: all writes
- Parameters:
obj (Volume_U16) – object to write
options (Object (optional)) – Options can be passed to specify some writing parameters. The most important is the format (“format” property): if it is specified, this format is tried first, so you can use it to force the format, otherwise it will be determined from the filename extension (if available). If no extension and no format are given, the first working format will be used.
passbegin (int (optional)) –
passend (int (optional)) –
- Return type:
True upon success, False upon failure, but an exception is more likely thrown in such case
- writtenObjectType()¶
After writing, get the object type code (string) of the data
- class Writer_Volume_U32¶
Bases:
wrapper
Soma-IO Writer class. This is a C++ template class, which can write a specific type of data. All supported formats can be written.
Constructor parameters may be:
string: filename
rc_ptr_DataSource: generic DataSource
- attach(ds)¶
Attach a new data source (rc_ptr_DataSource) to write into
attach(filename)
Attach a new output file name to write into
- close()¶
Close the data source stream
- dataSource()¶
Get the data source (rc_ptr_DataSource)
- flush()¶
flush the write buffer
- write()¶
Write the given object to the data source (generally files)
A multi-pass procedure is used to identify and write the data to the data source:
pass 1: format hint
pass 2: extension
pass 3: empty extension
pass 4: all writes
- Parameters:
obj (Volume_U32) – object to write
options (Object (optional)) – Options can be passed to specify some writing parameters. The most important is the format (“format” property): if it is specified, this format is tried first, so you can use it to force the format, otherwise it will be determined from the filename extension (if available). If no extension and no format are given, the first working format will be used.
passbegin (int (optional)) –
passend (int (optional)) –
- Return type:
True upon success, False upon failure, but an exception is more likely thrown in such case
- writtenObjectType()¶
After writing, get the object type code (string) of the data
- class Writer_Volume_U8¶
Bases:
wrapper
Soma-IO Writer class. This is a C++ template class, which can write a specific type of data. All supported formats can be written.
Constructor parameters may be:
string: filename
rc_ptr_DataSource: generic DataSource
- attach(ds)¶
Attach a new data source (rc_ptr_DataSource) to write into
attach(filename)
Attach a new output file name to write into
- close()¶
Close the data source stream
- dataSource()¶
Get the data source (rc_ptr_DataSource)
- flush()¶
flush the write buffer
- write()¶
Write the given object to the data source (generally files)
A multi-pass procedure is used to identify and write the data to the data source:
pass 1: format hint
pass 2: extension
pass 3: empty extension
pass 4: all writes
- Parameters:
obj (Volume_U8) – object to write
options (Object (optional)) – Options can be passed to specify some writing parameters. The most important is the format (“format” property): if it is specified, this format is tried first, so you can use it to force the format, otherwise it will be determined from the filename extension (if available). If no extension and no format are given, the first working format will be used.
passbegin (int (optional)) –
passend (int (optional)) –
- Return type:
True upon success, False upon failure, but an exception is more likely thrown in such case
- writtenObjectType()¶
After writing, get the object type code (string) of the data
- soma.aims.somaio_typeCode(data)[source]¶
returns the Soma-IO type code (as in soma.carto.IOObjectTypesDictionary.readTypes() dict keys) for the given input type.
- Parameters:
data (string or type or instance, or 2-tuple) – If type or instance, get the type code for the given object. If string, try to translate AIMS IO to soma-IO codes. If 2-tuple, translate AIMS object type / data type couple
- soma.aims.stdList(*args, **kwargs)[source]¶
Create an instance of STL C++ list (list_<type>) from a type parameter, which may be specified as the dtype keyword argument, or as one of the arguments if one is identitied as a type.
Type definitions should match those accepted by typeCode().
- soma.aims.stdSet(*args, **kwargs)[source]¶
Create an instance of STL C++ set (set_<type>) from a type parameter, which may be specified as the dtype keyword argument, or as one of the arguments if one is identitied as a type.
Type definitions should match those accepted by typeCode().
- soma.aims.stdVector(*args, **kwargs)[source]¶
Create an instance of STL C++ vector (vector_<type>) from a type parameter, which may be specified as the dtype keyword argument, or as one of the arguments if one is identitied as a type.
Type definitions should match those accepted by typeCode().
- soma.aims.supported_io_formats(otypes=None, access='')[source]¶
Returns a list of formats supported to read or write the given object types. Both AIMS and Soma-IO support are queried.
- Parameters:
otypes (dict, list, str, or None) – object types. May be given in several shapes: 1. None: will query all possible object types. 2. str: will get all data types (voxel, texture) for the given container object type (Volume, Mesh etc.). 3. list of str: a list of container object types, as in the str case. 4. dict: allows to specify precisely object type / data types mapping: for each object type, a list of data types will be used. When a data type is None, then all possible ones will be used.
access (str) – read / write capabilities: restricts soma-io IO queries to the specified access modes. aims IO will not be affected by this parameter since it does not separate reading and writing capabilities. Possible values are: ‘’: any, ‘r’: read, ‘w’: write, ‘rw’: both needed.
- Returns:
formats – set of formats names
- Return type:
- soma.aims.textureMax()¶
- soma.aims.transformBoundingBox()¶
- soma.aims.typeCode(data)[source]¶
returns the AIMS type code for the given input data. data may be a string code, a python/numpy numeric type, an AIMS type, or an instance of such a type.
- soma.aims.vectProduct()¶
- class soma.aims.vector_AimsVector_U32_2¶
Bases:
wrapper
- append()¶
- array_struct()¶
Return a numpy array of elements. For vectors of scalar types, this is the same as the other functions __array__() and arraydata(). But for vectors where the elements are “sub-arrays”, ie objects that can be mapped to arrays, the returned array elements will be structures: for instance a Point3df will be mapped to numpy.dtype([(‘v’, ‘3f4’)])
- arraydata()¶
- assign()¶
- checkResize()¶
- fromObject()¶
- index()¶
- list()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- remove()¶
- resize()¶
- size()¶
- toObject()¶
- class soma.aims.vector_AimsVector_U32_2_iterator¶
Bases:
wrapper
- class soma.aims.vector_AimsVector_U32_3¶
Bases:
wrapper
- append()¶
- array_struct()¶
Return a numpy array of elements. For vectors of scalar types, this is the same as the other functions __array__() and arraydata(). But for vectors where the elements are “sub-arrays”, ie objects that can be mapped to arrays, the returned array elements will be structures: for instance a Point3df will be mapped to numpy.dtype([(‘v’, ‘3f4’)])
- arraydata()¶
- assign()¶
- checkResize()¶
- fromObject()¶
- index()¶
- list()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- remove()¶
- resize()¶
- size()¶
- toObject()¶
- class soma.aims.vector_AimsVector_U32_3_iterator¶
Bases:
wrapper
- class soma.aims.vector_AimsVector_U32_4¶
Bases:
wrapper
- append()¶
- array_struct()¶
Return a numpy array of elements. For vectors of scalar types, this is the same as the other functions __array__() and arraydata(). But for vectors where the elements are “sub-arrays”, ie objects that can be mapped to arrays, the returned array elements will be structures: for instance a Point3df will be mapped to numpy.dtype([(‘v’, ‘3f4’)])
- arraydata()¶
- assign()¶
- checkResize()¶
- fromObject()¶
- index()¶
- list()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- remove()¶
- resize()¶
- size()¶
- toObject()¶
- class soma.aims.vector_AimsVector_U32_4_iterator¶
Bases:
wrapper
- class soma.aims.vector_DOUBLE¶
Bases:
wrapper
- append()¶
- array_struct()¶
Return a numpy array of elements. For vectors of scalar types, this is the same as the other functions __array__() and arraydata(). But for vectors where the elements are “sub-arrays”, ie objects that can be mapped to arrays, the returned array elements will be structures: for instance a Point3df will be mapped to numpy.dtype([(‘v’, ‘3f4’)])
- arraydata()¶
- assign()¶
- checkResize()¶
- fromObject()¶
- index()¶
- list()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- remove()¶
- resize()¶
- size()¶
- toObject()¶
- class soma.aims.vector_DOUBLE_iterator¶
Bases:
wrapper
- class soma.aims.vector_FLOAT¶
Bases:
wrapper
- append()¶
- array_struct()¶
Return a numpy array of elements. For vectors of scalar types, this is the same as the other functions __array__() and arraydata(). But for vectors where the elements are “sub-arrays”, ie objects that can be mapped to arrays, the returned array elements will be structures: for instance a Point3df will be mapped to numpy.dtype([(‘v’, ‘3f4’)])
- arraydata()¶
- assign()¶
- checkResize()¶
- fromObject()¶
- index()¶
- list()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- remove()¶
- resize()¶
- size()¶
- toObject()¶
- class soma.aims.vector_FLOAT_iterator¶
Bases:
wrapper
- class soma.aims.vector_POINT2DF¶
Bases:
wrapper
- append()¶
- array_struct()¶
Return a numpy array of elements. For vectors of scalar types, this is the same as the other functions __array__() and arraydata(). But for vectors where the elements are “sub-arrays”, ie objects that can be mapped to arrays, the returned array elements will be structures: for instance a Point3df will be mapped to numpy.dtype([(‘v’, ‘3f4’)])
- arraydata()¶
- assign()¶
- checkResize()¶
- fromObject()¶
- index()¶
- list()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- remove()¶
- resize()¶
- size()¶
- toObject()¶
- class soma.aims.vector_POINT2DF_iterator¶
Bases:
wrapper
- class soma.aims.vector_POINT3D¶
Bases:
wrapper
- append()¶
- array_struct()¶
Return a numpy array of elements. For vectors of scalar types, this is the same as the other functions __array__() and arraydata(). But for vectors where the elements are “sub-arrays”, ie objects that can be mapped to arrays, the returned array elements will be structures: for instance a Point3df will be mapped to numpy.dtype([(‘v’, ‘3f4’)])
- arraydata()¶
- assign()¶
- checkResize()¶
- fromObject()¶
- index()¶
- list()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- remove()¶
- resize()¶
- size()¶
- toObject()¶
- class soma.aims.vector_POINT3DD¶
Bases:
wrapper
- append()¶
- array_struct()¶
Return a numpy array of elements. For vectors of scalar types, this is the same as the other functions __array__() and arraydata(). But for vectors where the elements are “sub-arrays”, ie objects that can be mapped to arrays, the returned array elements will be structures: for instance a Point3df will be mapped to numpy.dtype([(‘v’, ‘3f4’)])
- arraydata()¶
- assign()¶
- checkResize()¶
- fromObject()¶
- index()¶
- list()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- remove()¶
- resize()¶
- size()¶
- toObject()¶
- class soma.aims.vector_POINT3DD_iterator¶
Bases:
wrapper
- class soma.aims.vector_POINT3DF¶
Bases:
wrapper
- append()¶
- array_struct()¶
Return a numpy array of elements. For vectors of scalar types, this is the same as the other functions __array__() and arraydata(). But for vectors where the elements are “sub-arrays”, ie objects that can be mapped to arrays, the returned array elements will be structures: for instance a Point3df will be mapped to numpy.dtype([(‘v’, ‘3f4’)])
- arraydata()¶
- assign()¶
- checkResize()¶
- fromObject()¶
- index()¶
- list()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- remove()¶
- resize()¶
- size()¶
- toObject()¶
- class soma.aims.vector_POINT3DF_iterator¶
Bases:
wrapper
- class soma.aims.vector_POINT3D_iterator¶
Bases:
wrapper
- class soma.aims.vector_S16¶
Bases:
wrapper
- append()¶
- array_struct()¶
Return a numpy array of elements. For vectors of scalar types, this is the same as the other functions __array__() and arraydata(). But for vectors where the elements are “sub-arrays”, ie objects that can be mapped to arrays, the returned array elements will be structures: for instance a Point3df will be mapped to numpy.dtype([(‘v’, ‘3f4’)])
- arraydata()¶
- assign()¶
- checkResize()¶
- fromObject()¶
- index()¶
- list()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- remove()¶
- resize()¶
- size()¶
- toObject()¶
- class soma.aims.vector_S16_iterator¶
Bases:
wrapper
- class soma.aims.vector_S32¶
Bases:
wrapper
- append()¶
- array_struct()¶
Return a numpy array of elements. For vectors of scalar types, this is the same as the other functions __array__() and arraydata(). But for vectors where the elements are “sub-arrays”, ie objects that can be mapped to arrays, the returned array elements will be structures: for instance a Point3df will be mapped to numpy.dtype([(‘v’, ‘3f4’)])
- arraydata()¶
- assign()¶
- checkResize()¶
- fromObject()¶
- index()¶
- list()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- remove()¶
- resize()¶
- size()¶
- toObject()¶
- class soma.aims.vector_S32_iterator¶
Bases:
wrapper
- class soma.aims.vector_STRING¶
Bases:
wrapper
- append()¶
- assign()¶
- fromObject()¶
- index()¶
- list()¶
- remove()¶
- resize()¶
- size()¶
- toObject()¶
- class soma.aims.vector_STRING_iterator¶
Bases:
wrapper
- class soma.aims.vector_U16¶
Bases:
wrapper
- append()¶
- array_struct()¶
Return a numpy array of elements. For vectors of scalar types, this is the same as the other functions __array__() and arraydata(). But for vectors where the elements are “sub-arrays”, ie objects that can be mapped to arrays, the returned array elements will be structures: for instance a Point3df will be mapped to numpy.dtype([(‘v’, ‘3f4’)])
- arraydata()¶
- assign()¶
- checkResize()¶
- fromObject()¶
- index()¶
- list()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- remove()¶
- resize()¶
- size()¶
- toObject()¶
- class soma.aims.vector_U16_iterator¶
Bases:
wrapper
- class soma.aims.vector_U32¶
Bases:
wrapper
- append()¶
- array_struct()¶
Return a numpy array of elements. For vectors of scalar types, this is the same as the other functions __array__() and arraydata(). But for vectors where the elements are “sub-arrays”, ie objects that can be mapped to arrays, the returned array elements will be structures: for instance a Point3df will be mapped to numpy.dtype([(‘v’, ‘3f4’)])
- arraydata()¶
- assign()¶
- checkResize()¶
- fromObject()¶
- index()¶
- list()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- remove()¶
- resize()¶
- size()¶
- toObject()¶
- class soma.aims.vector_U32_iterator¶
Bases:
wrapper
- class soma.aims.vector_U8¶
Bases:
wrapper
- append()¶
- array_struct()¶
Return a numpy array of elements. For vectors of scalar types, this is the same as the other functions __array__() and arraydata(). But for vectors where the elements are “sub-arrays”, ie objects that can be mapped to arrays, the returned array elements will be structures: for instance a Point3df will be mapped to numpy.dtype([(‘v’, ‘3f4’)])
- arraydata()¶
- assign()¶
- checkResize()¶
- fromObject()¶
- index()¶
- list()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- remove()¶
- resize()¶
- size()¶
- toObject()¶
- class soma.aims.vector_U8_iterator¶
Bases:
wrapper
- class soma.aims.vector_ULONG¶
Bases:
wrapper
- append()¶
- array_struct()¶
Return a numpy array of elements. For vectors of scalar types, this is the same as the other functions __array__() and arraydata(). But for vectors where the elements are “sub-arrays”, ie objects that can be mapped to arrays, the returned array elements will be structures: for instance a Point3df will be mapped to numpy.dtype([(‘v’, ‘3f4’)])
- arraydata()¶
- assign()¶
- checkResize()¶
- fromObject()¶
- index()¶
- list()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- remove()¶
- resize()¶
- size()¶
- toObject()¶
- class soma.aims.vector_ULONGLONG¶
Bases:
wrapper
- append()¶
- array_struct()¶
Return a numpy array of elements. For vectors of scalar types, this is the same as the other functions __array__() and arraydata(). But for vectors where the elements are “sub-arrays”, ie objects that can be mapped to arrays, the returned array elements will be structures: for instance a Point3df will be mapped to numpy.dtype([(‘v’, ‘3f4’)])
- arraydata()¶
- assign()¶
- checkResize()¶
- fromObject()¶
- index()¶
- list()¶
- property np¶
The
np
property is a shortcut to the__array__
method. Thus:something.np
is a handier equivalent to:
numpy.asarray(something)
- remove()¶
- resize()¶
- size()¶
- toObject()¶
- class soma.aims.vector_ULONGLONG_iterator¶
Bases:
wrapper
- class soma.aims.vector_ULONG_iterator¶
Bases:
wrapper
- class soma.aims.vector_VOID¶
Bases:
wrapper
- append()¶
- assign()¶
- fromObject()¶
- index()¶
- list()¶
- remove()¶
- resize()¶
- size()¶
- toObject()¶
- class soma.aims.vector_VOID_iterator¶
Bases:
wrapper
- class soma.aims.vector_list_U32¶
Bases:
wrapper
- append()¶
- assign()¶
- fromObject()¶
- index()¶
- list()¶
- remove()¶
- resize()¶
- size()¶
- toObject()¶
- class soma.aims.vector_list_U32_iterator¶
Bases:
wrapper
- class soma.aims.vector_rc_ptr_AimsTimeSurface_3_VOID¶
Bases:
wrapper
- append()¶
- assign()¶
- fromObject()¶
- index()¶
- list()¶
- remove()¶
- resize()¶
- size()¶
- toObject()¶
- class soma.aims.vector_rc_ptr_AimsTimeSurface_3_VOID_iterator¶
Bases:
wrapper
- class soma.aims.vector_set_U32¶
Bases:
wrapper
- append()¶
- assign()¶
- fromObject()¶
- index()¶
- list()¶
- remove()¶
- resize()¶
- size()¶
- toObject()¶
- class soma.aims.vector_set_U32_iterator¶
Bases:
wrapper
- class soma.aims.vector_vector_FLOAT¶
Bases:
wrapper
- append()¶
- assign()¶
- fromObject()¶
- index()¶
- list()¶
- remove()¶
- resize()¶
- size()¶
- toObject()¶
- class soma.aims.vector_vector_FLOAT_iterator¶
Bases:
wrapper
- class soma.aims.vector_vector_POINT3DF¶
Bases:
wrapper
- append()¶
- assign()¶
- fromObject()¶
- index()¶
- list()¶
- remove()¶
- resize()¶
- size()¶
- toObject()¶
- class soma.aims.vector_vector_POINT3DF_iterator¶
Bases:
wrapper
- class soma.aims.vector_vector_S32¶
Bases:
wrapper
- append()¶
- assign()¶
- fromObject()¶
- index()¶
- list()¶
- remove()¶
- resize()¶
- size()¶
- toObject()¶
- class soma.aims.vector_vector_S32_iterator¶
Bases:
wrapper
- class soma.aims.vector_vector_STRING¶
Bases:
wrapper
- append()¶
- assign()¶
- fromObject()¶
- index()¶
- list()¶
- remove()¶
- resize()¶
- size()¶
- toObject()¶
- class soma.aims.vector_vector_STRING_iterator¶
Bases:
wrapper
- soma.aims.version()¶
AIMS / Cartobase version, as a 2-digit tuple
- soma.aims.versionString()¶
AIMS / Cartobase full version, as a string
- soma.aims.voxelTypeCode(data)[source]¶
returns the AIMS type code for the given input data voxel type. For instance, for a volume of 16 bit ints, it will be ‘S16’, whereas typeCode() would return ‘Volume_S16’.
Input data may be a type or an instance of a container type.
- soma.aims.write(obj, filename, format=None, options={})[source]¶
Equivalent to:
w = Writer() w.write(obj, filename, format=format, options=options)
- soma.aims.xmlInitParser()¶