PyAimsAlgo programming documentation

Overview

Many classes of AimsAlgo are actually found in the soma.aims module, after importing soma.aimsalgo (mainly because of the C++ namespace aims being merged by SIP bindings). The additional soma.aimsalgo module contains C++ algorithms which do ne reside inside the aims C++ namespace, and additional python submodules.

A more complete API is in Module: soma.aimsalgo.

Contents

In soma.aims module

class soma.aims.ResamplerFactory_FLOAT

ResamplerFactory classes are used to instantiate a Resampler object for the chosen interpolation type. The main method is getResampler().

class ResamplerType
getResampler(order: int) Resampler_FLOAT | None
getResampler(order) resampler

Instantiate a Resampler of the given order.

Parameters:

order (int) – order of interpolation: 0 is nearest neighbour (no interpolation), 1 is linear, 3 is cubic, etc. up to 7th order.

Returns:

result – a new instance of the selected resampler type

Return type:

Resampler_FLOAT

class soma.aims.FastMarching(connectivity: object = '26', mid_interface: bool = False)
class soma.aims.FastMarching(connectivity='26', process_mid_interface=False)

FastMarching(process_mid_interface)

(2nd form: deprecated constructor, with connectivity 26.)

Parameters:
  • connectivity (with specified) – “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.

  • aims.FastMarching(a0 (aims.FastMarching))

  • aims.FastMarching(a0

  • implementation (Fast marching algorithm)

  • images. (for)

  • to (The fast marching is a propagation algorithm which is typically used)

  • the (perform distance maps. It may use a speed map to locally change)

  • Voronoi (propagation speed and distance. It may also be used to perform a)

  • diagam

  • boundaries. (and to get Voronoi regions)

  • way (It is used the following)

  • object (* instantiate a FastMarching)

  • connectivity

  • needed (* if) – or setInvSpeedMap()

  • setSpeedMap() (set the speed map (or inverse speed map) using) – or setInvSpeedMap()

  • distanc (* propagate using one of the doit() methods. It will return the) – map.

  • voronoiVol() (* Voronoi and boundaries can then be retreived using) – midInterface() or midInterfaceVol()

:param : midInterface() or midInterfaceVol()

clearSpeedMap(self)
doit(self, vol: rc_ptr_Volume_S16, worklabel: int, inlabel: int, outlabel: int) rc_ptr_Volume_FLOAT
doit(vol, worklabel, inlabel, outlabel) None

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)

  • vol – 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 (rc_ptr_Volume_FLOAT) – resulting distance map

  • doit(self, vol (rc_ptr_Volume_S16, worklabels: set_S16, seedlabels: set_S16) -> rc_ptr_Volume_FLOAT)

  • 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.

Returns:

distance_map – resulting distance map

Return type:

rc_ptr_Volume_FLOAT

invSpeedMap(self) rc_ptr_Volume_FLOAT
midInterface(self, label1: int, label2: int) BucketMap_FLOAT
midInterface(label1, label2) None

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 must have taken place.

midInterfaceLabels(self) Tuple
midInterfaceLabels() None

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(self, label1: int, label2: int) rc_ptr_Volume_FLOAT
midInterfaceVol(label1, label2) None

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 must have taken place.

setInvSpeedMap(self, invspeed: rc_ptr_Volume_FLOAT)
setInvSpeedMap(invspeed) None

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(self, speed: rc_ptr_Volume_FLOAT)
setSpeedMap(speed) None

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(self, x: bool)
verbose(self) bool
voronoiVol(self) rc_ptr_Volume_S16
voronoiVol() None

get the resulting Voronoi regions (after propagation)

class soma.aims.FastMarching_BucketMap_S16(connectivity: object = '26', mid_interface: bool = False)
class soma.aims.FastMarching_BucketMap_S16(connectivity='26', process_mid_interface=False)

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.

aims.FastMarching_BucketMap_S16(a0: bool)

aims.FastMarching_BucketMap_S16(a0: aims.FastMarching_BucketMap_S16)

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(self)
doit(self, vol: rc_ptr_BucketMap_S16, worklabel: int, inlabel: int, outlabel: int) rc_ptr_BucketMap_FLOAT
doit(vol, worklabel, inlabel, outlabel) None

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)

  • vol – 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 (rc_ptr_Volume_FLOAT) – resulting distance map

  • doit(self, vol (rc_ptr_BucketMap_S16, worklabels: set_S16, seedlabels: set_S16) -> rc_ptr_BucketMap_FLOAT)

  • 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.

Returns:

distance_map – resulting distance map

Return type:

rc_ptr_Volume_FLOAT

midInterface(self, label1: int, label2: int) BucketMap_FLOAT
midInterface(label1, label2) None

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 must have taken place.

midInterfaceLabels(self) Tuple
midInterfaceLabels() None

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(self, label1: int, label2: int) rc_ptr_Volume_FLOAT
midInterfaceVol(label1, label2) None

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 must have taken place.

setInvSpeedMap(self, invspeed: rc_ptr_BucketMap_FLOAT)
setInvSpeedMap(invspeed) None

Sets an initialized inverse speed map (overrides any previous speed map).

Parameters:

invspeed (rc_ptr_BucketMap_FLOAT)

setSpeedMap(self, speed: rc_ptr_BucketMap_FLOAT)
setSpeedMap(speed) None

Sets an initialized speed map. The inverse speed will be deduced from it.

Parameters:

speed (rc_ptr_BucketMap_FLOAT)

setVerbose(self, x: bool)
verbose(self) bool
voronoiVol(self) rc_ptr_BucketMap_S16
voronoiVol() None

get the resulting Voronoi regions (after propagation)

class soma.aims.FoldArgOverSegment(g: Graph | None)
class soma.aims.FoldArgOverSegment(a0: aims.FoldArgOverSegment)
dilateBucket(in_: BucketMap_S16) BucketMap_S16 | None
findSplitLine(self, v: Vertex | None, pos: AimsVector_S16_3) rc_ptr_BucketMap_VOID
findSplitLine(self, v: Vertex | None, pos: list_POINT3D) rc_ptr_BucketMap_VOID
findSplitLine(self, v: Vertex | None, pos: list_POINT3DF) rc_ptr_BucketMap_VOID
mergeVertices(self, v1: Vertex | None, v2: Vertex | None)
mergeVertices(v1, v2) None

merge vertices into v1. v2 is removed from the graph.

printSplitInSkeleton(self, skel: rc_ptr_Volume_S16, v1: Vertex | None, v2: Vertex | None)
splitLineOnBucket(bucket: rc_ptr_BucketMap_VOID, pos: list_POINT3D) rc_ptr_BucketMap_VOID
splitSimpleSurface(bucket: rc_ptr_BucketMap_VOID, splitline: rc_ptr_BucketMap_VOID) Tuple
splitVertex(self, v: Vertex | None, splitline: rc_ptr_BucketMap_VOID, minsize: int = 50) Vertex | None
splitVertex(self, v: Vertex | None, pos: AimsVector_S16_3, minsize: int = 50) Vertex | None
splitVertex(self, v: Vertex | None, splitline: list_POINT3D, minsize: int = 50) Vertex | None
splitVertex(self, v: Vertex | None, splitline: list_POINT3DF, minsize: int = 50) Vertex | None
subdivizeGraph(self, piecelength: float = 50, minsize: int = 50, a2: set_VertexPtr | None = None) int
subdivizeVertex(self, v: Vertex | None, piecelength: float = 50, minsize: int = 50, a3: set_VertexPtr | None = None) int
class soma.aims.FoldGraphAttributes(skel: rc_ptr_Volume_S16, graph: Graph, talairachMotion: aims.AffineTransformation3d | None = None, inside: int = 0, outside: int = 11, withmeshes: bool = True, graphversion: vector_S32 = vector_S32())
cleanup(self)
doAll(self)
getBrainDepth(self) rc_ptr_Volume_FLOAT
getBrainDepthGradX(self) rc_ptr_Volume_FLOAT
getBrainDepthGradY(self) rc_ptr_Volume_FLOAT
getBrainDepthGradZ(self) rc_ptr_Volume_FLOAT
getDepth(self) rc_ptr_Volume_S16
getDepthfactor(self) float
getDilatedDepth(self) rc_ptr_Volume_FLOAT
getDilatedDepthGradX(self) rc_ptr_Volume_FLOAT
getDilatedDepthGradY(self) rc_ptr_Volume_FLOAT
getDilatedDepthGradZ(self) rc_ptr_Volume_FLOAT
getNDepth(self) rc_ptr_Volume_S16
greyAndCSFVolumes(self, gw: rc_ptr_Volume_S16, voronoi: rc_ptr_Volume_S16)
makeCorticalRelationAttributes(self)
makeGlobalAttributes(self)
makeJunctionAttributes(self)
makeMeshes(self)
makePliDePassageAttributes(self)
makeSimpleSurfaceAttributes(self)
makeSummaryGlobalAttributes(self)
maxThreads(self) int
mesher(self) Mesher
prepareBrainDepthMap(self)
prepareDepthMap(self)
rebuildCorticalRelations(self) rc_ptr_Volume_S16
setMaxThreads(self, mt: int)

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(self, fm: BucketMap_FLOAT, voronoi: rc_ptr_Volume_S16)
class soma.aims.GradientAdvection
class soma.aims.GradientAdvection(a0: aims.GradientAdvection)
descend_scalar_field(self, seeds: rc_ptr_Volume_S16, field: rc_ptr_Volume_FLOAT) rc_ptr_Volume_S16
doit(self, label_vol: rc_ptr_Volume_S16, gradX: rc_ptr_Volume_FLOAT, gradY: rc_ptr_Volume_FLOAT, gradZ: rc_ptr_Volume_FLOAT, seedlabel: int) rc_ptr_Volume_S16
propagate_all_labels(self, seeds: rc_ptr_Volume_S16, fieldx: rc_ptr_Volume_FLOAT, fieldy: rc_ptr_Volume_FLOAT, fieldz: rc_ptr_Volume_FLOAT) rc_ptr_Volume_S16
setPropagationThreshold(self, a0: float)
setVerbose(self, a0: bool = True)
class soma.aims.MeshInterpoler(source: AimsTimeSurface_3_VOID, dest: AimsTimeSurface_3_VOID)
class soma.aims.MeshInterpoler(a0: aims.MeshInterpoler)
class InterpolationType
project(self)
projectedTriCoord1(self) TimeTexture_FLOAT
projectedTriCoord2(self) TimeTexture_FLOAT
projectedTriCoord3(self) TimeTexture_FLOAT
projectedTriangles(self) TimeTexture_U32
reloadProjectionParams(self, projTriangles: TimeTexture_U32, projTriCoord1: TimeTexture_FLOAT, projTriCoord2: TimeTexture_FLOAT, projTriCoord3: TimeTexture_FLOAT)
resampleMesh(self, sourceshape: AimsTimeSurface_3_VOID) AimsTimeSurface_3_VOID | None
resampleTexture(self, a0: TimeTexture_FLOAT, a1: aims.MeshInterpoler.InterpolationType = aims.MeshInterpoler.Linear) TimeTexture_FLOAT | None
resampleTexture(self, a0: Texture_FLOAT, a1: Texture_FLOAT, a2: int = 0, a3: aims.MeshInterpoler.InterpolationType = aims.MeshInterpoler.Linear) None
resampleTexture(self, a0: TimeTexture_S16, a1: aims.MeshInterpoler.InterpolationType = aims.MeshInterpoler.Linear) TimeTexture_S16 | None
resampleTexture(self, a0: Texture_S16, a1: Texture_S16, a2: int = 0, a3: aims.MeshInterpoler.InterpolationType = aims.MeshInterpoler.Linear) None
resampleTexture(self, a0: TimeTexture_S32, a1: aims.MeshInterpoler.InterpolationType = aims.MeshInterpoler.Linear) TimeTexture_S32 | None
resampleTexture(self, a0: Texture_S32, a1: Texture_S32, a2: int = 0, a3: aims.MeshInterpoler.InterpolationType = aims.MeshInterpoler.Linear) None
resampleTexture(self, a0: TimeTexture_POINT2DF, a1: aims.MeshInterpoler.InterpolationType = aims.MeshInterpoler.Linear) TimeTexture_POINT2DF | None
resampleTexture(self, a0: Texture_POINT2DF, a1: Texture_POINT2DF, a2: int = 0, a3: aims.MeshInterpoler.InterpolationType = aims.MeshInterpoler.Linear) None
setDiscontinuityThresholds(self, xthresh: float, ythresh: float, zthresh: float)
setMeshes(self, source: AimsTimeSurface_3_VOID, dest: AimsTimeSurface_3_VOID)
class soma.aims.RegularBinnedHistogram_FLOAT(bins: int = 0)
class soma.aims.RegularBinnedHistogram_FLOAT(other: aims.RegularBinnedHistogram_FLOAT)
bins(self) int
doit(self, thing: rc_ptr_Volume_FLOAT)
doit(self, thing: rc_ptr_Volume_FLOAT, mini: float, maxi: float) None
maxDataValue(self) float
minDataValue(self) float
setBins(self, bins: int)
unique(self, thing: rc_ptr_Volume_FLOAT, abort_max: int = 0) vector_FLOAT | None

** MESHDISTANCE**

class soma.aims.meshdistance
MeshDilation(mesh: AimsTimeSurface_3_VOID, inittex: TimeTexture_FLOAT, Back: float, For: float, dist: float, connexity: bool) TimeTexture_FLOAT
MeshDilation(mesh: AimsTimeSurface_3_VOID, inittex: TimeTexture_S16, Back: int, For: int, dist: float, connexity: bool) TimeTexture_S16
MeshDistance(mesh: AimsTimeSurface_3_VOID, inittex: TimeTexture_S16, allowUnreached: bool) TimeTexture_FLOAT

dist_tex = MeshDistance(mesh, inittex, allowUnreached)

inittex values have the following meaning:

0: propagation domain n>0: seed (distance 0) -1: forbidden

MeshErosion(mesh: AimsTimeSurface_3_VOID, inittex: TimeTexture_FLOAT, Back: float, For: float, dist: float, connexity: bool) TimeTexture_FLOAT
MeshErosion(mesh: AimsTimeSurface_3_VOID, inittex: TimeTexture_S16, Back: int, For: int, dist: float, connexity: bool) TimeTexture_S16
MeshVoronoi(mesh: AimsTimeSurface_3_VOID, inittex: TimeTexture_S16, dist: float, connexity: bool, object: bool) TimeTexture_S16

MeshVoronoi(mesh: AimsTimeSurface_3_VOID, inittex: TimeTexture_S16, background: int, forbidden: int, dist: float, connexity: bool, object: bool) -> TimeTexture_S16 MeshVoronoi( mesh, inittex, background, forbidden, dist, connexity, object) MeshVoronoi( mesh, inittex, dist, connexity, object )

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:
Returns:

voronoi_texture

Return type:

TimeTexture_S16

MeshVoronoiStepbyStep(mesh: AimsTimeSurface_3_VOID, inittex: TimeTexture_S16, dist: float, connexity: bool, object: bool) TimeTexture_S16
soma.aims.meshdistance.MeshDilation()
soma.aims.meshdistance.MeshDistance()
soma.aims.meshdistance.MeshErosion()
soma.aims.meshdistance.MeshVoronoiStepbyStep()
class soma.aims.GeodesicPath(surface: AimsTimeSurface_3_VOID, method: int, strain: int)

aims.GeodesicPath(surface: AimsTimeSurface_3_VOID, texCurv: TimeTexture_FLOAT, method: int, strain: int) GeodesicPath(surface, texCurv, method, strain) GeodesicPath(surface, method, strain)

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.

  • aims.GeodesicPath(a0 (aims.GeodesicPath))

  • maps (It is possible to get distance)

  • algorithm (using the Dijkstra)

  • 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’)

  • maps

  • points. (or paths between two or more)

distanceMap_1_N_ind(self, source: int, distanceMap: vector_FLOAT, type_distance: int) float | None

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:

float

longestPath_1_N_ind(self, source: int, targets: vector_U32, type_distance: int)
longestPath_1_N_ind(source, targets, type_distance) None
Parameters:
Returns:

  • target (unsigned)

  • length (float)

longestPath_N_N_ind(self, points: vector_U32, type_distance: int)
longestPath_N_N_ind(points, type_distance) None
Parameters:
Returns:

  • s (int)

  • d (int)

  • length (float)

shortestPath_1_1_1_ind(self, source: int, middle: int, target: int) vector_U32
shortestPath_1_1_1_ind(source, middle, target) None
Parameters:
  • source (unsigned)

  • middle (unsigned)

  • target (unsigned)

Returns:

path

Return type:

vector_U32

shortestPath_1_1_ind(self, source: int, target: int) vector_U32
shortestPath_1_1_ind(source, target) None
Parameters:
  • source (unsigned)

  • target (unsigned)

  • source

  • target

  • subset (TimeTexture_S16)

Returns:

  • path (vector_U32)

  • shortestPath_1_1_ind(self, source (int, target: int, subset: TimeTexture_S16) -> vector_U32)

  • shortestPath_1_1_ind(source, target, subset)

Returns:

path

Return type:

vector_U32

shortestPath_1_1_ind_xyz(self, source: int, target: int, indice: vector_U32, coord3D: vector_POINT3DF)
shortestPath_1_1_ind_xyz(source, target, indice, coord3D) None
Parameters:
shortestPath_1_1_len(self, source: int, target: int) float
shortestPath_1_1_len(source, target) None
Parameters:
  • source (unsigned)

  • target (unsigned)

Returns:

length

Return type:

float

shortestPath_1_1_tex(self, source: int, target: int, texturevalue: float, tex: TimeTexture_FLOAT)
shortestPath_1_1_tex(source, target, texturevalue, tex) None
Parameters:
shortestPath_1_N_ind(self, source: int, targets: vector_U32)
shortestPath_1_N_ind(source, targets) None
Parameters:
Returns:

  • target (unsigned)

  • length (float)

class soma.aims.Spam
class soma.aims.Spam(a0: aims.Spam)
class soma.aims.SpamBase
prodlikelihoods(self, X: Volume_DOUBLE, shift: float) Tuple
set_bb_talairach_offset(self, bb_talairach_offset: AimsVector_DOUBLE_3)
set_bb_talairach_size(self, bb_talairach_size: AimsVector_DOUBLE_3)
set_img_density(self, img_density: Volume_FLOAT | None)
class soma.aims.SpamFromLikelihood
class soma.aims.SpamFromLikelihood(a0: aims.SpamFromLikelihood)
class soma.aims.SplineFfd(*args)

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.

composed(self, other: rc_ptr_Transformation3d) rc_ptr_Transformation3d
leftComposed(self, other: rc_ptr_Transformation3d) rc_ptr_Transformation3d
spline3(self, x: float) float
transformDouble(self, x: float, y: float, z: float) AimsVector_DOUBLE_3
class soma.aims.TrilinearFfd(*args)

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.

composed(self, other: rc_ptr_Transformation3d) rc_ptr_Transformation3d
leftComposed(self, other: rc_ptr_Transformation3d) rc_ptr_Transformation3d
transformDouble(self, x: float, y: float, z: float) AimsVector_DOUBLE_3
class soma.aims.BundleTransformer(direct_transformation)

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.

soma.aimsalgo module

soma.aimsalgo.AimsDistanceFrontPropagation(vol: rc_ptr_Volume_S16, val_domain: int, val_outside: int, xm: int, ym: int, zm: int, mult_factor: float, divide: bool)
soma.aimsalgo.AimsDistanceFrontPropagation(vol: rc_ptr_Volume_FLOAT, val_domain: float, val_outside: float, xm: int, ym: int, zm: int, mult_factor: float, divide: bool) None
soma.aimsalgo.AimsMorphoChamferClosing(vol: rc_ptr_Volume_S16, size: float, xmask: int = 3, ymask: int = 3, zmask: int = 3, mult_fact: float = 50) rc_ptr_Volume_S16

Please use preferably MorphoGreyLevel_* classes.

soma.aimsalgo.AimsMorphoChamferDilation(a0: rc_ptr_Volume_S16, a1: float, a2: int = 3, a3: int = 3, a4: int = 3, a5: float = 50) rc_ptr_Volume_S16

Please use preferably MorphoGreyLevel_* classes.

soma.aimsalgo.AimsMorphoChamferErosion(a0: rc_ptr_Volume_S16, a1: float, a2: int = 3, a3: int = 3, a4: int = 3, a5: float = 50) rc_ptr_Volume_S16

Please use preferably MorphoGreyLevel_* classes.

soma.aimsalgo.AimsMorphoChamferOpening(vol: rc_ptr_Volume_S16, size: float, xmask: int = 3, ymask: int = 3, zmask: int = 3, mult_fact: float = 50) rc_ptr_Volume_S16

Please use preferably MorphoGreyLevel_* classes.

soma.aimsalgo.AimsMorphoClosing(a0: rc_ptr_Volume_S16, a1: float, a2: AimsMorphoMode = AIMS_CHAMFER_BALL_3D) rc_ptr_Volume_S16
soma.aimsalgo.AimsMorphoDilation(a0: rc_ptr_Volume_S16, a1: float, a2: AimsMorphoMode = AIMS_CHAMFER_BALL_3D) rc_ptr_Volume_S16
soma.aimsalgo.AimsMorphoErosion(a0: rc_ptr_Volume_S16, a1: float, a2: AimsMorphoMode = AIMS_CHAMFER_BALL_3D) rc_ptr_Volume_S16
soma.aimsalgo.AimsMorphoOpening(vol: rc_ptr_Volume_S16, size: float, mode: AimsMorphoMode = AIMS_CHAMFER_BALL_3D) rc_ptr_Volume_S16
soma.aimsalgo.AimsVoronoiFrontPropagation(vol: rc_ptr_Volume_S16, val_domain: int, val_outside: int, xm: int, ym: int, zm: int, mult_factor: float) rc_ptr_Volume_S16
soma.aimsalgo.AimsMeshLabelConnectedComponent(mesh: AimsTimeSurface_3_VOID, inittex: TimeTexture_FLOAT, threshold: float, mode: int = 1) TimeTexture_FLOAT | None
soma.aimsalgo.AimsMeshLabelConnectedComponent(mesh: AimsTimeSurface_3_VOID, inittex: TimeTexture_S16, threshold: int, mode: int = 1) TimeTexture_S16 | None
class soma.aimsalgo.DiffusionSmoother_S16(delta_t: float)
class soma.aimsalgo.DiffusionSmoother_S16(a0: DiffusionSmoother_S16)
SetDt(self, Delta_t: float)
doSmoothing(self, ima: rc_ptr_Volume_S16, maxiter: int, verbose: bool = False) rc_ptr_Volume_S16
dt(self) float
optimal(self) bool
removeConstantSources(self)
setConstantSources(self, a0: rc_ptr_Volume_S16, background: int)
class soma.aimsalgo.DiffusionSmoother_FLOAT(delta_t: float)
class soma.aimsalgo.DiffusionSmoother_FLOAT(a0: DiffusionSmoother_FLOAT)
class soma.aimsalgo.Gaussian2DSmoothing_DOUBLE(sx: float = 1, sy: float = 1)
class soma.aimsalgo.Gaussian2DSmoothing_DOUBLE(a0: Gaussian2DSmoothing_DOUBLE)
doit(self, a0: rc_ptr_Volume_DOUBLE) rc_ptr_Volume_DOUBLE
class soma.aimsalgo.Gaussian2DSmoothing_FLOAT(sx: float = 1, sy: float = 1)
class soma.aimsalgo.Gaussian2DSmoothing_FLOAT(a0: Gaussian2DSmoothing_FLOAT)
class soma.aimsalgo.Gaussian2DSmoothing_S16(sx: float = 1, sy: float = 1)
class soma.aimsalgo.Gaussian2DSmoothing_S16(a0: Gaussian2DSmoothing_S16)
class soma.aimsalgo.Gaussian2DSmoothing_S32(sx: float = 1, sy: float = 1)
class soma.aimsalgo.Gaussian2DSmoothing_S32(a0: Gaussian2DSmoothing_S32)
class soma.aimsalgo.Gaussian2DSmoothing_U16(sx: float = 1, sy: float = 1)
class soma.aimsalgo.Gaussian2DSmoothing_U16(a0: Gaussian2DSmoothing_U16)
class soma.aimsalgo.Gaussian2DSmoothing_U32(sx: float = 1, sy: float = 1)
class soma.aimsalgo.Gaussian2DSmoothing_U32(a0: Gaussian2DSmoothing_U32)
class soma.aimsalgo.Gaussian2DSmoothing_U8(sx: float = 1, sy: float = 1)
class soma.aimsalgo.Gaussian2DSmoothing_U8(a0: Gaussian2DSmoothing_U8)
class soma.aimsalgo.Gaussian3DSmoothing_DOUBLE(sx: float = 1, sy: float = 1, sz: float = 1)
class soma.aimsalgo.Gaussian3DSmoothing_DOUBLE(sx=1., sy=1., sz=1.)
Parameters:
  • sx (float) – filter stdev (sigma) on x direction (mm)

  • sy (float) – filter stdev (sigma) on y direction (mm)

  • sz (float) – filter stdev (sigma) on z direction (mm)

  • Gaussian3DSmoothing_DOUBLE(a0 (Gaussian3DSmoothing_DOUBLE))

  • filter (3D Deriche's recursive gaussian smoothing)

doit(self, a0: rc_ptr_Volume_DOUBLE) rc_ptr_Volume_DOUBLE
doit(volume) None

Actually perform the smoothing on the given data.

Parameters:

volume (Volume) – data to be smoothed

Returns:

smoothed – smoothed volume

Return type:

Volume

class soma.aimsalgo.Gaussian3DSmoothing_FLOAT(sx: float = 1, sy: float = 1, sz: float = 1)
class soma.aimsalgo.Gaussian3DSmoothing_FLOAT(sx=1., sy=1., sz=1.)
Parameters:
  • sx (float) – filter stdev (sigma) on x direction (mm)

  • sy (float) – filter stdev (sigma) on y direction (mm)

  • sz (float) – filter stdev (sigma) on z direction (mm)

  • Gaussian3DSmoothing_FLOAT(a0 (Gaussian3DSmoothing_FLOAT))

  • filter (3D Deriche's recursive gaussian smoothing)

class soma.aimsalgo.Gaussian3DSmoothing_S16(sx: float = 1, sy: float = 1, sz: float = 1)
class soma.aimsalgo.Gaussian3DSmoothing_S16(sx=1., sy=1., sz=1.)
Parameters:
  • sx (float) – filter stdev (sigma) on x direction (mm)

  • sy (float) – filter stdev (sigma) on y direction (mm)

  • sz (float) – filter stdev (sigma) on z direction (mm)

  • Gaussian3DSmoothing_S16(a0 (Gaussian3DSmoothing_S16))

  • filter (3D Deriche's recursive gaussian smoothing)

class soma.aimsalgo.Gaussian3DSmoothing_S32(sx: float = 1, sy: float = 1, sz: float = 1)
class soma.aimsalgo.Gaussian3DSmoothing_S32(sx=1., sy=1., sz=1.)
Parameters:
  • sx (float) – filter stdev (sigma) on x direction (mm)

  • sy (float) – filter stdev (sigma) on y direction (mm)

  • sz (float) – filter stdev (sigma) on z direction (mm)

  • Gaussian3DSmoothing_S32(a0 (Gaussian3DSmoothing_S32))

  • filter (3D Deriche's recursive gaussian smoothing)

class soma.aimsalgo.Gaussian3DSmoothing_U16(sx: float = 1, sy: float = 1, sz: float = 1)
class soma.aimsalgo.Gaussian3DSmoothing_U16(sx=1., sy=1., sz=1.)
Parameters:
  • sx (float) – filter stdev (sigma) on x direction (mm)

  • sy (float) – filter stdev (sigma) on y direction (mm)

  • sz (float) – filter stdev (sigma) on z direction (mm)

  • Gaussian3DSmoothing_U16(a0 (Gaussian3DSmoothing_U16))

  • filter (3D Deriche's recursive gaussian smoothing)

class soma.aimsalgo.Gaussian3DSmoothing_U32(sx: float = 1, sy: float = 1, sz: float = 1)
class soma.aimsalgo.Gaussian3DSmoothing_U32(sx=1., sy=1., sz=1.)
Parameters:
  • sx (float) – filter stdev (sigma) on x direction (mm)

  • sy (float) – filter stdev (sigma) on y direction (mm)

  • sz (float) – filter stdev (sigma) on z direction (mm)

  • Gaussian3DSmoothing_U32(a0 (Gaussian3DSmoothing_U32))

  • filter (3D Deriche's recursive gaussian smoothing)

class soma.aimsalgo.Gaussian3DSmoothing_U8(sx: float = 1, sy: float = 1, sz: float = 1)
class soma.aimsalgo.Gaussian3DSmoothing_U8(sx=1., sy=1., sz=1.)
Parameters:
  • sx (float) – filter stdev (sigma) on x direction (mm)

  • sy (float) – filter stdev (sigma) on y direction (mm)

  • sz (float) – filter stdev (sigma) on z direction (mm)

  • Gaussian3DSmoothing_U8(a0 (Gaussian3DSmoothing_U8))

  • filter (3D Deriche's recursive gaussian smoothing)

class soma.aimsalgo.GeneralSampler_FLOAT_3
sample(self, a0: aimsalgo.Samplable_FLOAT_3, a1: AimsVector_FLOAT_3, a2: AimsVector_FLOAT_3, a3: AimsVector_FLOAT_3) carto.Object
class soma.aimsalgo.GeometricMoment_DOUBLE(a0: MomentBase.MomentType = MomentBase.Incremental)
class soma.aimsalgo.GeometricMoment_DOUBLE(a0: GeometricMoment_DOUBLE)
doit(self, a0: rc_ptr_Volume_DOUBLE, a1: int = Moment_DOUBLE.mAdd)
doit(self, a0: BucketMap_VOID, a1: int = Moment_DOUBLE.mAdd) None
setMomentType(self, a0: MomentBase.MomentType)
update(self, a0: float, a1: float, a2: float, a3: int = Moment_DOUBLE.mAdd)
class soma.aimsalgo.AimsGradient_FLOAT(type: int = AIMS_GRADIENT_CENTRAL)
class soma.aimsalgo.AimsGradient_FLOAT(a0: AimsGradient_FLOAT)
T(self, data: rc_ptr_Volume_FLOAT) rc_ptr_Volume_FLOAT
X(self, data: rc_ptr_Volume_FLOAT) rc_ptr_Volume_FLOAT
Y(self, data: rc_ptr_Volume_FLOAT) rc_ptr_Volume_FLOAT
Z(self, data: rc_ptr_Volume_FLOAT) rc_ptr_Volume_FLOAT
class soma.aimsalgo.Histogram_FLOAT
class soma.aimsalgo.Histogram_FLOAT(other: Histogram_FLOAT)
data(self) rc_ptr_Volume_S32
doit(self, a0: rc_ptr_Volume_FLOAT)
class soma.aimsalgo.MedianSmoothing_DOUBLE(sx: int = 3, sy: int = 3, sz: int = 3)
class soma.aimsalgo.MedianSmoothing_DOUBLE(a0: MedianSmoothing_DOUBLE)
doit(self, in_: rc_ptr_Volume_DOUBLE) rc_ptr_Volume_DOUBLE
class soma.aimsalgo.MedianSmoothing_FLOAT(sx: int = 3, sy: int = 3, sz: int = 3)
class soma.aimsalgo.MedianSmoothing_FLOAT(a0: MedianSmoothing_FLOAT)
class soma.aimsalgo.MedianSmoothing_S16(sx: int = 3, sy: int = 3, sz: int = 3)
class soma.aimsalgo.MedianSmoothing_S16(a0: MedianSmoothing_S16)
class soma.aimsalgo.MedianSmoothing_S32(sx: int = 3, sy: int = 3, sz: int = 3)
class soma.aimsalgo.MedianSmoothing_S32(a0: MedianSmoothing_S32)
class soma.aimsalgo.MedianSmoothing_U16(sx: int = 3, sy: int = 3, sz: int = 3)
class soma.aimsalgo.MedianSmoothing_U16(a0: MedianSmoothing_U16)
class soma.aimsalgo.MedianSmoothing_U32(sx: int = 3, sy: int = 3, sz: int = 3)
class soma.aimsalgo.MedianSmoothing_U32(a0: MedianSmoothing_U32)
class soma.aimsalgo.MedianSmoothing_U8(sx: int = 3, sy: int = 3, sz: int = 3)
class soma.aimsalgo.MedianSmoothing_U8(a0: MedianSmoothing_U8)
class soma.aimsalgo.Mesher

Mesh binary objects in a volume and produce surface meshes.

class SmoothingType
decimate(self, surface: AimsTimeSurface_3_VOID) float
decimate(self, surface: AimsTimeSurface_3_VOID, precthresholds: vector_FLOAT, precisionmap: TimeTexture_FLOAT) float
doit(self, a0: rc_ptr_Volume_S16, a1: object, a2: object = 'binar')
doit(object_to_mesh, filename_base, write_mode='binar') None

Mesh every interface of objects in the input label volume. Each mesh is written in a separate file. Files are numbered according to objects interfaces (label1_label2) and an interface number for this pair of objects. write_mode is an old flag to write files in ascii or binary modes. It’s obsolete.

object_to_mesh may be a volume of int16 values (labels), or a bucket. When meshing a volume, the input volume should have a border of at least 1 voxel, filled with the value -1. If not, a new one will be allocated to perform the operation, thus using more memory and a copy overhead.

doit(self, a0: BucketMap_VOID, a1: object, a2: object = “binar”)

doit(self, thing: rc_ptr_Volume_S16) -> Dict mesh_dict = mesher.doit(object_to_mesh)

Mesh every interface of objects in the input label volume or bucket. The result is a map (dict-like) which keys are voxel labels, and values are lists of meshes.

doit(self, thing: BucketMap_VOID) -> Dict

getBrain(self, a0: rc_ptr_Volume_S16, a1: AimsTimeSurface_3_VOID, insideinterface: bool = False)

getBrain(object_to_mesh, mesh, insideinterface=False)

Get a smoothed mesh of the external (unless insideinterface is True) interface of the biggest object.

object_to_mesh may be a volume of int16 values (labels), or a bucket. When meshing a volume, the input volume should have a border of at least 1 voxel, filled with the value -1. If not, a new one will be allocated to perform the operation, thus using more memory and a copy overhead.

getBrain(self, a0: BucketMap_VOID, a1: AimsTimeSurface_3_VOID, insideinterface: bool = False)

getSingleLabel(self, a0: rc_ptr_Volume_S16, a1: AimsTimeSurface_3_VOID)
getWhite(self, a0: rc_ptr_Volume_S16, a1: AimsTimeSurface_3_VOID)

getWhite(object_to_mesh, mesh)

Get a smoothed mesh of the intternal interface of the biggest object.

object_to_mesh may be a volume of int16 values (labels), or a bucket. When meshing a volume, the input volume should have a border of at least 1 voxel, filled with the value -1. If not, a new one will be allocated to perform the operation, thus using more memory and a copy overhead.

getWhite(self, thing: BucketMap_VOID, surface: AimsTimeSurface_3_VOID)

setDecimation(self, a0: float, a1: float, a2: float, a3: float)
setDecimation(deciReductionRate, deciMaxClearance, deciMaxError,

deciFeatureAngle)

good values: deciReductionRate: 99.0 (%) deciMaxClearance: 3.0 deciMaxError: 0.2 deciFeatureAngle: 180.0 (deg)

setLabelInf(self, a0: int)
setLabelSup(self, a0: int)
setMinFacetNumber(self, a0: int)
setMinSurface(self, a0: float)
setSmoothing(self, smoothType: Mesher.SmoothingType, nIteration: int, smoothRate: float)
setSmoothing(smoothType, nIteration, smoothRate) None

Smoothing parameters

Parameters:
  • smoothType (enum) – LOWPASS, LAPLACIAN, SIMPLESPRING, POLYGONSPRING

  • smoothIt (int) – 30

  • smoothRate (float) – in [0.0;1.0] (instance : 0.4)

setSmoothingLaplacian(self, featureAngle: float)
setSmoothingLaplacian(featureAngle) None

good value: 180. degrees

setSmoothingSpring(self, smoothForce: float)
setSmoothingSpring(smoothForce) None

in [0.0;1.0]. Good value: 0.2

setSplitting(self)
setVerbose(self, a0: bool)
smooth(self, surface: AimsTimeSurface_3_VOID)
unsetDecimation(self)
unsetSmoothing(self)
unsetSplitting(self)
verbose(self) bool
class soma.aimsalgo.MomentInvariant_FLOAT(a0: Moment_FLOAT | None = None)
class soma.aimsalgo.MomentInvariant_FLOAT(a0: MomentInvariant_FLOAT)
class InvariantId
doit(self, a0: AimsTimeSurface_3_VOID)
doit(self, a0: Moment_FLOAT | None) None
invariant(self) vector_DOUBLE | None
moment(self) Moment_FLOAT
update(self, a0: float, a1: float, a2: float, a3: int = Moment_FLOAT.mAdd)
class soma.aimsalgo.Moment_FLOAT
class soma.aimsalgo.Moment_FLOAT(a0: Moment_FLOAT)
class MomentId
class Operation
doit(self, a0: AimsTimeSurface_3_VOID)
doit(self, a0: BucketMap_VOID) None
eigenValue(self) rc_ptr_Volume_DOUBLE
eigenVector(self) rc_ptr_Volume_DOUBLE
gravity(self) vector_DOUBLE | None
m0(self) float
m1(self) vector_DOUBLE | None
m2(self) vector_DOUBLE | None
m3(self) vector_DOUBLE | None
orientation(self)
sum(self) float
class soma.aimsalgo.TriangulationMoment(a0: MomentBase.MomentType = MomentBase.Volumic)
class soma.aimsalgo.TriangulationMoment(a0: TriangulationMoment)
doit(self, a0: AimsTimeSurface_3_VOID)
setMomentType(self, a0: MomentBase.MomentType)
soma.aimsalgo.transformGraph(graph: Graph, direct_transformation: soma.Transformation3d, inverse_transformation: soma.Transformation3d | None, vs: AimsVector_FLOAT_3 = Point3df(0, 0, 0))
transformGraph(graph, direct_transformation, inverse_transformation,

vs=aims.Point3df(0., 0., 0.))

Apply a spatial transformation to all objects contained in a Graph.

The graph is modified in-place.

An inverse transformation is necessary for correctly transforming Buckets (see resampleBucket). If inverse_transformation is NULL, buckets will be transformed with the push-forward method only (transformBucketDirect).

Warning

Volumes are not transformed, neither are graph attributes. Please run AimsFoldArgAtt to fix the values of basic attributes, or the CorticalFoldsGraphUpgradeFromOld BrainVisa process, which can be found under Morphologist/Sulci/graphmanipulation, for a complete update.

soma.aimsalgo.transformMesh(mesh: AimsTimeSurface_2_VOID, direct_transformation: soma.Transformation3d)
soma.aimsalgo.transformMesh(mesh, direct_transformation) None

Apply a spatial transformation to a segments mesh (AimsTimeSurface).

The mesh is transformed in-place and modified.

Each vertex of the mesh is transformed according to the supplied transformation. Normals are re-calculated from the new vertex positions.

transformMesh(mesh: AimsTimeSurface_3_VOID, direct_transformation: soma.Transformation3d) transformMesh(mesh, direct_transformation)

Apply a spatial transformation to a triangles mesh (AimsTimeSurface)

The mesh is transformed in-place and modified.

Each vertex of the mesh is transformed according to the supplied transformation. Normals are re-calculated from the new vertex positions.

transformMesh(mesh: AimsTimeSurface_4_VOID, direct_transformation: soma.Transformation3d) transformMesh(mesh, direct_transformation)

Apply a spatial transformation to a quads mesh (AimsTimeSurface)

The mesh is transformed in-place and modified.

Each vertex of the mesh is transformed according to the supplied transformation. Normals are re-calculated from the new vertex positions.

soma.aimsalgo.transformBucketDirect(bck: BucketMap_VOID, direct_transformation: soma.Transformation3d, vs: AimsVector_FLOAT_3 = Point3df(0, 0, 0)) rc_ptr_BucketMap_VOID
soma.aimsalgo.transformBucketDirect(bck, direct_transformation, vs=aims.Point3df(0., 0., 0.)) None

Apply a spatial transformation to a BucketMap

Each voxel of the input bucket is transformed with direct_transformation, and the closest voxel of the output bucket is set. The voxel size of the output bucket can optionally be specified in vs. By default, the same voxel size as the input bucket is used.

Warning

This method provides no guarantees of topology preservation; in fact it will create holes in the resulting bucket, particularly when upsampling. When possible, you should use resampleBucket() instead, which performs nearest-neighbour resampling.

soma.aimsalgo.resampleBucket(bck: BucketMap_VOID, direct_transformation: soma.Transformation3d, inverse_transformation: soma.Transformation3d, vs: AimsVector_FLOAT_3 = Point3df(0, 0, 0), also_pushforward: bool = True) rc_ptr_BucketMap_VOID
resampleBucket(bck, direct_transformation, inverse_transformation,

vs=aims.Point3df(0., 0., 0.), also_pushforward=True)

Apply a spatial transformation to a BucketMap.

The bucket is transformed by resampling, using a pull-back method in the same way as nearest neighbour resampling of a Volume.

Pure pull-back resampling does not behave well when downsampling (it introduces holes), so by default this function returns the union of voxels transformed using the pushforward and pullback methods. Set also_pushforward to false to disable this behaviour and only perform pure pullback.

The voxel size of the output bucket can optionally be specified in vs. By default, the same voxel size as the input bucket is used.

Warning

Alhtough this method is more reliable than transformBucketDirect, it still provides no guarantees of topology preservation.

soma.aimsalgo.AimsChamferDistanceMap(vol: rc_ptr_Volume_S16, xmask: int = 3, ymask: int = 3, zmask: int = 3, mult_factor: float = 50) rc_ptr_Volume_S16
soma.aimsalgo.AimsConnectivityChamferDistanceMap(vol: rc_ptr_Volume_S16, type: aims.Connectivity.Type) rc_ptr_Volume_S16
soma.aimsalgo.AimsCorrelationRatio(p1: rc_ptr_Volume_FLOAT, p2: rc_ptr_Volume_FLOAT, p12: rc_ptr_Volume_FLOAT) float
soma.aimsalgo.AimsDistanceFrontPropagation(vol: rc_ptr_Volume_S16, val_domain: int, val_outside: int, xm: int, ym: int, zm: int, mult_factor: float, divide: bool)
soma.aimsalgo.AimsDistanceFrontPropagation(vol: rc_ptr_Volume_FLOAT, val_domain: float, val_outside: float, xm: int, ym: int, zm: int, mult_factor: float, divide: bool) None
soma.aimsalgo.AimsEntropy(p: rc_ptr_Volume_FLOAT) float
soma.aimsalgo.AimsFloatChamferDistanceMap(vol: rc_ptr_Volume_S16, side: int = AIMS_CHAMFER_OUTSIDE, xsize: int = 3, ysize: int = 3, zsize: int = 3, mult_factor: float = 50) rc_ptr_Volume_FLOAT
soma.aimsalgo.AimsFloatSignedChamferDistanceMap(vol: rc_ptr_Volume_S16, xsize: int = 3, ysize: int = 3, zsize: int = 3, mult_factor: float = 50) rc_ptr_Volume_FLOAT
soma.aimsalgo.AimsGeneralizedKnnParzenPdf(db: aims.knn.Database, pdf: rc_ptr_Volume_FLOAT, k: int)
class soma.aimsalgo.AimsGradientMethod
class soma.aimsalgo.AimsGradient_FLOAT(type: int = AIMS_GRADIENT_CENTRAL)
class soma.aimsalgo.AimsGradient_FLOAT(a0: AimsGradient_FLOAT)
T(self, data: rc_ptr_Volume_FLOAT) rc_ptr_Volume_FLOAT
X(self, data: rc_ptr_Volume_FLOAT) rc_ptr_Volume_FLOAT
Y(self, data: rc_ptr_Volume_FLOAT) rc_ptr_Volume_FLOAT
Z(self, data: rc_ptr_Volume_FLOAT) rc_ptr_Volume_FLOAT
soma.aimsalgo.AimsJointMaskPdf(data1: rc_ptr_Volume_S16, data2: rc_ptr_Volume_S16, p12: rc_ptr_Volume_FLOAT, p1: rc_ptr_Volume_FLOAT, p2: rc_ptr_Volume_FLOAT)
soma.aimsalgo.AimsJointPdf(data1: rc_ptr_Volume_S16, data2: rc_ptr_Volume_S16, p12: rc_ptr_Volume_FLOAT, p1: rc_ptr_Volume_FLOAT, p2: rc_ptr_Volume_FLOAT)
soma.aimsalgo.AimsKnnPdf(db: aims.knn.Database, pdf: rc_ptr_Volume_FLOAT, k: int)
soma.aimsalgo.AimsMeshFilterConnectedComponent(mesh: AimsTimeSurface_3_VOID, inittex: TimeTexture_S16, label: int, background: int = 0, ncomp: int = 1, min_npts: int = 0, min_surf: float = 0) TimeTexture_S16
out_tex = AimsMeshFilterConnectedComponent(mesh, inittex, label, background=0,

ncomp=1, min_npts=0, min_surf=0.)

Split label “label” into connected components, then filter smaller ones out. Original values are left unchanged, except for filtered out regions which will be given the label “background” (0 by default).

Filtering can keep the “ncomp” largest components, and suppress regions with fewer than “min_npts” vertices, and regions under the surface area “min_surf”. If any of these criterions is 0, then filtering for this criterion doesn’t happen.

AimsMeshFilterConnectedComponent(mesh: AimsTimeSurface_3_VOID, inittex: TimeTexture_S32, label: int, background: int = 0, ncomp: int = 1, min_npts: int = 0, min_surf: float = 0) -> TimeTexture_S32 out_tex = AimsMeshFilterConnectedComponent(mesh, inittex, label, background=0,

ncomp=1, min_npts=0, min_surf=0.)

Split label “label” into connected components, then filter smaller ones out. Original values are left unchanged, except for filtered out regions which will be given the label “background” (0 by default).

Filtering can keep the “ncomp” largest components, and suppress regions with fewer than “min_npts” vertices, and regions under the surface area “min_surf”. If any of these criterions is 0, then filtering for this criterion doesn’t happen.

AimsMeshFilterConnectedComponent(mesh: AimsTimeSurface_3_VOID, inittex: TimeTexture_FLOAT, label: float, background: float = 0, ncomp: int = 1, min_npts: int = 0, min_surf: float = 0) -> TimeTexture_FLOAT out_tex = AimsMeshFilterConnectedComponent(mesh, inittex, label, background=0,

ncomp=1, min_npts=0, min_surf=0.)

Split label “label” into connected components, then filter smaller ones out. Original values are left unchanged, except for filtered out regions which will be given the label “background” (0 by default).

Filtering can keep the “ncomp” largest components, and suppress regions with fewer than “min_npts” vertices, and regions under the surface area “min_surf”. If any of these criterions is 0, then filtering for this criterion doesn’t happen.

soma.aimsalgo.AimsMeshLabelConnectedComponent(mesh: AimsTimeSurface_3_VOID, inittex: TimeTexture_FLOAT, threshold: float, mode: int = 1) TimeTexture_FLOAT | None
soma.aimsalgo.AimsMeshLabelConnectedComponent(mesh: AimsTimeSurface_3_VOID, inittex: TimeTexture_S16, threshold: int, mode: int = 1) TimeTexture_S16 | None
soma.aimsalgo.AimsMeshLabelConnectedComponent2Texture(mesh: AimsTimeSurface_3_VOID, inittex: TimeTexture_FLOAT, threshold: float) TimeTexture_FLOAT | None
soma.aimsalgo.AimsMeshLabelConnectedComponent2Texture(mesh: AimsTimeSurface_3_VOID, inittex: TimeTexture_S16, threshold: int) TimeTexture_S16 | None
soma.aimsalgo.AimsMorphoChamferClosing(vol: rc_ptr_Volume_S16, size: float, xmask: int = 3, ymask: int = 3, zmask: int = 3, mult_fact: float = 50) rc_ptr_Volume_S16
soma.aimsalgo.AimsMorphoChamferDilation(a0: rc_ptr_Volume_S16, a1: float, a2: int = 3, a3: int = 3, a4: int = 3, a5: float = 50) rc_ptr_Volume_S16
soma.aimsalgo.AimsMorphoChamferErosion(a0: rc_ptr_Volume_S16, a1: float, a2: int = 3, a3: int = 3, a4: int = 3, a5: float = 50) rc_ptr_Volume_S16
soma.aimsalgo.AimsMorphoChamferOpening(vol: rc_ptr_Volume_S16, size: float, xmask: int = 3, ymask: int = 3, zmask: int = 3, mult_fact: float = 50) rc_ptr_Volume_S16
soma.aimsalgo.AimsMorphoClosing(a0: rc_ptr_Volume_S16, a1: float, a2: AimsMorphoMode = AIMS_CHAMFER_BALL_3D) rc_ptr_Volume_S16
soma.aimsalgo.AimsMorphoDilation(a0: rc_ptr_Volume_S16, a1: float, a2: AimsMorphoMode = AIMS_CHAMFER_BALL_3D) rc_ptr_Volume_S16
soma.aimsalgo.AimsMorphoErosion(a0: rc_ptr_Volume_S16, a1: float, a2: AimsMorphoMode = AIMS_CHAMFER_BALL_3D) rc_ptr_Volume_S16
class soma.aimsalgo.AimsMorphoMode
soma.aimsalgo.AimsMorphoOpening(vol: rc_ptr_Volume_S16, size: float, mode: AimsMorphoMode = AIMS_CHAMFER_BALL_3D) rc_ptr_Volume_S16
soma.aimsalgo.AimsMutualInformation(p1: rc_ptr_Volume_FLOAT, p2: rc_ptr_Volume_FLOAT, p12: rc_ptr_Volume_FLOAT) float
soma.aimsalgo.AimsParzenJointPdf(data1: rc_ptr_Volume_S16, data2: rc_ptr_Volume_S16, p12: rc_ptr_Volume_FLOAT, p1: rc_ptr_Volume_FLOAT, p2: rc_ptr_Volume_FLOAT)
soma.aimsalgo.AimsParzenPdf(data: rc_ptr_Volume_S16, p: rc_ptr_Volume_FLOAT)
soma.aimsalgo.AimsPdf(data: rc_ptr_Volume_S16, p: rc_ptr_Volume_FLOAT)
soma.aimsalgo.AimsVoronoiFrontPropagation(vol: rc_ptr_Volume_S16, val_domain: int, val_outside: int, xm: int, ym: int, zm: int, mult_factor: float) rc_ptr_Volume_S16
soma.aimsalgo.AimsWinParzenJointPdf(data1: rc_ptr_Volume_S16, data2: rc_ptr_Volume_S16, p12: rc_ptr_Volume_FLOAT, p1: rc_ptr_Volume_FLOAT, p2: rc_ptr_Volume_FLOAT, mask: rc_ptr_Volume_FLOAT)
soma.aimsalgo.AimsWinParzenPdf(data: rc_ptr_Volume_S16, p: rc_ptr_Volume_FLOAT, mask: rc_ptr_Volume_FLOAT)
class soma.aimsalgo.BucketMapSampler_FLOAT_3
class soma.aimsalgo.BucketMapSampler_FLOAT_3(a0: aimsalgo.BucketMapSampler_FLOAT_3)
sample(self, a0: aimsalgo.Samplable_FLOAT_3, a1: AimsVector_FLOAT_3, a2: AimsVector_FLOAT_3, a3: AimsVector_FLOAT_3) carto.Object
class soma.aimsalgo.CubicResampler_DOUBLE(*args)

Volume resampler using cubic interpolation.

The resampling API is described in the base classes, Resampler_DOUBLE and SplineResampler_DOUBLE.

getOrder(self) int
class soma.aimsalgo.CubicResampler_FLOAT(*args)

Volume resampler using cubic interpolation.

The resampling API is described in the base classes, Resampler_FLOAT and SplineResampler_FLOAT.

getOrder(self) int
class soma.aimsalgo.CubicResampler_HSV(*args)

Volume resampler using cubic interpolation.

The resampling API is described in the base classes, Resampler_HSV and SplineResampler_HSV.

getOrder(self) int
class soma.aimsalgo.CubicResampler_POINT3DF(*args)

Volume resampler using cubic interpolation.

The resampling API is described in the base classes, Resampler_POINT3DF and SplineResampler_POINT3DF.

getOrder(self) int
class soma.aimsalgo.CubicResampler_RGB(*args)

Volume resampler using cubic interpolation.

The resampling API is described in the base classes, Resampler_RGB and SplineResampler_RGB.

getOrder(self) int
class soma.aimsalgo.CubicResampler_RGBA(*args)

Volume resampler using cubic interpolation.

The resampling API is described in the base classes, Resampler_RGBA and SplineResampler_RGBA.

getOrder(self) int
class soma.aimsalgo.CubicResampler_S16(*args)

Volume resampler using cubic interpolation.

The resampling API is described in the base classes, Resampler_S16 and SplineResampler_S16.

getOrder(self) int
class soma.aimsalgo.CubicResampler_S32(*args)

Volume resampler using cubic interpolation.

The resampling API is described in the base classes, Resampler_S32 and SplineResampler_S32.

getOrder(self) int
class soma.aimsalgo.CubicResampler_U16(*args)

Volume resampler using cubic interpolation.

The resampling API is described in the base classes, Resampler_U16 and SplineResampler_U16.

getOrder(self) int
class soma.aimsalgo.CubicResampler_U32(*args)

Volume resampler using cubic interpolation.

The resampling API is described in the base classes, Resampler_U32 and SplineResampler_U32.

getOrder(self) int
class soma.aimsalgo.CubicResampler_U8(*args)

Volume resampler using cubic interpolation.

The resampling API is described in the base classes, Resampler_U8 and SplineResampler_U8.

getOrder(self) int
class soma.aimsalgo.DiffusionSmoother_FLOAT(delta_t: float)
class soma.aimsalgo.DiffusionSmoother_FLOAT(a0: DiffusionSmoother_FLOAT)
SetDt(self, Delta_t: float)
doSmoothing(self, ima: rc_ptr_Volume_FLOAT, maxiter: int, verbose: bool = False) rc_ptr_Volume_FLOAT
dt(self) float
optimal(self) bool
removeConstantSources(self)
setConstantSources(self, a0: rc_ptr_Volume_FLOAT, background: float)
class soma.aimsalgo.DiffusionSmoother_S16(delta_t: float)
class soma.aimsalgo.DiffusionSmoother_S16(a0: DiffusionSmoother_S16)
SetDt(self, Delta_t: float)
doSmoothing(self, ima: rc_ptr_Volume_S16, maxiter: int, verbose: bool = False) rc_ptr_Volume_S16
dt(self) float
optimal(self) bool
removeConstantSources(self)
setConstantSources(self, a0: rc_ptr_Volume_S16, background: int)
class soma.aimsalgo.Gaussian2DSmoothing_DOUBLE(sx: float = 1, sy: float = 1)
class soma.aimsalgo.Gaussian2DSmoothing_DOUBLE(a0: Gaussian2DSmoothing_DOUBLE)
doit(self, a0: rc_ptr_Volume_DOUBLE) rc_ptr_Volume_DOUBLE
class soma.aimsalgo.Gaussian2DSmoothing_FLOAT(sx: float = 1, sy: float = 1)
class soma.aimsalgo.Gaussian2DSmoothing_FLOAT(a0: Gaussian2DSmoothing_FLOAT)
doit(self, a0: rc_ptr_Volume_FLOAT) rc_ptr_Volume_FLOAT
class soma.aimsalgo.Gaussian2DSmoothing_S16(sx: float = 1, sy: float = 1)
class soma.aimsalgo.Gaussian2DSmoothing_S16(a0: Gaussian2DSmoothing_S16)
doit(self, a0: rc_ptr_Volume_S16) rc_ptr_Volume_S16
class soma.aimsalgo.Gaussian2DSmoothing_S32(sx: float = 1, sy: float = 1)
class soma.aimsalgo.Gaussian2DSmoothing_S32(a0: Gaussian2DSmoothing_S32)
doit(self, a0: rc_ptr_Volume_S32) rc_ptr_Volume_S32
class soma.aimsalgo.Gaussian2DSmoothing_U16(sx: float = 1, sy: float = 1)
class soma.aimsalgo.Gaussian2DSmoothing_U16(a0: Gaussian2DSmoothing_U16)
doit(self, a0: rc_ptr_Volume_U16) rc_ptr_Volume_U16
class soma.aimsalgo.Gaussian2DSmoothing_U32(sx: float = 1, sy: float = 1)
class soma.aimsalgo.Gaussian2DSmoothing_U32(a0: Gaussian2DSmoothing_U32)
doit(self, a0: rc_ptr_Volume_U32) rc_ptr_Volume_U32
class soma.aimsalgo.Gaussian2DSmoothing_U8(sx: float = 1, sy: float = 1)
class soma.aimsalgo.Gaussian2DSmoothing_U8(a0: Gaussian2DSmoothing_U8)
doit(self, a0: rc_ptr_Volume_U8) rc_ptr_Volume_U8
class soma.aimsalgo.Gaussian3DSmoothing_DOUBLE(sx: float = 1, sy: float = 1, sz: float = 1)
class soma.aimsalgo.Gaussian3DSmoothing_DOUBLE(sx=1., sy=1., sz=1.)
Parameters:
  • sx (float) – filter stdev (sigma) on x direction (mm)

  • sy (float) – filter stdev (sigma) on y direction (mm)

  • sz (float) – filter stdev (sigma) on z direction (mm)

  • Gaussian3DSmoothing_DOUBLE(a0 (Gaussian3DSmoothing_DOUBLE))

  • filter (3D Deriche's recursive gaussian smoothing)

doit(self, a0: rc_ptr_Volume_DOUBLE) rc_ptr_Volume_DOUBLE
doit(volume) None

Actually perform the smoothing on the given data.

Parameters:

volume (Volume) – data to be smoothed

Returns:

smoothed – smoothed volume

Return type:

Volume

class soma.aimsalgo.Gaussian3DSmoothing_FLOAT(sx: float = 1, sy: float = 1, sz: float = 1)
class soma.aimsalgo.Gaussian3DSmoothing_FLOAT(sx=1., sy=1., sz=1.)
Parameters:
  • sx (float) – filter stdev (sigma) on x direction (mm)

  • sy (float) – filter stdev (sigma) on y direction (mm)

  • sz (float) – filter stdev (sigma) on z direction (mm)

  • Gaussian3DSmoothing_FLOAT(a0 (Gaussian3DSmoothing_FLOAT))

  • filter (3D Deriche's recursive gaussian smoothing)

doit(self, a0: rc_ptr_Volume_FLOAT) rc_ptr_Volume_FLOAT
doit(volume) None

Actually perform the smoothing on the given data.

Parameters:

volume (Volume) – data to be smoothed

Returns:

smoothed – smoothed volume

Return type:

Volume

class soma.aimsalgo.Gaussian3DSmoothing_S16(sx: float = 1, sy: float = 1, sz: float = 1)
class soma.aimsalgo.Gaussian3DSmoothing_S16(sx=1., sy=1., sz=1.)
Parameters:
  • sx (float) – filter stdev (sigma) on x direction (mm)

  • sy (float) – filter stdev (sigma) on y direction (mm)

  • sz (float) – filter stdev (sigma) on z direction (mm)

  • Gaussian3DSmoothing_S16(a0 (Gaussian3DSmoothing_S16))

  • filter (3D Deriche's recursive gaussian smoothing)

doit(self, a0: rc_ptr_Volume_S16) rc_ptr_Volume_S16
doit(volume) None

Actually perform the smoothing on the given data.

Parameters:

volume (Volume) – data to be smoothed

Returns:

smoothed – smoothed volume

Return type:

Volume

class soma.aimsalgo.Gaussian3DSmoothing_S32(sx: float = 1, sy: float = 1, sz: float = 1)
class soma.aimsalgo.Gaussian3DSmoothing_S32(sx=1., sy=1., sz=1.)
Parameters:
  • sx (float) – filter stdev (sigma) on x direction (mm)

  • sy (float) – filter stdev (sigma) on y direction (mm)

  • sz (float) – filter stdev (sigma) on z direction (mm)

  • Gaussian3DSmoothing_S32(a0 (Gaussian3DSmoothing_S32))

  • filter (3D Deriche's recursive gaussian smoothing)

doit(self, a0: rc_ptr_Volume_S32) rc_ptr_Volume_S32
doit(volume) None

Actually perform the smoothing on the given data.

Parameters:

volume (Volume) – data to be smoothed

Returns:

smoothed – smoothed volume

Return type:

Volume

class soma.aimsalgo.Gaussian3DSmoothing_U16(sx: float = 1, sy: float = 1, sz: float = 1)
class soma.aimsalgo.Gaussian3DSmoothing_U16(sx=1., sy=1., sz=1.)
Parameters:
  • sx (float) – filter stdev (sigma) on x direction (mm)

  • sy (float) – filter stdev (sigma) on y direction (mm)

  • sz (float) – filter stdev (sigma) on z direction (mm)

  • Gaussian3DSmoothing_U16(a0 (Gaussian3DSmoothing_U16))

  • filter (3D Deriche's recursive gaussian smoothing)

doit(self, a0: rc_ptr_Volume_U16) rc_ptr_Volume_U16
doit(volume) None

Actually perform the smoothing on the given data.

Parameters:

volume (Volume) – data to be smoothed

Returns:

smoothed – smoothed volume

Return type:

Volume

class soma.aimsalgo.Gaussian3DSmoothing_U32(sx: float = 1, sy: float = 1, sz: float = 1)
class soma.aimsalgo.Gaussian3DSmoothing_U32(sx=1., sy=1., sz=1.)
Parameters:
  • sx (float) – filter stdev (sigma) on x direction (mm)

  • sy (float) – filter stdev (sigma) on y direction (mm)

  • sz (float) – filter stdev (sigma) on z direction (mm)

  • Gaussian3DSmoothing_U32(a0 (Gaussian3DSmoothing_U32))

  • filter (3D Deriche's recursive gaussian smoothing)

doit(self, a0: rc_ptr_Volume_U32) rc_ptr_Volume_U32
doit(volume) None

Actually perform the smoothing on the given data.

Parameters:

volume (Volume) – data to be smoothed

Returns:

smoothed – smoothed volume

Return type:

Volume

class soma.aimsalgo.Gaussian3DSmoothing_U8(sx: float = 1, sy: float = 1, sz: float = 1)
class soma.aimsalgo.Gaussian3DSmoothing_U8(sx=1., sy=1., sz=1.)
Parameters:
  • sx (float) – filter stdev (sigma) on x direction (mm)

  • sy (float) – filter stdev (sigma) on y direction (mm)

  • sz (float) – filter stdev (sigma) on z direction (mm)

  • Gaussian3DSmoothing_U8(a0 (Gaussian3DSmoothing_U8))

  • filter (3D Deriche's recursive gaussian smoothing)

doit(self, a0: rc_ptr_Volume_U8) rc_ptr_Volume_U8
doit(volume) None

Actually perform the smoothing on the given data.

Parameters:

volume (Volume) – data to be smoothed

Returns:

smoothed – smoothed volume

Return type:

Volume

class soma.aimsalgo.GeometricMoment_DOUBLE(a0: MomentBase.MomentType = MomentBase.Incremental)
class soma.aimsalgo.GeometricMoment_DOUBLE(a0: GeometricMoment_DOUBLE)
doit(self, a0: rc_ptr_Volume_DOUBLE, a1: int = Moment_DOUBLE.mAdd)
doit(self, a0: BucketMap_VOID, a1: int = Moment_DOUBLE.mAdd) None
setMomentType(self, a0: MomentBase.MomentType)
update(self, a0: float, a1: float, a2: float, a3: int = Moment_DOUBLE.mAdd)
class soma.aimsalgo.GeometricMoment_FLOAT(a0: MomentBase.MomentType = MomentBase.Incremental)
class soma.aimsalgo.GeometricMoment_FLOAT(a0: GeometricMoment_FLOAT)
doit(self, a0: rc_ptr_Volume_FLOAT, a1: int = Moment_FLOAT.mAdd)
doit(self, a0: BucketMap_VOID, a1: int = Moment_FLOAT.mAdd) None
setMomentType(self, a0: MomentBase.MomentType)
update(self, a0: float, a1: float, a2: float, a3: int = Moment_FLOAT.mAdd)
class soma.aimsalgo.GeometricMoment_S16(a0: MomentBase.MomentType = MomentBase.Incremental)
class soma.aimsalgo.GeometricMoment_S16(a0: GeometricMoment_S16)
doit(self, a0: rc_ptr_Volume_S16, a1: int = Moment_S16.mAdd)
doit(self, a0: BucketMap_VOID, a1: int = Moment_S16.mAdd) None
setMomentType(self, a0: MomentBase.MomentType)
update(self, a0: float, a1: float, a2: float, a3: int = Moment_S16.mAdd)
class soma.aimsalgo.GeometricMoment_S32(a0: MomentBase.MomentType = MomentBase.Incremental)
class soma.aimsalgo.GeometricMoment_S32(a0: GeometricMoment_S32)
doit(self, a0: rc_ptr_Volume_S32, a1: int = Moment_S32.mAdd)
doit(self, a0: BucketMap_VOID, a1: int = Moment_S32.mAdd) None
setMomentType(self, a0: MomentBase.MomentType)
update(self, a0: float, a1: float, a2: float, a3: int = Moment_S32.mAdd)
class soma.aimsalgo.GeometricMoment_U16(a0: MomentBase.MomentType = MomentBase.Incremental)
class soma.aimsalgo.GeometricMoment_U16(a0: GeometricMoment_U16)
doit(self, a0: rc_ptr_Volume_U16, a1: int = Moment_U16.mAdd)
doit(self, a0: BucketMap_VOID, a1: int = Moment_U16.mAdd) None
setMomentType(self, a0: MomentBase.MomentType)
update(self, a0: float, a1: float, a2: float, a3: int = Moment_U16.mAdd)
class soma.aimsalgo.GeometricMoment_U32(a0: MomentBase.MomentType = MomentBase.Incremental)
class soma.aimsalgo.GeometricMoment_U32(a0: GeometricMoment_U32)
doit(self, a0: rc_ptr_Volume_U32, a1: int = Moment_U32.mAdd)
doit(self, a0: BucketMap_VOID, a1: int = Moment_U32.mAdd) None
setMomentType(self, a0: MomentBase.MomentType)
update(self, a0: float, a1: float, a2: float, a3: int = Moment_U32.mAdd)
class soma.aimsalgo.GeometricMoment_U8(a0: MomentBase.MomentType = MomentBase.Incremental)
class soma.aimsalgo.GeometricMoment_U8(a0: GeometricMoment_U8)
doit(self, a0: rc_ptr_Volume_U8, a1: int = Moment_U8.mAdd)
doit(self, a0: BucketMap_VOID, a1: int = Moment_U8.mAdd) None
setMomentType(self, a0: MomentBase.MomentType)
update(self, a0: float, a1: float, a2: float, a3: int = Moment_U8.mAdd)
class soma.aimsalgo.Histogram_DOUBLE
class soma.aimsalgo.Histogram_DOUBLE(other: Histogram_DOUBLE)
data(self) rc_ptr_Volume_S32
doit(self, a0: rc_ptr_Volume_DOUBLE)
class soma.aimsalgo.Histogram_FLOAT
class soma.aimsalgo.Histogram_FLOAT(other: Histogram_FLOAT)
data(self) rc_ptr_Volume_S32
doit(self, a0: rc_ptr_Volume_FLOAT)
class soma.aimsalgo.Histogram_S16
class soma.aimsalgo.Histogram_S16(other: Histogram_S16)
data(self) rc_ptr_Volume_S32
doit(self, a0: rc_ptr_Volume_S16)
class soma.aimsalgo.Histogram_S32
class soma.aimsalgo.Histogram_S32(other: Histogram_S32)
data(self) rc_ptr_Volume_S32
doit(self, a0: rc_ptr_Volume_S32)
class soma.aimsalgo.Histogram_U16
class soma.aimsalgo.Histogram_U16(other: Histogram_U16)
data(self) rc_ptr_Volume_S32
doit(self, a0: rc_ptr_Volume_U16)
class soma.aimsalgo.Histogram_U32
class soma.aimsalgo.Histogram_U32(other: Histogram_U32)
data(self) rc_ptr_Volume_S32
doit(self, a0: rc_ptr_Volume_U32)
class soma.aimsalgo.Histogram_U8
class soma.aimsalgo.Histogram_U8(other: Histogram_U8)
data(self) rc_ptr_Volume_S32
doit(self, a0: rc_ptr_Volume_U8)
class soma.aimsalgo.LinearResampler_DOUBLE(*args)

Volume resampler using linear (order 1) interpolation.

The resampling API is described in the base classes, Resampler_DOUBLE and SplineResampler_DOUBLE.

getOrder(self) int
class soma.aimsalgo.LinearResampler_FLOAT(*args)

Volume resampler using linear (order 1) interpolation.

The resampling API is described in the base classes, Resampler_FLOAT and SplineResampler_FLOAT.

getOrder(self) int
class soma.aimsalgo.LinearResampler_HSV(*args)

Volume resampler using linear (order 1) interpolation.

The resampling API is described in the base classes, Resampler_HSV and SplineResampler_HSV.

getOrder(self) int
class soma.aimsalgo.LinearResampler_POINT3DF(*args)

Volume resampler using linear (order 1) interpolation.

The resampling API is described in the base classes, Resampler_POINT3DF and SplineResampler_POINT3DF.

getOrder(self) int
class soma.aimsalgo.LinearResampler_RGB(*args)

Volume resampler using linear (order 1) interpolation.

The resampling API is described in the base classes, Resampler_RGB and SplineResampler_RGB.

getOrder(self) int
class soma.aimsalgo.LinearResampler_RGBA(*args)

Volume resampler using linear (order 1) interpolation.

The resampling API is described in the base classes, Resampler_RGBA and SplineResampler_RGBA.

getOrder(self) int
class soma.aimsalgo.LinearResampler_S16(*args)

Volume resampler using linear (order 1) interpolation.

The resampling API is described in the base classes, Resampler_S16 and SplineResampler_S16.

getOrder(self) int
class soma.aimsalgo.LinearResampler_S32(*args)

Volume resampler using linear (order 1) interpolation.

The resampling API is described in the base classes, Resampler_S32 and SplineResampler_S32.

getOrder(self) int
class soma.aimsalgo.LinearResampler_U16(*args)

Volume resampler using linear (order 1) interpolation.

The resampling API is described in the base classes, Resampler_U16 and SplineResampler_U16.

getOrder(self) int
class soma.aimsalgo.LinearResampler_U32(*args)

Volume resampler using linear (order 1) interpolation.

The resampling API is described in the base classes, Resampler_U32 and SplineResampler_U32.

getOrder(self) int
class soma.aimsalgo.LinearResampler_U8(*args)

Volume resampler using linear (order 1) interpolation.

The resampling API is described in the base classes, Resampler_U8 and SplineResampler_U8.

getOrder(self) int
class soma.aimsalgo.MajorityLabelResampler_DOUBLE(*args)

Volume resampler using majority vote interpolation.

The resampling API is described in the base classes, Resampler_DOUBLE and SplineResampler_DOUBLE.

getOrder(self) int
class soma.aimsalgo.MajorityLabelResampler_FLOAT(*args)

Volume resampler using majority vote interpolation.

The resampling API is described in the base classes, Resampler_FLOAT and SplineResampler_FLOAT.

getOrder(self) int
class soma.aimsalgo.MajorityLabelResampler_HSV(*args)

Volume resampler using majority vote interpolation.

The resampling API is described in the base classes, Resampler_HSV and SplineResampler_HSV.

getOrder(self) int
class soma.aimsalgo.MajorityLabelResampler_POINT3DF(*args)

Volume resampler using majority vote interpolation.

The resampling API is described in the base classes, Resampler_POINT3DF and SplineResampler_POINT3DF.

getOrder(self) int
class soma.aimsalgo.MajorityLabelResampler_RGB(*args)

Volume resampler using majority vote interpolation.

The resampling API is described in the base classes, Resampler_RGB and SplineResampler_RGB.

getOrder(self) int
class soma.aimsalgo.MajorityLabelResampler_RGBA(*args)

Volume resampler using majority vote interpolation.

The resampling API is described in the base classes, Resampler_RGBA and SplineResampler_RGBA.

getOrder(self) int
class soma.aimsalgo.MajorityLabelResampler_S16(*args)

Volume resampler using majority vote interpolation.

The resampling API is described in the base classes, Resampler_S16 and SplineResampler_S16.

getOrder(self) int
class soma.aimsalgo.MajorityLabelResampler_S32(*args)

Volume resampler using majority vote interpolation.

The resampling API is described in the base classes, Resampler_S32 and SplineResampler_S32.

getOrder(self) int
class soma.aimsalgo.MajorityLabelResampler_U16(*args)

Volume resampler using majority vote interpolation.

The resampling API is described in the base classes, Resampler_U16 and SplineResampler_U16.

getOrder(self) int
class soma.aimsalgo.MajorityLabelResampler_U32(*args)

Volume resampler using majority vote interpolation.

The resampling API is described in the base classes, Resampler_U32 and SplineResampler_U32.

getOrder(self) int
class soma.aimsalgo.MajorityLabelResampler_U8(*args)

Volume resampler using majority vote interpolation.

The resampling API is described in the base classes, Resampler_U8 and SplineResampler_U8.

getOrder(self) int
class soma.aimsalgo.MaskLinearResampler_S16(*args)

Volume resampler using linear (order 1) interpolation.

This resampler shows unreliable behaviour: depending of the platform it does not always resample the last element along each axis correctly. Also, it uses some clever optimizations that do not check for overflow. If you need such a masked resampler, please consider contributing a fixed version.

This resampler will consider input voxels that are equal to -32768 (hard-coded) as masked. The mask value (-32768) will always be returned for any interpolation involving a masked voxel.

The default background value for this resampler is -32768 (same as the mask value).

The resampling API is described in the base class, Resampler_S16.

class soma.aimsalgo.MaskedDiffusionSmoother_FLOAT(delta_t: float, safe: bool = True)
class soma.aimsalgo.MaskedDiffusionSmoother_FLOAT(a0: MaskedDiffusionSmoother_FLOAT)
add_neumann_condition(self, p: AimsVector_FLOAT_3)
doSmoothing(self, ima: rc_ptr_Volume_FLOAT, maxiter: int, verbose: bool = False) rc_ptr_Volume_FLOAT
setMask(self, mask: rc_ptr_Volume_S16, background: int = 0)
class soma.aimsalgo.MaskedDiffusionSmoother_S16(delta_t: float, safe: bool = True)
class soma.aimsalgo.MaskedDiffusionSmoother_S16(a0: MaskedDiffusionSmoother_S16)
add_neumann_condition(self, p: AimsVector_FLOAT_3)
doSmoothing(self, ima: rc_ptr_Volume_S16, maxiter: int, verbose: bool = False) rc_ptr_Volume_S16
setMask(self, mask: rc_ptr_Volume_S16, background: int = 0)
class soma.aimsalgo.MedianResampler_DOUBLE(*args)

Volume resampler using median interpolation.

The resampling API is described in the base classes, Resampler_DOUBLE and SplineResampler_DOUBLE.

getOrder(self) int
class soma.aimsalgo.MedianResampler_FLOAT(*args)

Volume resampler using median interpolation.

The resampling API is described in the base classes, Resampler_FLOAT and SplineResampler_FLOAT.

getOrder(self) int
class soma.aimsalgo.MedianResampler_HSV(*args)

Volume resampler using median interpolation.

The resampling API is described in the base classes, Resampler_HSV and SplineResampler_HSV.

getOrder(self) int
class soma.aimsalgo.MedianResampler_POINT3DF(*args)

Volume resampler using median interpolation.

The resampling API is described in the base classes, Resampler_POINT3DF and SplineResampler_POINT3DF.

getOrder(self) int
class soma.aimsalgo.MedianResampler_RGB(*args)

Volume resampler using median interpolation.

The resampling API is described in the base classes, Resampler_RGB and SplineResampler_RGB.

getOrder(self) int
class soma.aimsalgo.MedianResampler_RGBA(*args)

Volume resampler using median interpolation.

The resampling API is described in the base classes, Resampler_RGBA and SplineResampler_RGBA.

getOrder(self) int
class soma.aimsalgo.MedianResampler_S16(*args)

Volume resampler using median interpolation.

The resampling API is described in the base classes, Resampler_S16 and SplineResampler_S16.

getOrder(self) int
class soma.aimsalgo.MedianResampler_S32(*args)

Volume resampler using median interpolation.

The resampling API is described in the base classes, Resampler_S32 and SplineResampler_S32.

getOrder(self) int
class soma.aimsalgo.MedianResampler_U16(*args)

Volume resampler using median interpolation.

The resampling API is described in the base classes, Resampler_U16 and SplineResampler_U16.

getOrder(self) int
class soma.aimsalgo.MedianResampler_U32(*args)

Volume resampler using median interpolation.

The resampling API is described in the base classes, Resampler_U32 and SplineResampler_U32.

getOrder(self) int
class soma.aimsalgo.MedianResampler_U8(*args)

Volume resampler using median interpolation.

The resampling API is described in the base classes, Resampler_U8 and SplineResampler_U8.

getOrder(self) int
class soma.aimsalgo.MedianSmoothing_DOUBLE(sx: int = 3, sy: int = 3, sz: int = 3)
class soma.aimsalgo.MedianSmoothing_DOUBLE(a0: MedianSmoothing_DOUBLE)
doit(self, in_: rc_ptr_Volume_DOUBLE) rc_ptr_Volume_DOUBLE
class soma.aimsalgo.MedianSmoothing_FLOAT(sx: int = 3, sy: int = 3, sz: int = 3)
class soma.aimsalgo.MedianSmoothing_FLOAT(a0: MedianSmoothing_FLOAT)
doit(self, in_: rc_ptr_Volume_FLOAT) rc_ptr_Volume_FLOAT
class soma.aimsalgo.MedianSmoothing_S16(sx: int = 3, sy: int = 3, sz: int = 3)
class soma.aimsalgo.MedianSmoothing_S16(a0: MedianSmoothing_S16)
doit(self, in_: rc_ptr_Volume_S16) rc_ptr_Volume_S16
class soma.aimsalgo.MedianSmoothing_S32(sx: int = 3, sy: int = 3, sz: int = 3)
class soma.aimsalgo.MedianSmoothing_S32(a0: MedianSmoothing_S32)
doit(self, in_: rc_ptr_Volume_S32) rc_ptr_Volume_S32
class soma.aimsalgo.MedianSmoothing_U16(sx: int = 3, sy: int = 3, sz: int = 3)
class soma.aimsalgo.MedianSmoothing_U16(a0: MedianSmoothing_U16)
doit(self, in_: rc_ptr_Volume_U16) rc_ptr_Volume_U16
class soma.aimsalgo.MedianSmoothing_U32(sx: int = 3, sy: int = 3, sz: int = 3)
class soma.aimsalgo.MedianSmoothing_U32(a0: MedianSmoothing_U32)
doit(self, in_: rc_ptr_Volume_U32) rc_ptr_Volume_U32
class soma.aimsalgo.MedianSmoothing_U8(sx: int = 3, sy: int = 3, sz: int = 3)
class soma.aimsalgo.MedianSmoothing_U8(a0: MedianSmoothing_U8)
doit(self, in_: rc_ptr_Volume_U8) rc_ptr_Volume_U8
class soma.aimsalgo.MeshToVoxelsResampler_BucketMap_VOID
class soma.aimsalgo.MeshToVoxelsResampler_BucketMap_VOID(a0: MeshToVoxelsResampler_BucketMap_VOID)
doit(self, surface: AimsTimeSurface_3_VOID, spacing: float = 1, connexity: int = 26) BucketMap_VOID
class soma.aimsalgo.MeshToVoxelsResampler_rc_ptr_Volume_U32
class soma.aimsalgo.MeshToVoxelsResampler_rc_ptr_Volume_U32(a0: MeshToVoxelsResampler_rc_ptr_Volume_U32)
doit(self, surface: AimsTimeSurface_3_VOID, spacing: float = 1, connexity: int = 26) rc_ptr_Volume_U32
class soma.aimsalgo.Mesher

Mesh binary objects in a volume and produce surface meshes.

class SmoothingType
decimate(self, surface: AimsTimeSurface_3_VOID) float
decimate(self, surface: AimsTimeSurface_3_VOID, precthresholds: vector_FLOAT, precisionmap: TimeTexture_FLOAT) float
doit(self, a0: rc_ptr_Volume_S16, a1: object, a2: object = 'binar')
doit(object_to_mesh, filename_base, write_mode='binar') None

Mesh every interface of objects in the input label volume. Each mesh is written in a separate file. Files are numbered according to objects interfaces (label1_label2) and an interface number for this pair of objects. write_mode is an old flag to write files in ascii or binary modes. It’s obsolete.

object_to_mesh may be a volume of int16 values (labels), or a bucket. When meshing a volume, the input volume should have a border of at least 1 voxel, filled with the value -1. If not, a new one will be allocated to perform the operation, thus using more memory and a copy overhead.

doit(self, a0: BucketMap_VOID, a1: object, a2: object = “binar”)

doit(self, thing: rc_ptr_Volume_S16) -> Dict mesh_dict = mesher.doit(object_to_mesh)

Mesh every interface of objects in the input label volume or bucket. The result is a map (dict-like) which keys are voxel labels, and values are lists of meshes.

doit(self, thing: BucketMap_VOID) -> Dict

getBrain(self, a0: rc_ptr_Volume_S16, a1: AimsTimeSurface_3_VOID, insideinterface: bool = False)

getBrain(object_to_mesh, mesh, insideinterface=False)

Get a smoothed mesh of the external (unless insideinterface is True) interface of the biggest object.

object_to_mesh may be a volume of int16 values (labels), or a bucket. When meshing a volume, the input volume should have a border of at least 1 voxel, filled with the value -1. If not, a new one will be allocated to perform the operation, thus using more memory and a copy overhead.

getBrain(self, a0: BucketMap_VOID, a1: AimsTimeSurface_3_VOID, insideinterface: bool = False)

getSingleLabel(self, a0: rc_ptr_Volume_S16, a1: AimsTimeSurface_3_VOID)
getWhite(self, a0: rc_ptr_Volume_S16, a1: AimsTimeSurface_3_VOID)

getWhite(object_to_mesh, mesh)

Get a smoothed mesh of the intternal interface of the biggest object.

object_to_mesh may be a volume of int16 values (labels), or a bucket. When meshing a volume, the input volume should have a border of at least 1 voxel, filled with the value -1. If not, a new one will be allocated to perform the operation, thus using more memory and a copy overhead.

getWhite(self, thing: BucketMap_VOID, surface: AimsTimeSurface_3_VOID)

setDecimation(self, a0: float, a1: float, a2: float, a3: float)
setDecimation(deciReductionRate, deciMaxClearance, deciMaxError,

deciFeatureAngle)

good values: deciReductionRate: 99.0 (%) deciMaxClearance: 3.0 deciMaxError: 0.2 deciFeatureAngle: 180.0 (deg)

setLabelInf(self, a0: int)
setLabelSup(self, a0: int)
setMinFacetNumber(self, a0: int)
setMinSurface(self, a0: float)
setSmoothing(self, smoothType: Mesher.SmoothingType, nIteration: int, smoothRate: float)
setSmoothing(smoothType, nIteration, smoothRate) None

Smoothing parameters

Parameters:
  • smoothType (enum) – LOWPASS, LAPLACIAN, SIMPLESPRING, POLYGONSPRING

  • smoothIt (int) – 30

  • smoothRate (float) – in [0.0;1.0] (instance : 0.4)

setSmoothingLaplacian(self, featureAngle: float)
setSmoothingLaplacian(featureAngle) None

good value: 180. degrees

setSmoothingSpring(self, smoothForce: float)
setSmoothingSpring(smoothForce) None

in [0.0;1.0]. Good value: 0.2

setSplitting(self)
setVerbose(self, a0: bool)
smooth(self, surface: AimsTimeSurface_3_VOID)
unsetDecimation(self)
unsetSmoothing(self)
unsetSplitting(self)
verbose(self) bool
class soma.aimsalgo.MomentBase
class soma.aimsalgo.MomentBase(a0: MomentBase)
class MomentType
class soma.aimsalgo.MomentInvariant_DOUBLE(a0: Moment_DOUBLE | None = None)
class soma.aimsalgo.MomentInvariant_DOUBLE(a0: MomentInvariant_DOUBLE)
class InvariantId
doit(self, a0: AimsTimeSurface_3_VOID)
doit(self, a0: Moment_DOUBLE | None) None
invariant(self) vector_DOUBLE | None
moment(self) Moment_DOUBLE
update(self, a0: float, a1: float, a2: float, a3: int = Moment_DOUBLE.mAdd)
class soma.aimsalgo.MomentInvariant_FLOAT(a0: Moment_FLOAT | None = None)
class soma.aimsalgo.MomentInvariant_FLOAT(a0: MomentInvariant_FLOAT)
class InvariantId
doit(self, a0: AimsTimeSurface_3_VOID)
doit(self, a0: Moment_FLOAT | None) None
invariant(self) vector_DOUBLE | None
moment(self) Moment_FLOAT
update(self, a0: float, a1: float, a2: float, a3: int = Moment_FLOAT.mAdd)
class soma.aimsalgo.MomentInvariant_S16(a0: Moment_S16 | None = None)
class soma.aimsalgo.MomentInvariant_S16(a0: MomentInvariant_S16)
class InvariantId
doit(self, a0: AimsTimeSurface_3_VOID)
doit(self, a0: Moment_S16 | None) None
invariant(self) vector_DOUBLE | None
moment(self) Moment_S16
update(self, a0: float, a1: float, a2: float, a3: int = Moment_S16.mAdd)
class soma.aimsalgo.MomentInvariant_S32(a0: Moment_S32 | None = None)
class soma.aimsalgo.MomentInvariant_S32(a0: MomentInvariant_S32)
class InvariantId
doit(self, a0: AimsTimeSurface_3_VOID)
doit(self, a0: Moment_S32 | None) None
invariant(self) vector_DOUBLE | None
moment(self) Moment_S32
update(self, a0: float, a1: float, a2: float, a3: int = Moment_S32.mAdd)
class soma.aimsalgo.MomentInvariant_U16(a0: Moment_U16 | None = None)
class soma.aimsalgo.MomentInvariant_U16(a0: MomentInvariant_U16)
class InvariantId
doit(self, a0: AimsTimeSurface_3_VOID)
doit(self, a0: Moment_U16 | None) None
invariant(self) vector_DOUBLE | None
moment(self) Moment_U16
update(self, a0: float, a1: float, a2: float, a3: int = Moment_U16.mAdd)
class soma.aimsalgo.MomentInvariant_U32(a0: Moment_U32 | None = None)
class soma.aimsalgo.MomentInvariant_U32(a0: MomentInvariant_U32)
class InvariantId
doit(self, a0: AimsTimeSurface_3_VOID)
doit(self, a0: Moment_U32 | None) None
invariant(self) vector_DOUBLE | None
moment(self) Moment_U32
update(self, a0: float, a1: float, a2: float, a3: int = Moment_U32.mAdd)
class soma.aimsalgo.MomentInvariant_U8(a0: Moment_U8 | None = None)
class soma.aimsalgo.MomentInvariant_U8(a0: MomentInvariant_U8)
class InvariantId
doit(self, a0: AimsTimeSurface_3_VOID)
doit(self, a0: Moment_U8 | None) None
invariant(self) vector_DOUBLE | None
moment(self) Moment_U8
update(self, a0: float, a1: float, a2: float, a3: int = Moment_U8.mAdd)
class soma.aimsalgo.Moment_DOUBLE
class soma.aimsalgo.Moment_DOUBLE(a0: Moment_DOUBLE)
class MomentId
class Operation
doit(self, a0: AimsTimeSurface_3_VOID)
doit(self, a0: BucketMap_VOID) None
eigenValue(self) rc_ptr_Volume_DOUBLE
eigenVector(self) rc_ptr_Volume_DOUBLE
gravity(self) vector_DOUBLE | None
m0(self) float
m1(self) vector_DOUBLE | None
m2(self) vector_DOUBLE | None
m3(self) vector_DOUBLE | None
orientation(self)
sum(self) float
class soma.aimsalgo.Moment_FLOAT
class soma.aimsalgo.Moment_FLOAT(a0: Moment_FLOAT)
class MomentId
class Operation
doit(self, a0: AimsTimeSurface_3_VOID)
doit(self, a0: BucketMap_VOID) None
eigenValue(self) rc_ptr_Volume_DOUBLE
eigenVector(self) rc_ptr_Volume_DOUBLE
gravity(self) vector_DOUBLE | None
m0(self) float
m1(self) vector_DOUBLE | None
m2(self) vector_DOUBLE | None
m3(self) vector_DOUBLE | None
orientation(self)
sum(self) float
class soma.aimsalgo.Moment_S16
class soma.aimsalgo.Moment_S16(a0: Moment_S16)
class MomentId
class Operation
doit(self, a0: AimsTimeSurface_3_VOID)
doit(self, a0: BucketMap_VOID) None
eigenValue(self) rc_ptr_Volume_DOUBLE
eigenVector(self) rc_ptr_Volume_DOUBLE
gravity(self) vector_DOUBLE | None
m0(self) float
m1(self) vector_DOUBLE | None
m2(self) vector_DOUBLE | None
m3(self) vector_DOUBLE | None
orientation(self)
sum(self) float
class soma.aimsalgo.Moment_S32
class soma.aimsalgo.Moment_S32(a0: Moment_S32)
class MomentId
class Operation
doit(self, a0: AimsTimeSurface_3_VOID)
doit(self, a0: BucketMap_VOID) None
eigenValue(self) rc_ptr_Volume_DOUBLE
eigenVector(self) rc_ptr_Volume_DOUBLE
gravity(self) vector_DOUBLE | None
m0(self) float
m1(self) vector_DOUBLE | None
m2(self) vector_DOUBLE | None
m3(self) vector_DOUBLE | None
orientation(self)
sum(self) float
class soma.aimsalgo.Moment_U16
class soma.aimsalgo.Moment_U16(a0: Moment_U16)
class MomentId
class Operation
doit(self, a0: AimsTimeSurface_3_VOID)
doit(self, a0: BucketMap_VOID) None
eigenValue(self) rc_ptr_Volume_DOUBLE
eigenVector(self) rc_ptr_Volume_DOUBLE
gravity(self) vector_DOUBLE | None
m0(self) float
m1(self) vector_DOUBLE | None
m2(self) vector_DOUBLE | None
m3(self) vector_DOUBLE | None
orientation(self)
sum(self) float
class soma.aimsalgo.Moment_U32
class soma.aimsalgo.Moment_U32(a0: Moment_U32)
class MomentId
class Operation
doit(self, a0: AimsTimeSurface_3_VOID)
doit(self, a0: BucketMap_VOID) None
eigenValue(self) rc_ptr_Volume_DOUBLE
eigenVector(self) rc_ptr_Volume_DOUBLE
gravity(self) vector_DOUBLE | None
m0(self) float
m1(self) vector_DOUBLE | None
m2(self) vector_DOUBLE | None
m3(self) vector_DOUBLE | None
orientation(self)
sum(self) float
class soma.aimsalgo.Moment_U8
class soma.aimsalgo.Moment_U8(a0: Moment_U8)
class MomentId
class Operation
doit(self, a0: AimsTimeSurface_3_VOID)
doit(self, a0: BucketMap_VOID) None
eigenValue(self) rc_ptr_Volume_DOUBLE
eigenVector(self) rc_ptr_Volume_DOUBLE
gravity(self) vector_DOUBLE | None
m0(self) float
m1(self) vector_DOUBLE | None
m2(self) vector_DOUBLE | None
m3(self) vector_DOUBLE | None
orientation(self)
sum(self) float
class soma.aimsalgo.MorphoGreyLevel_DOUBLE

Grey-level mathematical morphology.

when enabled, on binary images, the chamfer-based morphomath is used instead of the grey-level one. This is the default as it is way faster (see setChamferBinaryMorphoEnabled).

In binary mode, the input data (volume) should contain a border of “sufficent” size. The border size will be checked, and a new volume with larger border will be temporarily allocated and used if needed, but it is more efficient (and consumes less memory) if this border is already allocated in the input image.

Grey-level operations do not need a border in input images, the test is included in the algorithm (which makes it even slower).

See the method neededBorderWidth().

This class thus regroups all basic morphological operations, and makes obsolete direct calls to AimsMorphoChamferErosion(), AimsMorphoChamferDilation(), AimsMorphoChamferClosing(), AimsMorphoChamferOpening().

chamferFactor(self) float

chamfer factor is used to store chamfer distances as int with a sufficient precision. Used only in binary operations. The default is 50.

chamferMaskSize(self) AimsVector_S16_3

Get the chamfer mask size used in binary operations. The default is 3x3x3.

Returns:

mask_size – size in the 3 directions, in voxels

Return type:

Point3df

doClosing(self, dataIn: rc_ptr_Volume_DOUBLE, radius: float) rc_ptr_Volume_DOUBLE
doClosing(dataIn, radius) None

Closing operation (dilation + erosion)

Parameters:
  • dataIn (rc_ptr_Volume_DOUBLE) – volume to perform the operation on

  • radius (float) – radius of the morphological operation (in mm)

Returns:

result

Return type:

rc_ptr_Volume_DOUBLE

doDilation(self, dataIn: rc_ptr_Volume_DOUBLE, radius: float) rc_ptr_Volume_DOUBLE
doDilation(dataIn, radius) None

Dilation operation

Parameters:
  • dataIn (rc_ptr_Volume_DOUBLE) – volume to perform the operation on

  • radius (float) – radius of the morphological operation (in mm)

Returns:

result

Return type:

rc_ptr_Volume_DOUBLE

doErosion(self, dataIn: rc_ptr_Volume_DOUBLE, radius: float) rc_ptr_Volume_DOUBLE
doErosion(dataIn, radius) None

Erosion operation

Parameters:
  • dataIn (rc_ptr_Volume_DOUBLE) – volume to perform the operation on

  • radius (float) – radius of the morphological operation (in mm)

Returns:

result

Return type:

rc_ptr_Volume_DOUBLE

doOpening(self, dataIn: rc_ptr_Volume_DOUBLE, radius: float) rc_ptr_Volume_DOUBLE
doOpening(dataIn, radius) None

Opening operation (erosion + dilation)

Parameters:
  • dataIn (rc_ptr_Volume_DOUBLE) – volume to perform the operation on

  • radius (float) – radius of the morphological operation (in mm)

Returns:

result

Return type:

rc_ptr_Volume_DOUBLE

isBinary(a0: rc_ptr_Volume_DOUBLE) bool

Tells if the given volume is considered a binary volume and thus is compatible with binary fast operators.

isChamferBinaryMorphoEnabled(self) bool

True if binary moprhological operations are allowed (when binary input data are detected)

neededBorderWidth(self) int

border width needed to perform chamfer mask operations, in binary mode (int).

setChamferBinaryMorphoEnabled(self, x: bool)
setChamferBinaryMorphoEnabled(enabled) None

Enable or disable binary moprhological operations (when binary input data are detected)

Parameters:

enabled (bool)

setChamferFactor(self, x: float)
setChamferFactor(factor) None

Set the chamfer distance factor, used in binary operations.

setChamferMaskSize(self, p: AimsVector_S16_3)
setChamferMaskSize(size) None

Set the chamfer mask size (for binary operations)

Parameters:

size (Point3d) – mask size triplet, in voxels

class soma.aimsalgo.MorphoGreyLevel_FLOAT

Grey-level mathematical morphology.

when enabled, on binary images, the chamfer-based morphomath is used instead of the grey-level one. This is the default as it is way faster (see setChamferBinaryMorphoEnabled).

In binary mode, the input data (volume) should contain a border of “sufficent” size. The border size will be checked, and a new volume with larger border will be temporarily allocated and used if needed, but it is more efficient (and consumes less memory) if this border is already allocated in the input image.

Grey-level operations do not need a border in input images, the test is included in the algorithm (which makes it even slower).

See the method neededBorderWidth().

This class thus regroups all basic morphological operations, and makes obsolete direct calls to AimsMorphoChamferErosion(), AimsMorphoChamferDilation(), AimsMorphoChamferClosing(), AimsMorphoChamferOpening().

chamferFactor(self) float

chamfer factor is used to store chamfer distances as int with a sufficient precision. Used only in binary operations. The default is 50.

chamferMaskSize(self) AimsVector_S16_3

Get the chamfer mask size used in binary operations. The default is 3x3x3.

Returns:

mask_size – size in the 3 directions, in voxels

Return type:

Point3df

doClosing(self, dataIn: rc_ptr_Volume_FLOAT, radius: float) rc_ptr_Volume_FLOAT
doClosing(dataIn, radius) None

Closing operation (dilation + erosion)

Parameters:
  • dataIn (rc_ptr_Volume_FLOAT) – volume to perform the operation on

  • radius (float) – radius of the morphological operation (in mm)

Returns:

result

Return type:

rc_ptr_Volume_FLOAT

doDilation(self, dataIn: rc_ptr_Volume_FLOAT, radius: float) rc_ptr_Volume_FLOAT
doDilation(dataIn, radius) None

Dilation operation

Parameters:
  • dataIn (rc_ptr_Volume_FLOAT) – volume to perform the operation on

  • radius (float) – radius of the morphological operation (in mm)

Returns:

result

Return type:

rc_ptr_Volume_FLOAT

doErosion(self, dataIn: rc_ptr_Volume_FLOAT, radius: float) rc_ptr_Volume_FLOAT
doErosion(dataIn, radius) None

Erosion operation

Parameters:
  • dataIn (rc_ptr_Volume_FLOAT) – volume to perform the operation on

  • radius (float) – radius of the morphological operation (in mm)

Returns:

result

Return type:

rc_ptr_Volume_FLOAT

doOpening(self, dataIn: rc_ptr_Volume_FLOAT, radius: float) rc_ptr_Volume_FLOAT
doOpening(dataIn, radius) None

Opening operation (erosion + dilation)

Parameters:
  • dataIn (rc_ptr_Volume_FLOAT) – volume to perform the operation on

  • radius (float) – radius of the morphological operation (in mm)

Returns:

result

Return type:

rc_ptr_Volume_FLOAT

isBinary(a0: rc_ptr_Volume_FLOAT) bool

Tells if the given volume is considered a binary volume and thus is compatible with binary fast operators.

isChamferBinaryMorphoEnabled(self) bool

True if binary moprhological operations are allowed (when binary input data are detected)

neededBorderWidth(self) int

border width needed to perform chamfer mask operations, in binary mode (int).

setChamferBinaryMorphoEnabled(self, x: bool)
setChamferBinaryMorphoEnabled(enabled) None

Enable or disable binary moprhological operations (when binary input data are detected)

Parameters:

enabled (bool)

setChamferFactor(self, x: float)
setChamferFactor(factor) None

Set the chamfer distance factor, used in binary operations.

setChamferMaskSize(self, p: AimsVector_S16_3)
setChamferMaskSize(size) None

Set the chamfer mask size (for binary operations)

Parameters:

size (Point3d) – mask size triplet, in voxels

class soma.aimsalgo.MorphoGreyLevel_S16

Grey-level mathematical morphology.

when enabled, on binary images, the chamfer-based morphomath is used instead of the grey-level one. This is the default as it is way faster (see setChamferBinaryMorphoEnabled).

In binary mode, the input data (volume) should contain a border of “sufficent” size. The border size will be checked, and a new volume with larger border will be temporarily allocated and used if needed, but it is more efficient (and consumes less memory) if this border is already allocated in the input image.

Grey-level operations do not need a border in input images, the test is included in the algorithm (which makes it even slower).

See the method neededBorderWidth().

This class thus regroups all basic morphological operations, and makes obsolete direct calls to AimsMorphoChamferErosion(), AimsMorphoChamferDilation(), AimsMorphoChamferClosing(), AimsMorphoChamferOpening().

chamferFactor(self) float

chamfer factor is used to store chamfer distances as int with a sufficient precision. Used only in binary operations. The default is 50.

chamferMaskSize(self) AimsVector_S16_3

Get the chamfer mask size used in binary operations. The default is 3x3x3.

Returns:

mask_size – size in the 3 directions, in voxels

Return type:

Point3df

doClosing(self, dataIn: rc_ptr_Volume_S16, radius: float) rc_ptr_Volume_S16
doClosing(dataIn, radius) None

Closing operation (dilation + erosion)

Parameters:
  • dataIn (rc_ptr_Volume_S16) – volume to perform the operation on

  • radius (float) – radius of the morphological operation (in mm)

Returns:

result

Return type:

rc_ptr_Volume_S16

doDilation(self, dataIn: rc_ptr_Volume_S16, radius: float) rc_ptr_Volume_S16
doDilation(dataIn, radius) None

Dilation operation

Parameters:
  • dataIn (rc_ptr_Volume_S16) – volume to perform the operation on

  • radius (float) – radius of the morphological operation (in mm)

Returns:

result

Return type:

rc_ptr_Volume_S16

doErosion(self, dataIn: rc_ptr_Volume_S16, radius: float) rc_ptr_Volume_S16
doErosion(dataIn, radius) None

Erosion operation

Parameters:
  • dataIn (rc_ptr_Volume_S16) – volume to perform the operation on

  • radius (float) – radius of the morphological operation (in mm)

Returns:

result

Return type:

rc_ptr_Volume_S16

doOpening(self, dataIn: rc_ptr_Volume_S16, radius: float) rc_ptr_Volume_S16
doOpening(dataIn, radius) None

Opening operation (erosion + dilation)

Parameters:
  • dataIn (rc_ptr_Volume_S16) – volume to perform the operation on

  • radius (float) – radius of the morphological operation (in mm)

Returns:

result

Return type:

rc_ptr_Volume_S16

isBinary(a0: rc_ptr_Volume_S16) bool

Tells if the given volume is considered a binary volume and thus is compatible with binary fast operators.

isChamferBinaryMorphoEnabled(self) bool

True if binary moprhological operations are allowed (when binary input data are detected)

neededBorderWidth(self) int

border width needed to perform chamfer mask operations, in binary mode (int).

setChamferBinaryMorphoEnabled(self, x: bool)
setChamferBinaryMorphoEnabled(enabled) None

Enable or disable binary moprhological operations (when binary input data are detected)

Parameters:

enabled (bool)

setChamferFactor(self, x: float)
setChamferFactor(factor) None

Set the chamfer distance factor, used in binary operations.

setChamferMaskSize(self, p: AimsVector_S16_3)
setChamferMaskSize(size) None

Set the chamfer mask size (for binary operations)

Parameters:

size (Point3d) – mask size triplet, in voxels

class soma.aimsalgo.MorphoGreyLevel_S32

Grey-level mathematical morphology.

when enabled, on binary images, the chamfer-based morphomath is used instead of the grey-level one. This is the default as it is way faster (see setChamferBinaryMorphoEnabled).

In binary mode, the input data (volume) should contain a border of “sufficent” size. The border size will be checked, and a new volume with larger border will be temporarily allocated and used if needed, but it is more efficient (and consumes less memory) if this border is already allocated in the input image.

Grey-level operations do not need a border in input images, the test is included in the algorithm (which makes it even slower).

See the method neededBorderWidth().

This class thus regroups all basic morphological operations, and makes obsolete direct calls to AimsMorphoChamferErosion(), AimsMorphoChamferDilation(), AimsMorphoChamferClosing(), AimsMorphoChamferOpening().

chamferFactor(self) float

chamfer factor is used to store chamfer distances as int with a sufficient precision. Used only in binary operations. The default is 50.

chamferMaskSize(self) AimsVector_S16_3

Get the chamfer mask size used in binary operations. The default is 3x3x3.

Returns:

mask_size – size in the 3 directions, in voxels

Return type:

Point3df

doClosing(self, dataIn: rc_ptr_Volume_S32, radius: float) rc_ptr_Volume_S32
doClosing(dataIn, radius) None

Closing operation (dilation + erosion)

Parameters:
  • dataIn (rc_ptr_Volume_S32) – volume to perform the operation on

  • radius (float) – radius of the morphological operation (in mm)

Returns:

result

Return type:

rc_ptr_Volume_S32

doDilation(self, dataIn: rc_ptr_Volume_S32, radius: float) rc_ptr_Volume_S32
doDilation(dataIn, radius) None

Dilation operation

Parameters:
  • dataIn (rc_ptr_Volume_S32) – volume to perform the operation on

  • radius (float) – radius of the morphological operation (in mm)

Returns:

result

Return type:

rc_ptr_Volume_S32

doErosion(self, dataIn: rc_ptr_Volume_S32, radius: float) rc_ptr_Volume_S32
doErosion(dataIn, radius) None

Erosion operation

Parameters:
  • dataIn (rc_ptr_Volume_S32) – volume to perform the operation on

  • radius (float) – radius of the morphological operation (in mm)

Returns:

result

Return type:

rc_ptr_Volume_S32

doOpening(self, dataIn: rc_ptr_Volume_S32, radius: float) rc_ptr_Volume_S32
doOpening(dataIn, radius) None

Opening operation (erosion + dilation)

Parameters:
  • dataIn (rc_ptr_Volume_S32) – volume to perform the operation on

  • radius (float) – radius of the morphological operation (in mm)

Returns:

result

Return type:

rc_ptr_Volume_S32

isBinary(a0: rc_ptr_Volume_S32) bool

Tells if the given volume is considered a binary volume and thus is compatible with binary fast operators.

isChamferBinaryMorphoEnabled(self) bool

True if binary moprhological operations are allowed (when binary input data are detected)

neededBorderWidth(self) int

border width needed to perform chamfer mask operations, in binary mode (int).

setChamferBinaryMorphoEnabled(self, x: bool)
setChamferBinaryMorphoEnabled(enabled) None

Enable or disable binary moprhological operations (when binary input data are detected)

Parameters:

enabled (bool)

setChamferFactor(self, x: float)
setChamferFactor(factor) None

Set the chamfer distance factor, used in binary operations.

setChamferMaskSize(self, p: AimsVector_S16_3)
setChamferMaskSize(size) None

Set the chamfer mask size (for binary operations)

Parameters:

size (Point3d) – mask size triplet, in voxels

class soma.aimsalgo.MorphoGreyLevel_U16

Grey-level mathematical morphology.

when enabled, on binary images, the chamfer-based morphomath is used instead of the grey-level one. This is the default as it is way faster (see setChamferBinaryMorphoEnabled).

In binary mode, the input data (volume) should contain a border of “sufficent” size. The border size will be checked, and a new volume with larger border will be temporarily allocated and used if needed, but it is more efficient (and consumes less memory) if this border is already allocated in the input image.

Grey-level operations do not need a border in input images, the test is included in the algorithm (which makes it even slower).

See the method neededBorderWidth().

This class thus regroups all basic morphological operations, and makes obsolete direct calls to AimsMorphoChamferErosion(), AimsMorphoChamferDilation(), AimsMorphoChamferClosing(), AimsMorphoChamferOpening().

chamferFactor(self) float

chamfer factor is used to store chamfer distances as int with a sufficient precision. Used only in binary operations. The default is 50.

chamferMaskSize(self) AimsVector_S16_3

Get the chamfer mask size used in binary operations. The default is 3x3x3.

Returns:

mask_size – size in the 3 directions, in voxels

Return type:

Point3df

doClosing(self, dataIn: rc_ptr_Volume_U16, radius: float) rc_ptr_Volume_U16
doClosing(dataIn, radius) None

Closing operation (dilation + erosion)

Parameters:
  • dataIn (rc_ptr_Volume_U16) – volume to perform the operation on

  • radius (float) – radius of the morphological operation (in mm)

Returns:

result

Return type:

rc_ptr_Volume_U16

doDilation(self, dataIn: rc_ptr_Volume_U16, radius: float) rc_ptr_Volume_U16
doDilation(dataIn, radius) None

Dilation operation

Parameters:
  • dataIn (rc_ptr_Volume_U16) – volume to perform the operation on

  • radius (float) – radius of the morphological operation (in mm)

Returns:

result

Return type:

rc_ptr_Volume_U16

doErosion(self, dataIn: rc_ptr_Volume_U16, radius: float) rc_ptr_Volume_U16
doErosion(dataIn, radius) None

Erosion operation

Parameters:
  • dataIn (rc_ptr_Volume_U16) – volume to perform the operation on

  • radius (float) – radius of the morphological operation (in mm)

Returns:

result

Return type:

rc_ptr_Volume_U16

doOpening(self, dataIn: rc_ptr_Volume_U16, radius: float) rc_ptr_Volume_U16
doOpening(dataIn, radius) None

Opening operation (erosion + dilation)

Parameters:
  • dataIn (rc_ptr_Volume_U16) – volume to perform the operation on

  • radius (float) – radius of the morphological operation (in mm)

Returns:

result

Return type:

rc_ptr_Volume_U16

isBinary(a0: rc_ptr_Volume_U16) bool

Tells if the given volume is considered a binary volume and thus is compatible with binary fast operators.

isChamferBinaryMorphoEnabled(self) bool

True if binary moprhological operations are allowed (when binary input data are detected)

neededBorderWidth(self) int

border width needed to perform chamfer mask operations, in binary mode (int).

setChamferBinaryMorphoEnabled(self, x: bool)
setChamferBinaryMorphoEnabled(enabled) None

Enable or disable binary moprhological operations (when binary input data are detected)

Parameters:

enabled (bool)

setChamferFactor(self, x: float)
setChamferFactor(factor) None

Set the chamfer distance factor, used in binary operations.

setChamferMaskSize(self, p: AimsVector_S16_3)
setChamferMaskSize(size) None

Set the chamfer mask size (for binary operations)

Parameters:

size (Point3d) – mask size triplet, in voxels

class soma.aimsalgo.MorphoGreyLevel_U32

Grey-level mathematical morphology.

when enabled, on binary images, the chamfer-based morphomath is used instead of the grey-level one. This is the default as it is way faster (see setChamferBinaryMorphoEnabled).

In binary mode, the input data (volume) should contain a border of “sufficent” size. The border size will be checked, and a new volume with larger border will be temporarily allocated and used if needed, but it is more efficient (and consumes less memory) if this border is already allocated in the input image.

Grey-level operations do not need a border in input images, the test is included in the algorithm (which makes it even slower).

See the method neededBorderWidth().

This class thus regroups all basic morphological operations, and makes obsolete direct calls to AimsMorphoChamferErosion(), AimsMorphoChamferDilation(), AimsMorphoChamferClosing(), AimsMorphoChamferOpening().

chamferFactor(self) float

chamfer factor is used to store chamfer distances as int with a sufficient precision. Used only in binary operations. The default is 50.

chamferMaskSize(self) AimsVector_S16_3

Get the chamfer mask size used in binary operations. The default is 3x3x3.

Returns:

mask_size – size in the 3 directions, in voxels

Return type:

Point3df

doClosing(self, dataIn: rc_ptr_Volume_U32, radius: float) rc_ptr_Volume_U32
doClosing(dataIn, radius) None

Closing operation (dilation + erosion)

Parameters:
  • dataIn (rc_ptr_Volume_U32) – volume to perform the operation on

  • radius (float) – radius of the morphological operation (in mm)

Returns:

result

Return type:

rc_ptr_Volume_U32

doDilation(self, dataIn: rc_ptr_Volume_U32, radius: float) rc_ptr_Volume_U32
doDilation(dataIn, radius) None

Dilation operation

Parameters:
  • dataIn (rc_ptr_Volume_U32) – volume to perform the operation on

  • radius (float) – radius of the morphological operation (in mm)

Returns:

result

Return type:

rc_ptr_Volume_U32

doErosion(self, dataIn: rc_ptr_Volume_U32, radius: float) rc_ptr_Volume_U32
doErosion(dataIn, radius) None

Erosion operation

Parameters:
  • dataIn (rc_ptr_Volume_U32) – volume to perform the operation on

  • radius (float) – radius of the morphological operation (in mm)

Returns:

result

Return type:

rc_ptr_Volume_U32

doOpening(self, dataIn: rc_ptr_Volume_U32, radius: float) rc_ptr_Volume_U32
doOpening(dataIn, radius) None

Opening operation (erosion + dilation)

Parameters:
  • dataIn (rc_ptr_Volume_U32) – volume to perform the operation on

  • radius (float) – radius of the morphological operation (in mm)

Returns:

result

Return type:

rc_ptr_Volume_U32

isBinary(a0: rc_ptr_Volume_U32) bool

Tells if the given volume is considered a binary volume and thus is compatible with binary fast operators.

isChamferBinaryMorphoEnabled(self) bool

True if binary moprhological operations are allowed (when binary input data are detected)

neededBorderWidth(self) int

border width needed to perform chamfer mask operations, in binary mode (int).

setChamferBinaryMorphoEnabled(self, x: bool)
setChamferBinaryMorphoEnabled(enabled) None

Enable or disable binary moprhological operations (when binary input data are detected)

Parameters:

enabled (bool)

setChamferFactor(self, x: float)
setChamferFactor(factor) None

Set the chamfer distance factor, used in binary operations.

setChamferMaskSize(self, p: AimsVector_S16_3)
setChamferMaskSize(size) None

Set the chamfer mask size (for binary operations)

Parameters:

size (Point3d) – mask size triplet, in voxels

class soma.aimsalgo.MorphoGreyLevel_U8

Grey-level mathematical morphology.

when enabled, on binary images, the chamfer-based morphomath is used instead of the grey-level one. This is the default as it is way faster (see setChamferBinaryMorphoEnabled).

In binary mode, the input data (volume) should contain a border of “sufficent” size. The border size will be checked, and a new volume with larger border will be temporarily allocated and used if needed, but it is more efficient (and consumes less memory) if this border is already allocated in the input image.

Grey-level operations do not need a border in input images, the test is included in the algorithm (which makes it even slower).

See the method neededBorderWidth().

This class thus regroups all basic morphological operations, and makes obsolete direct calls to AimsMorphoChamferErosion(), AimsMorphoChamferDilation(), AimsMorphoChamferClosing(), AimsMorphoChamferOpening().

chamferFactor(self) float

chamfer factor is used to store chamfer distances as int with a sufficient precision. Used only in binary operations. The default is 50.

chamferMaskSize(self) AimsVector_S16_3

Get the chamfer mask size used in binary operations. The default is 3x3x3.

Returns:

mask_size – size in the 3 directions, in voxels

Return type:

Point3df

doClosing(self, dataIn: rc_ptr_Volume_U8, radius: float) rc_ptr_Volume_U8
doClosing(dataIn, radius) None

Closing operation (dilation + erosion)

Parameters:
  • dataIn (rc_ptr_Volume_U8) – volume to perform the operation on

  • radius (float) – radius of the morphological operation (in mm)

Returns:

result

Return type:

rc_ptr_Volume_U8

doDilation(self, dataIn: rc_ptr_Volume_U8, radius: float) rc_ptr_Volume_U8
doDilation(dataIn, radius) None

Dilation operation

Parameters:
  • dataIn (rc_ptr_Volume_U8) – volume to perform the operation on

  • radius (float) – radius of the morphological operation (in mm)

Returns:

result

Return type:

rc_ptr_Volume_U8

doErosion(self, dataIn: rc_ptr_Volume_U8, radius: float) rc_ptr_Volume_U8
doErosion(dataIn, radius) None

Erosion operation

Parameters:
  • dataIn (rc_ptr_Volume_U8) – volume to perform the operation on

  • radius (float) – radius of the morphological operation (in mm)

Returns:

result

Return type:

rc_ptr_Volume_U8

doOpening(self, dataIn: rc_ptr_Volume_U8, radius: float) rc_ptr_Volume_U8
doOpening(dataIn, radius) None

Opening operation (erosion + dilation)

Parameters:
  • dataIn (rc_ptr_Volume_U8) – volume to perform the operation on

  • radius (float) – radius of the morphological operation (in mm)

Returns:

result

Return type:

rc_ptr_Volume_U8

isBinary(a0: rc_ptr_Volume_U8) bool

Tells if the given volume is considered a binary volume and thus is compatible with binary fast operators.

isChamferBinaryMorphoEnabled(self) bool

True if binary moprhological operations are allowed (when binary input data are detected)

neededBorderWidth(self) int

border width needed to perform chamfer mask operations, in binary mode (int).

setChamferBinaryMorphoEnabled(self, x: bool)
setChamferBinaryMorphoEnabled(enabled) None

Enable or disable binary moprhological operations (when binary input data are detected)

Parameters:

enabled (bool)

setChamferFactor(self, x: float)
setChamferFactor(factor) None

Set the chamfer distance factor, used in binary operations.

setChamferMaskSize(self, p: AimsVector_S16_3)
setChamferMaskSize(size) None

Set the chamfer mask size (for binary operations)

Parameters:

size (Point3d) – mask size triplet, in voxels

class soma.aimsalgo.NearestNeighborResampler_DOUBLE(*args)

Volume resampler using nearest-neighbour interpolation.

The Resampling API is described in the base Resampler class.

class soma.aimsalgo.NearestNeighborResampler_FLOAT(*args)

Volume resampler using nearest-neighbour interpolation.

The Resampling API is described in the base Resampler class.

class soma.aimsalgo.NearestNeighborResampler_HSV(*args)

Volume resampler using nearest-neighbour interpolation.

The Resampling API is described in the base Resampler class.

class soma.aimsalgo.NearestNeighborResampler_POINT3DF(*args)

Volume resampler using nearest-neighbour interpolation.

The Resampling API is described in the base Resampler class.

class soma.aimsalgo.NearestNeighborResampler_RGB(*args)

Volume resampler using nearest-neighbour interpolation.

The Resampling API is described in the base Resampler class.

class soma.aimsalgo.NearestNeighborResampler_RGBA(*args)

Volume resampler using nearest-neighbour interpolation.

The Resampling API is described in the base Resampler class.

class soma.aimsalgo.NearestNeighborResampler_S16(*args)

Volume resampler using nearest-neighbour interpolation.

The Resampling API is described in the base Resampler class.

class soma.aimsalgo.NearestNeighborResampler_S32(*args)

Volume resampler using nearest-neighbour interpolation.

The Resampling API is described in the base Resampler class.

class soma.aimsalgo.NearestNeighborResampler_U16(*args)

Volume resampler using nearest-neighbour interpolation.

The Resampling API is described in the base Resampler class.

class soma.aimsalgo.NearestNeighborResampler_U32(*args)

Volume resampler using nearest-neighbour interpolation.

The Resampling API is described in the base Resampler class.

class soma.aimsalgo.NearestNeighborResampler_U8(*args)

Volume resampler using nearest-neighbour interpolation.

The Resampling API is described in the base Resampler class.

class soma.aimsalgo.Polynomial_FLOAT_3(a0: vector_FLOAT | None, a1: float = 1)
class soma.aimsalgo.Polynomial_FLOAT_3(a0: aimsalgo.Polynomial_FLOAT_3)
contains(self, a0: AimsVector_FLOAT_3) bool
displayEquation(self)
getCoefficients(self) vector_FLOAT | None
getOrderStep(self) float
resolve(self, a0: AimsVector_FLOAT_3) float
setCoefficients(self, a0: vector_FLOAT | None)
setOrderStep(self, a0: float)
class soma.aimsalgo.QuarticResampler_DOUBLE(*args)

Volume resampler using quartic (order 4) interpolation.

The resampling API is described in the base classes, Resampler_DOUBLE and SplineResampler_DOUBLE.

getOrder(self) int
class soma.aimsalgo.QuarticResampler_FLOAT(*args)

Volume resampler using quartic (order 4) interpolation.

The resampling API is described in the base classes, Resampler_FLOAT and SplineResampler_FLOAT.

getOrder(self) int
class soma.aimsalgo.QuarticResampler_HSV(*args)

Volume resampler using quartic (order 4) interpolation.

The resampling API is described in the base classes, Resampler_HSV and SplineResampler_HSV.

getOrder(self) int
class soma.aimsalgo.QuarticResampler_POINT3DF(*args)

Volume resampler using quartic (order 4) interpolation.

The resampling API is described in the base classes, Resampler_POINT3DF and SplineResampler_POINT3DF.

getOrder(self) int
class soma.aimsalgo.QuarticResampler_RGB(*args)

Volume resampler using quartic (order 4) interpolation.

The resampling API is described in the base classes, Resampler_RGB and SplineResampler_RGB.

getOrder(self) int
class soma.aimsalgo.QuarticResampler_RGBA(*args)

Volume resampler using quartic (order 4) interpolation.

The resampling API is described in the base classes, Resampler_RGBA and SplineResampler_RGBA.

getOrder(self) int
class soma.aimsalgo.QuarticResampler_S16(*args)

Volume resampler using quartic (order 4) interpolation.

The resampling API is described in the base classes, Resampler_S16 and SplineResampler_S16.

getOrder(self) int
class soma.aimsalgo.QuarticResampler_S32(*args)

Volume resampler using quartic (order 4) interpolation.

The resampling API is described in the base classes, Resampler_S32 and SplineResampler_S32.

getOrder(self) int
class soma.aimsalgo.QuarticResampler_U16(*args)

Volume resampler using quartic (order 4) interpolation.

The resampling API is described in the base classes, Resampler_U16 and SplineResampler_U16.

getOrder(self) int
class soma.aimsalgo.QuarticResampler_U32(*args)

Volume resampler using quartic (order 4) interpolation.

The resampling API is described in the base classes, Resampler_U32 and SplineResampler_U32.

getOrder(self) int
class soma.aimsalgo.QuarticResampler_U8(*args)

Volume resampler using quartic (order 4) interpolation.

The resampling API is described in the base classes, Resampler_U8 and SplineResampler_U8.

getOrder(self) int
class soma.aimsalgo.QuinticResampler_DOUBLE(*args)

Volume resampler using quintic (order 5) interpolation.

The resampling API is described in the base classes Resampler_DOUBLE and SplineResampler_DOUBLE.

getOrder(self) int
class soma.aimsalgo.QuinticResampler_FLOAT(*args)

Volume resampler using quintic (order 5) interpolation.

The resampling API is described in the base classes Resampler_FLOAT and SplineResampler_FLOAT.

getOrder(self) int
class soma.aimsalgo.QuinticResampler_HSV(*args)

Volume resampler using quintic (order 5) interpolation.

The resampling API is described in the base classes Resampler_HSV and SplineResampler_HSV.

getOrder(self) int
class soma.aimsalgo.QuinticResampler_POINT3DF(*args)

Volume resampler using quintic (order 5) interpolation.

The resampling API is described in the base classes Resampler_POINT3DF and SplineResampler_POINT3DF.

getOrder(self) int
class soma.aimsalgo.QuinticResampler_RGB(*args)

Volume resampler using quintic (order 5) interpolation.

The resampling API is described in the base classes Resampler_RGB and SplineResampler_RGB.

getOrder(self) int
class soma.aimsalgo.QuinticResampler_RGBA(*args)

Volume resampler using quintic (order 5) interpolation.

The resampling API is described in the base classes Resampler_RGBA and SplineResampler_RGBA.

getOrder(self) int
class soma.aimsalgo.QuinticResampler_S16(*args)

Volume resampler using quintic (order 5) interpolation.

The resampling API is described in the base classes Resampler_S16 and SplineResampler_S16.

getOrder(self) int
class soma.aimsalgo.QuinticResampler_S32(*args)

Volume resampler using quintic (order 5) interpolation.

The resampling API is described in the base classes Resampler_S32 and SplineResampler_S32.

getOrder(self) int
class soma.aimsalgo.QuinticResampler_U16(*args)

Volume resampler using quintic (order 5) interpolation.

The resampling API is described in the base classes Resampler_U16 and SplineResampler_U16.

getOrder(self) int
class soma.aimsalgo.QuinticResampler_U32(*args)

Volume resampler using quintic (order 5) interpolation.

The resampling API is described in the base classes Resampler_U32 and SplineResampler_U32.

getOrder(self) int
class soma.aimsalgo.QuinticResampler_U8(*args)

Volume resampler using quintic (order 5) interpolation.

The resampling API is described in the base classes Resampler_U8 and SplineResampler_U8.

getOrder(self) int
class soma.aimsalgo.Reader_FfdTransformation

FFD vector field transformation reader. It actually reads a volume of Point3df.

read(self, obj: aims.FfdTransformation, border: int = 0, format: object | None = None, frame: int = -1) bool
read(self, border: int = 0, format: object | None = None, frame: int = 0) aims.FfdTransformation | None
soma.aimsalgo.ResamplerFactory(volume)[source]

Factory function to instantiate a ResamplerFactory_<type> object. It builds from an existing volume to gets its voxel type.

See also

ResamplerFactory_S16, ResamplerFactory_FLOAT etc.

class soma.aimsalgo.Resampler_DOUBLE(*args)

Resampling of data from a volume, applying a transformation.

The doit() and resample() methods can be used to apply an affine transformation (aims::AffineTransformation3d). They take a direct transformation, i.e. the transformation goes from the space of the input image (unit: mm) to the space of the output image (unit: mm). The transformation is inverted and normalized internally as needed, because the resamplers “pull” data by transforming output coordinates into input coordinates.

The doit() methods work on input data passed to the setRef() method. setDefaultValue() can also be called to set the background value.

The resample() methods provide stateless alternatives.

You can also use arbitrary non-affine transformations (inheriting soma::Transformation3d) by using the resample_inv() family of methods. In this case, you must pass the backward transformation (from output space to input space), because of the “pulling” mechanism described above.

Beware that contrary to the other methods, the resample_inv_to_vox() overloads take a transformation that maps to voxel coordinates of the input image. These methods can be slightly faster than resample_inv() because they map directly to the API of the actual resamplers are implementing (doResample()). This is especially true of the overload that performs resampling for a single point only.

defaultValue(self) float
defaultValue() None

Background value used by the doit() methods

Return type:

double

doit(self, transform: aims.AffineTransformation3d, output_data: Volume_DOUBLE)
doit(transform, output_data) None

Resample the input volume set with setRef() into an existing volume.

The background value (to be used for regions that are outside of the input volume) can be set with setDefaultValue().

The transformations, referentials, and referential header attributes of output_data are not touched; it is up to the calling code to update them accordingly.

The level of verbosity is taken from carto::verbose (i.e. the –verbose command-line argument is honoured).

Parameters:
  • transform (AffineTransformation3d) – transformation from coordinates of the input volume (unit: mm), to coordinates of the output volume (unit: mm) (its inverse is used for resampling)

  • output_data (Volume_DOUBLE) – existing volume to be filled with resampled data (its pre-existing dimensions and voxel size are used)

Raises:

RuntimeError – if no input volume has been set with setRef.

doit(self, transform: aims.AffineTransformation3d, dimx: int, dimy: int, dimz: int, voxel_size: AimsVector_FLOAT_3) -> rc_ptr_Volume_DOUBLE doit(transform, dimx, dimy, dimz, voxel_size)

Resample the input volume set with setRef() in a newly allocated volume.

The background value (to be used for regions that are outside of the input volume) can be set with setDefaultValue().

The level of verbosity is taken from carto::verbose (i.e. the –verbose command-line argument is honoured).

The transformations, referentials, and referential header attributes of the new volume are reset if transform.isIdentity() is false:

  • the referential attribute is removed

  • each transformation in transformations is composed with transform so that the output volume still points to the original space. If that is not possible (e.g. the transformations attribute is missing or invalid), then a new transformation is added that points to the input volume.

Parameters:
  • transform (AffineTransformation3d) – transformation from coordinates of the input volume (unit: mm), to coordinates of the output volume (unit: mm) (its inverse is used for resampling)

  • dimX (int) – dimensions of the newly allocated volume

  • dimY (int) – dimensions of the newly allocated volume

  • dimZ (int) – dimensions of the newly allocated volume

  • voxel_size (Point3df (list of 3 floats)) – voxel size of the newly allocated volume (unit: mm)

Returns:

a newly allocated volume containing the resampled data (its size along the t axis is the same as the input volume).

Return type:

Volume_DOUBLE

Raises:

RuntimeError – if no input volume has been set with setRef.:

ref(self) rc_ptr_Volume_DOUBLE
ref() None

Input data to be resampled by the doit() methods

Return type:

Volume_DOUBLE

resample(self, input_data: Volume_DOUBLE, transform: aims.AffineTransformation3d, background: float, output_data: Volume_DOUBLE, verbose: bool = False)
resample(input_data, transform, background, output_data, verbose=False) None

Resample a volume into an existing output volume.

The transformations, referentials, and referential header attributes of output_data are not touched; it is up to the calling code to update them accordingly.

This method does not use the instance state set by setRef() or setDefaultValue().

Derived classes can override this method to optimize interpolation of a full volume. The base class method simply calls doResample for each point.

Parameters:
  • input_data (Volume_DOUBLE) – data to be resampled (its voxel size is taken into account)

  • transform (AffineTransformation3d) – transformation from coordinates of the input volume (unit: mm), to coordinates of the output volume (unit: mm) (its inverse is used for resampling)

  • background (double) – value set in output regions that are outside of the transformed input volume

  • output_data (Volume_DOUBLE) – existing volume to be filled with resampled data (its pre-existing dimensions and voxel size are used)

  • verbose (bool) – print progress to stdout

resample(self, input_data: Volume_DOUBLE, transform: aims.AffineTransformation3d, background: float, output_location: AimsVector_FLOAT_3, timestep: int) -> float resample(input_data, transform, background, output_location, timestep) -> output_value

Resample a volume at a single location.

This method does not use the instance state set by setRef() or setDefaultValue().

Parameters:
  • input_data (Volume_DOUBLE) – data to be resampled (its voxel size is taken into account)

  • transform (AffineTransformation3d) – transformation from coordinates of the input volume (unit: mm), to output coordinates (its inverse is used for resampling)

  • background (double) – value set in output regions that are outside of the transformed input volume

  • output_location (Point3df (list of 3 floats)) – coordinates in output space (destination space of transform)

  • timestep (int) – for 4D volume, time step to be used

Returns:

resampled value

Return type:

double

resample_inv(self, input_data: Volume_DOUBLE, inverse_transform: soma.Transformation3d, background: float, output_data: Volume_DOUBLE, verbose: bool = False)
resample_inv(input_data, inverse_transform, background, output_data, verbose=False) None

Resample a volume into an existing output volume.

The transformations, referentials, and referential header attributes of output_data are not touched; it is up to the calling code to update them accordingly.

This method does not use the instance state set by setRef() or setDefaultValue().

Parameters:
  • input_data (Volume_DOUBLE) – data to be resampled (its voxel size is taken into account)

  • inverse_transform (Transformation3d) – transformation from coordinates of the output volume (unit: mm), to coordinates of the input volume (unit: mm)

  • background (double) – value set in output regions that are outside of the transformed input volume

  • output_data (Volume_DOUBLE) – existing volume to be filled with resampled data (its pre-existing dimensions and voxel size are used)

  • verbose (bool) – print progress to stdout

resample_inv(self, input_data: Volume_DOUBLE, inverse_transform: soma.Transformation3d, background: float, output_location: AimsVector_FLOAT_3, timestep: int) -> float resample_inv(input_data, inverse_transform, background, output_location, timestep) -> output_value

Resample a volume at a single location.

This method does not use the instance state set by setRef() or setDefaultValue().

input_data: Volume_DOUBLE

data to be resampled (its voxel size is taken into account)

inverse_transform: Transformation3d

transformation from output coordinates to coordinates of the input volume (unit: mm)

background: double

value set in output regions that are outside of the transformed input volume

output_location: Point3df (list of 3 floats)

coordinates in output space (destination space of transform)

timestep: int

for 4D volume, time step to be used

Returns:

resampled value

Return type:

double

resample_inv_to_vox(self, input_data: Volume_DOUBLE, inverse_transform_to_vox: soma.Transformation3d, background: float, output_data: Volume_DOUBLE, verbose: bool = False)
resample_inv_to_vox(input_data, inverse_transform_to_vox, background, output_data, verbose=False) None

Resample a volume into an existing output volume.

The transformations, referentials, and referential header attributes of output_data are not touched; it is up to the calling code to update them accordingly.

This method does not use the instance state set by setRef() or setDefaultValue().

Derived classes can override this method to optimize interpolation of a full volume. The base class method simply calls doResample for each point.

Parameters:
  • input_data (Volume_DOUBLE) – data to be resampled (its voxel size is taken into account)

  • inverse_transform_to_vox (Transformation3d) – transformation from coordinates of the output volume (unit: mm), to coordinates of the input volume (unit: voxel)

  • background (double) – value set in output regions that are outside of the transformed input volume

  • output_data (Volume_DOUBLE) – existing volume to be filled with resampled data (its pre-existing dimensions and voxel size are used)

  • verbose (bool) – print progress to stdout

resample_inv_to_vox(self, input_data: Volume_DOUBLE, inverse_transform_to_vox: soma.Transformation3d, background: float, output_location: AimsVector_FLOAT_3, timestep: int) -> float resample_inv_to_vox(input_data, inverse_transform_to_vox, background, output_location, timestep) -> output_value

Resample a volume at a single location.

This method does not use the instance state set by setRef() or setDefaultValue().

input_data: Volume_DOUBLE

data to be resampled (its voxel size is taken into account)

inverse_transform_to_vox: Transformation3d

transformation from output coordinates to coordinates of the input volume (unit: voxel)

background: double

value set in output regions that are outside of the transformed input volume

output_location: Point3df (list of 3 floats)

coordinates in output space (destination space of transform)

timestep: int

for 4D volume, time step to be used

Returns:

resampled value

Return type:

double

setDefaultValue(self, a0: float)
setDefaultValue(value) None

Set the background value to be used by the doit() methods

Parameters:

value (double) – background value

setRef(self, a0: rc_ptr_Volume_DOUBLE)
setRef(input_data) None

Set the input data to be resampled by the doit() methods

Parameters:

input_data (Volume_DOUBLE) – volume to be resampled

class soma.aimsalgo.Resampler_FLOAT(*args)

Resampling of data from a volume, applying a transformation.

The doit() and resample() methods can be used to apply an affine transformation (aims::AffineTransformation3d). They take a direct transformation, i.e. the transformation goes from the space of the input image (unit: mm) to the space of the output image (unit: mm). The transformation is inverted and normalized internally as needed, because the resamplers “pull” data by transforming output coordinates into input coordinates.

The doit() methods work on input data passed to the setRef() method. setDefaultValue() can also be called to set the background value.

The resample() methods provide stateless alternatives.

You can also use arbitrary non-affine transformations (inheriting soma::Transformation3d) by using the resample_inv() family of methods. In this case, you must pass the backward transformation (from output space to input space), because of the “pulling” mechanism described above.

Beware that contrary to the other methods, the resample_inv_to_vox() overloads take a transformation that maps to voxel coordinates of the input image. These methods can be slightly faster than resample_inv() because they map directly to the API of the actual resamplers are implementing (doResample()). This is especially true of the overload that performs resampling for a single point only.

defaultValue(self) float
defaultValue() None

Background value used by the doit() methods

Return type:

float

doit(self, transform: aims.AffineTransformation3d, output_data: Volume_FLOAT)
doit(transform, output_data) None

Resample the input volume set with setRef() into an existing volume.

The background value (to be used for regions that are outside of the input volume) can be set with setDefaultValue().

The transformations, referentials, and referential header attributes of output_data are not touched; it is up to the calling code to update them accordingly.

The level of verbosity is taken from carto::verbose (i.e. the –verbose command-line argument is honoured).

Parameters:
  • transform (AffineTransformation3d) – transformation from coordinates of the input volume (unit: mm), to coordinates of the output volume (unit: mm) (its inverse is used for resampling)

  • output_data (Volume_FLOAT) – existing volume to be filled with resampled data (its pre-existing dimensions and voxel size are used)

Raises:

RuntimeError – if no input volume has been set with setRef.

doit(self, transform: aims.AffineTransformation3d, dimx: int, dimy: int, dimz: int, voxel_size: AimsVector_FLOAT_3) -> rc_ptr_Volume_FLOAT doit(transform, dimx, dimy, dimz, voxel_size)

Resample the input volume set with setRef() in a newly allocated volume.

The background value (to be used for regions that are outside of the input volume) can be set with setDefaultValue().

The level of verbosity is taken from carto::verbose (i.e. the –verbose command-line argument is honoured).

The transformations, referentials, and referential header attributes of the new volume are reset if transform.isIdentity() is false:

  • the referential attribute is removed

  • each transformation in transformations is composed with transform so that the output volume still points to the original space. If that is not possible (e.g. the transformations attribute is missing or invalid), then a new transformation is added that points to the input volume.

Parameters:
  • transform (AffineTransformation3d) – transformation from coordinates of the input volume (unit: mm), to coordinates of the output volume (unit: mm) (its inverse is used for resampling)

  • dimX (int) – dimensions of the newly allocated volume

  • dimY (int) – dimensions of the newly allocated volume

  • dimZ (int) – dimensions of the newly allocated volume

  • voxel_size (Point3df (list of 3 floats)) – voxel size of the newly allocated volume (unit: mm)

Returns:

a newly allocated volume containing the resampled data (its size along the t axis is the same as the input volume).

Return type:

Volume_FLOAT

Raises:

RuntimeError – if no input volume has been set with setRef.:

ref(self) rc_ptr_Volume_FLOAT
ref() None

Input data to be resampled by the doit() methods

Return type:

Volume_FLOAT

resample(self, input_data: Volume_FLOAT, transform: aims.AffineTransformation3d, background: float, output_data: Volume_FLOAT, verbose: bool = False)
resample(input_data, transform, background, output_data, verbose=False) None

Resample a volume into an existing output volume.

The transformations, referentials, and referential header attributes of output_data are not touched; it is up to the calling code to update them accordingly.

This method does not use the instance state set by setRef() or setDefaultValue().

Derived classes can override this method to optimize interpolation of a full volume. The base class method simply calls doResample for each point.

Parameters:
  • input_data (Volume_FLOAT) – data to be resampled (its voxel size is taken into account)

  • transform (AffineTransformation3d) – transformation from coordinates of the input volume (unit: mm), to coordinates of the output volume (unit: mm) (its inverse is used for resampling)

  • background (float) – value set in output regions that are outside of the transformed input volume

  • output_data (Volume_FLOAT) – existing volume to be filled with resampled data (its pre-existing dimensions and voxel size are used)

  • verbose (bool) – print progress to stdout

resample(self, input_data: Volume_FLOAT, transform: aims.AffineTransformation3d, background: float, output_location: AimsVector_FLOAT_3, timestep: int) -> float resample(input_data, transform, background, output_location, timestep) -> output_value

Resample a volume at a single location.

This method does not use the instance state set by setRef() or setDefaultValue().

Parameters:
  • input_data (Volume_FLOAT) – data to be resampled (its voxel size is taken into account)

  • transform (AffineTransformation3d) – transformation from coordinates of the input volume (unit: mm), to output coordinates (its inverse is used for resampling)

  • background (float) – value set in output regions that are outside of the transformed input volume

  • output_location (Point3df (list of 3 floats)) – coordinates in output space (destination space of transform)

  • timestep (int) – for 4D volume, time step to be used

Returns:

resampled value

Return type:

float

resample_inv(self, input_data: Volume_FLOAT, inverse_transform: soma.Transformation3d, background: float, output_data: Volume_FLOAT, verbose: bool = False)
resample_inv(input_data, inverse_transform, background, output_data, verbose=False) None

Resample a volume into an existing output volume.

The transformations, referentials, and referential header attributes of output_data are not touched; it is up to the calling code to update them accordingly.

This method does not use the instance state set by setRef() or setDefaultValue().

Parameters:
  • input_data (Volume_FLOAT) – data to be resampled (its voxel size is taken into account)

  • inverse_transform (Transformation3d) – transformation from coordinates of the output volume (unit: mm), to coordinates of the input volume (unit: mm)

  • background (float) – value set in output regions that are outside of the transformed input volume

  • output_data (Volume_FLOAT) – existing volume to be filled with resampled data (its pre-existing dimensions and voxel size are used)

  • verbose (bool) – print progress to stdout

resample_inv(self, input_data: Volume_FLOAT, inverse_transform: soma.Transformation3d, background: float, output_location: AimsVector_FLOAT_3, timestep: int) -> float resample_inv(input_data, inverse_transform, background, output_location, timestep) -> output_value

Resample a volume at a single location.

This method does not use the instance state set by setRef() or setDefaultValue().

input_data: Volume_FLOAT

data to be resampled (its voxel size is taken into account)

inverse_transform: Transformation3d

transformation from output coordinates to coordinates of the input volume (unit: mm)

background: float

value set in output regions that are outside of the transformed input volume

output_location: Point3df (list of 3 floats)

coordinates in output space (destination space of transform)

timestep: int

for 4D volume, time step to be used

Returns:

resampled value

Return type:

float

resample_inv_to_vox(self, input_data: Volume_FLOAT, inverse_transform_to_vox: soma.Transformation3d, background: float, output_data: Volume_FLOAT, verbose: bool = False)
resample_inv_to_vox(input_data, inverse_transform_to_vox, background, output_data, verbose=False) None

Resample a volume into an existing output volume.

The transformations, referentials, and referential header attributes of output_data are not touched; it is up to the calling code to update them accordingly.

This method does not use the instance state set by setRef() or setDefaultValue().

Derived classes can override this method to optimize interpolation of a full volume. The base class method simply calls doResample for each point.

Parameters:
  • input_data (Volume_FLOAT) – data to be resampled (its voxel size is taken into account)

  • inverse_transform_to_vox (Transformation3d) – transformation from coordinates of the output volume (unit: mm), to coordinates of the input volume (unit: voxel)

  • background (float) – value set in output regions that are outside of the transformed input volume

  • output_data (Volume_FLOAT) – existing volume to be filled with resampled data (its pre-existing dimensions and voxel size are used)

  • verbose (bool) – print progress to stdout

resample_inv_to_vox(self, input_data: Volume_FLOAT, inverse_transform_to_vox: soma.Transformation3d, background: float, output_location: AimsVector_FLOAT_3, timestep: int) -> float resample_inv_to_vox(input_data, inverse_transform_to_vox, background, output_location, timestep) -> output_value

Resample a volume at a single location.

This method does not use the instance state set by setRef() or setDefaultValue().

input_data: Volume_FLOAT

data to be resampled (its voxel size is taken into account)

inverse_transform_to_vox: Transformation3d

transformation from output coordinates to coordinates of the input volume (unit: voxel)

background: float

value set in output regions that are outside of the transformed input volume

output_location: Point3df (list of 3 floats)

coordinates in output space (destination space of transform)

timestep: int

for 4D volume, time step to be used

Returns:

resampled value

Return type:

float

setDefaultValue(self, a0: float)
setDefaultValue(value) None

Set the background value to be used by the doit() methods

Parameters:

value (float) – background value

setRef(self, a0: rc_ptr_Volume_FLOAT)
setRef(input_data) None

Set the input data to be resampled by the doit() methods

Parameters:

input_data (Volume_FLOAT) – volume to be resampled

class soma.aimsalgo.Resampler_HSV(*args)

Resampling of data from a volume, applying a transformation.

The doit() and resample() methods can be used to apply an affine transformation (aims::AffineTransformation3d). They take a direct transformation, i.e. the transformation goes from the space of the input image (unit: mm) to the space of the output image (unit: mm). The transformation is inverted and normalized internally as needed, because the resamplers “pull” data by transforming output coordinates into input coordinates.

The doit() methods work on input data passed to the setRef() method. setDefaultValue() can also be called to set the background value.

The resample() methods provide stateless alternatives.

You can also use arbitrary non-affine transformations (inheriting soma::Transformation3d) by using the resample_inv() family of methods. In this case, you must pass the backward transformation (from output space to input space), because of the “pulling” mechanism described above.

Beware that contrary to the other methods, the resample_inv_to_vox() overloads take a transformation that maps to voxel coordinates of the input image. These methods can be slightly faster than resample_inv() because they map directly to the API of the actual resamplers are implementing (doResample()). This is especially true of the overload that performs resampling for a single point only.

defaultValue(self) AimsHSV
defaultValue() None

Background value used by the doit() methods

Return type:

AimsHSV

doit(self, transform: aims.AffineTransformation3d, output_data: Volume_HSV)
doit(transform, output_data) None

Resample the input volume set with setRef() into an existing volume.

The background value (to be used for regions that are outside of the input volume) can be set with setDefaultValue().

The transformations, referentials, and referential header attributes of output_data are not touched; it is up to the calling code to update them accordingly.

The level of verbosity is taken from carto::verbose (i.e. the –verbose command-line argument is honoured).

Parameters:
  • transform (AffineTransformation3d) – transformation from coordinates of the input volume (unit: mm), to coordinates of the output volume (unit: mm) (its inverse is used for resampling)

  • output_data (Volume_HSV) – existing volume to be filled with resampled data (its pre-existing dimensions and voxel size are used)

Raises:

RuntimeError – if no input volume has been set with setRef.

doit(self, transform: aims.AffineTransformation3d, dimx: int, dimy: int, dimz: int, voxel_size: AimsVector_FLOAT_3) -> rc_ptr_Volume_HSV doit(transform, dimx, dimy, dimz, voxel_size)

Resample the input volume set with setRef() in a newly allocated volume.

The background value (to be used for regions that are outside of the input volume) can be set with setDefaultValue().

The level of verbosity is taken from carto::verbose (i.e. the –verbose command-line argument is honoured).

The transformations, referentials, and referential header attributes of the new volume are reset if transform.isIdentity() is false:

  • the referential attribute is removed

  • each transformation in transformations is composed with transform so that the output volume still points to the original space. If that is not possible (e.g. the transformations attribute is missing or invalid), then a new transformation is added that points to the input volume.

Parameters:
  • transform (AffineTransformation3d) – transformation from coordinates of the input volume (unit: mm), to coordinates of the output volume (unit: mm) (its inverse is used for resampling)

  • dimX (int) – dimensions of the newly allocated volume

  • dimY (int) – dimensions of the newly allocated volume

  • dimZ (int) – dimensions of the newly allocated volume

  • voxel_size (Point3df (list of 3 floats)) – voxel size of the newly allocated volume (unit: mm)

Returns:

a newly allocated volume containing the resampled data (its size along the t axis is the same as the input volume).

Return type:

Volume_HSV

Raises:

RuntimeError – if no input volume has been set with setRef.:

ref(self) rc_ptr_Volume_HSV
ref() None

Input data to be resampled by the doit() methods

Return type:

Volume_HSV

resample(self, input_data: Volume_HSV, transform: aims.AffineTransformation3d, background: AimsHSV, output_data: Volume_HSV, verbose: bool = False)
resample(input_data, transform, background, output_data, verbose=False) None

Resample a volume into an existing output volume.

The transformations, referentials, and referential header attributes of output_data are not touched; it is up to the calling code to update them accordingly.

This method does not use the instance state set by setRef() or setDefaultValue().

Derived classes can override this method to optimize interpolation of a full volume. The base class method simply calls doResample for each point.

Parameters:
  • input_data (Volume_HSV) – data to be resampled (its voxel size is taken into account)

  • transform (AffineTransformation3d) – transformation from coordinates of the input volume (unit: mm), to coordinates of the output volume (unit: mm) (its inverse is used for resampling)

  • background (AimsHSV) – value set in output regions that are outside of the transformed input volume

  • output_data (Volume_HSV) – existing volume to be filled with resampled data (its pre-existing dimensions and voxel size are used)

  • verbose (bool) – print progress to stdout

resample(self, input_data: Volume_HSV, transform: aims.AffineTransformation3d, background: AimsHSV, output_location: AimsVector_FLOAT_3, timestep: int) -> AimsHSV resample(input_data, transform, background, output_location, timestep) -> output_value

Resample a volume at a single location.

This method does not use the instance state set by setRef() or setDefaultValue().

Parameters:
  • input_data (Volume_HSV) – data to be resampled (its voxel size is taken into account)

  • transform (AffineTransformation3d) – transformation from coordinates of the input volume (unit: mm), to output coordinates (its inverse is used for resampling)

  • background (AimsHSV) – value set in output regions that are outside of the transformed input volume

  • output_location (Point3df (list of 3 floats)) – coordinates in output space (destination space of transform)

  • timestep (int) – for 4D volume, time step to be used

Returns:

resampled value

Return type:

AimsHSV

resample_inv(self, input_data: Volume_HSV, inverse_transform: soma.Transformation3d, background: AimsHSV, output_data: Volume_HSV, verbose: bool = False)
resample_inv(input_data, inverse_transform, background, output_data, verbose=False) None

Resample a volume into an existing output volume.

The transformations, referentials, and referential header attributes of output_data are not touched; it is up to the calling code to update them accordingly.

This method does not use the instance state set by setRef() or setDefaultValue().

Parameters:
  • input_data (Volume_HSV) – data to be resampled (its voxel size is taken into account)

  • inverse_transform (Transformation3d) – transformation from coordinates of the output volume (unit: mm), to coordinates of the input volume (unit: mm)

  • background (AimsHSV) – value set in output regions that are outside of the transformed input volume

  • output_data (Volume_HSV) – existing volume to be filled with resampled data (its pre-existing dimensions and voxel size are used)

  • verbose (bool) – print progress to stdout

resample_inv(self, input_data: Volume_HSV, inverse_transform: soma.Transformation3d, background: AimsHSV, output_location: AimsVector_FLOAT_3, timestep: int) -> AimsHSV resample_inv(input_data, inverse_transform, background, output_location, timestep) -> output_value

Resample a volume at a single location.

This method does not use the instance state set by setRef() or setDefaultValue().

input_data: Volume_HSV

data to be resampled (its voxel size is taken into account)

inverse_transform: Transformation3d

transformation from output coordinates to coordinates of the input volume (unit: mm)

background: AimsHSV

value set in output regions that are outside of the transformed input volume

output_location: Point3df (list of 3 floats)

coordinates in output space (destination space of transform)

timestep: int

for 4D volume, time step to be used

Returns:

resampled value

Return type:

AimsHSV

resample_inv_to_vox(self, input_data: Volume_HSV, inverse_transform_to_vox: soma.Transformation3d, background: AimsHSV, output_data: Volume_HSV, verbose: bool = False)
resample_inv_to_vox(input_data, inverse_transform_to_vox, background, output_data, verbose=False) None

Resample a volume into an existing output volume.

The transformations, referentials, and referential header attributes of output_data are not touched; it is up to the calling code to update them accordingly.

This method does not use the instance state set by setRef() or setDefaultValue().

Derived classes can override this method to optimize interpolation of a full volume. The base class method simply calls doResample for each point.

Parameters:
  • input_data (Volume_HSV) – data to be resampled (its voxel size is taken into account)

  • inverse_transform_to_vox (Transformation3d) – transformation from coordinates of the output volume (unit: mm), to coordinates of the input volume (unit: voxel)

  • background (AimsHSV) – value set in output regions that are outside of the transformed input volume

  • output_data (Volume_HSV) – existing volume to be filled with resampled data (its pre-existing dimensions and voxel size are used)

  • verbose (bool) – print progress to stdout

resample_inv_to_vox(self, input_data: Volume_HSV, inverse_transform_to_vox: soma.Transformation3d, background: AimsHSV, output_location: AimsVector_FLOAT_3, timestep: int) -> AimsHSV resample_inv_to_vox(input_data, inverse_transform_to_vox, background, output_location, timestep) -> output_value

Resample a volume at a single location.

This method does not use the instance state set by setRef() or setDefaultValue().

input_data: Volume_HSV

data to be resampled (its voxel size is taken into account)

inverse_transform_to_vox: Transformation3d

transformation from output coordinates to coordinates of the input volume (unit: voxel)

background: AimsHSV

value set in output regions that are outside of the transformed input volume

output_location: Point3df (list of 3 floats)

coordinates in output space (destination space of transform)

timestep: int

for 4D volume, time step to be used

Returns:

resampled value

Return type:

AimsHSV

setDefaultValue(self, a0: AimsHSV)
setDefaultValue(value) None

Set the background value to be used by the doit() methods

Parameters:

value (AimsHSV) – background value

setRef(self, a0: rc_ptr_Volume_HSV)
setRef(input_data) None

Set the input data to be resampled by the doit() methods

Parameters:

input_data (Volume_HSV) – volume to be resampled

class soma.aimsalgo.Resampler_POINT3DF(*args)

Resampling of data from a volume, applying a transformation.

The doit() and resample() methods can be used to apply an affine transformation (aims::AffineTransformation3d). They take a direct transformation, i.e. the transformation goes from the space of the input image (unit: mm) to the space of the output image (unit: mm). The transformation is inverted and normalized internally as needed, because the resamplers “pull” data by transforming output coordinates into input coordinates.

The doit() methods work on input data passed to the setRef() method. setDefaultValue() can also be called to set the background value.

The resample() methods provide stateless alternatives.

You can also use arbitrary non-affine transformations (inheriting soma::Transformation3d) by using the resample_inv() family of methods. In this case, you must pass the backward transformation (from output space to input space), because of the “pulling” mechanism described above.

Beware that contrary to the other methods, the resample_inv_to_vox() overloads take a transformation that maps to voxel coordinates of the input image. These methods can be slightly faster than resample_inv() because they map directly to the API of the actual resamplers are implementing (doResample()). This is especially true of the overload that performs resampling for a single point only.

defaultValue(self) AimsVector_FLOAT_3
defaultValue() None

Background value used by the doit() methods

Return type:

Point3df

doit(self, transform: aims.AffineTransformation3d, output_data: Volume_POINT3DF)
doit(transform, output_data) None

Resample the input volume set with setRef() into an existing volume.

The background value (to be used for regions that are outside of the input volume) can be set with setDefaultValue().

The transformations, referentials, and referential header attributes of output_data are not touched; it is up to the calling code to update them accordingly.

The level of verbosity is taken from carto::verbose (i.e. the –verbose command-line argument is honoured).

Parameters:
  • transform (AffineTransformation3d) – transformation from coordinates of the input volume (unit: mm), to coordinates of the output volume (unit: mm) (its inverse is used for resampling)

  • output_data (Volume_POINT3DF) – existing volume to be filled with resampled data (its pre-existing dimensions and voxel size are used)

Raises:

RuntimeError – if no input volume has been set with setRef.

doit(self, transform: aims.AffineTransformation3d, dimx: int, dimy: int, dimz: int, voxel_size: AimsVector_FLOAT_3) -> rc_ptr_Volume_POINT3DF doit(transform, dimx, dimy, dimz, voxel_size)

Resample the input volume set with setRef() in a newly allocated volume.

The background value (to be used for regions that are outside of the input volume) can be set with setDefaultValue().

The level of verbosity is taken from carto::verbose (i.e. the –verbose command-line argument is honoured).

The transformations, referentials, and referential header attributes of the new volume are reset if transform.isIdentity() is false:

  • the referential attribute is removed

  • each transformation in transformations is composed with transform so that the output volume still points to the original space. If that is not possible (e.g. the transformations attribute is missing or invalid), then a new transformation is added that points to the input volume.

Parameters:
  • transform (AffineTransformation3d) – transformation from coordinates of the input volume (unit: mm), to coordinates of the output volume (unit: mm) (its inverse is used for resampling)

  • dimX (int) – dimensions of the newly allocated volume

  • dimY (int) – dimensions of the newly allocated volume

  • dimZ (int) – dimensions of the newly allocated volume

  • voxel_size (Point3df (list of 3 floats)) – voxel size of the newly allocated volume (unit: mm)

Returns:

a newly allocated volume containing the resampled data (its size along the t axis is the same as the input volume).

Return type:

Volume_POINT3DF

Raises:

RuntimeError – if no input volume has been set with setRef.:

ref(self) rc_ptr_Volume_POINT3DF
ref() None

Input data to be resampled by the doit() methods

Return type:

Volume_POINT3DF

resample(self, input_data: Volume_POINT3DF, transform: aims.AffineTransformation3d, background: AimsVector_FLOAT_3, output_data: Volume_POINT3DF, verbose: bool = False)
resample(input_data, transform, background, output_data, verbose=False) None

Resample a volume into an existing output volume.

The transformations, referentials, and referential header attributes of output_data are not touched; it is up to the calling code to update them accordingly.

This method does not use the instance state set by setRef() or setDefaultValue().

Derived classes can override this method to optimize interpolation of a full volume. The base class method simply calls doResample for each point.

Parameters:
  • input_data (Volume_POINT3DF) – data to be resampled (its voxel size is taken into account)

  • transform (AffineTransformation3d) – transformation from coordinates of the input volume (unit: mm), to coordinates of the output volume (unit: mm) (its inverse is used for resampling)

  • background (Point3df) – value set in output regions that are outside of the transformed input volume

  • output_data (Volume_POINT3DF) – existing volume to be filled with resampled data (its pre-existing dimensions and voxel size are used)

  • verbose (bool) – print progress to stdout

resample(self, input_data: Volume_POINT3DF, transform: aims.AffineTransformation3d, background: AimsVector_FLOAT_3, output_location: AimsVector_FLOAT_3, timestep: int) -> AimsVector_FLOAT_3 resample(input_data, transform, background, output_location, timestep) -> output_value

Resample a volume at a single location.

This method does not use the instance state set by setRef() or setDefaultValue().

Parameters:
  • input_data (Volume_POINT3DF) – data to be resampled (its voxel size is taken into account)

  • transform (AffineTransformation3d) – transformation from coordinates of the input volume (unit: mm), to output coordinates (its inverse is used for resampling)

  • background (Point3df) – value set in output regions that are outside of the transformed input volume

  • output_location (Point3df (list of 3 floats)) – coordinates in output space (destination space of transform)

  • timestep (int) – for 4D volume, time step to be used

Returns:

resampled value

Return type:

Point3df

resample_inv(self, input_data: Volume_POINT3DF, inverse_transform: soma.Transformation3d, background: AimsVector_FLOAT_3, output_data: Volume_POINT3DF, verbose: bool = False)
resample_inv(input_data, inverse_transform, background, output_data, verbose=False) None

Resample a volume into an existing output volume.

The transformations, referentials, and referential header attributes of output_data are not touched; it is up to the calling code to update them accordingly.

This method does not use the instance state set by setRef() or setDefaultValue().

Parameters:
  • input_data (Volume_POINT3DF) – data to be resampled (its voxel size is taken into account)

  • inverse_transform (Transformation3d) – transformation from coordinates of the output volume (unit: mm), to coordinates of the input volume (unit: mm)

  • background (Point3df) – value set in output regions that are outside of the transformed input volume

  • output_data (Volume_POINT3DF) – existing volume to be filled with resampled data (its pre-existing dimensions and voxel size are used)

  • verbose (bool) – print progress to stdout

resample_inv(self, input_data: Volume_POINT3DF, inverse_transform: soma.Transformation3d, background: AimsVector_FLOAT_3, output_location: AimsVector_FLOAT_3, timestep: int) -> AimsVector_FLOAT_3 resample_inv(input_data, inverse_transform, background, output_location, timestep) -> output_value

Resample a volume at a single location.

This method does not use the instance state set by setRef() or setDefaultValue().

input_data: Volume_POINT3DF

data to be resampled (its voxel size is taken into account)

inverse_transform: Transformation3d

transformation from output coordinates to coordinates of the input volume (unit: mm)

background: Point3df

value set in output regions that are outside of the transformed input volume

output_location: Point3df (list of 3 floats)

coordinates in output space (destination space of transform)

timestep: int

for 4D volume, time step to be used

Returns:

resampled value

Return type:

Point3df

resample_inv_to_vox(self, input_data: Volume_POINT3DF, inverse_transform_to_vox: soma.Transformation3d, background: AimsVector_FLOAT_3, output_data: Volume_POINT3DF, verbose: bool = False)
resample_inv_to_vox(input_data, inverse_transform_to_vox, background, output_data, verbose=False) None

Resample a volume into an existing output volume.

The transformations, referentials, and referential header attributes of output_data are not touched; it is up to the calling code to update them accordingly.

This method does not use the instance state set by setRef() or setDefaultValue().

Derived classes can override this method to optimize interpolation of a full volume. The base class method simply calls doResample for each point.

Parameters:
  • input_data (Volume_POINT3DF) – data to be resampled (its voxel size is taken into account)

  • inverse_transform_to_vox (Transformation3d) – transformation from coordinates of the output volume (unit: mm), to coordinates of the input volume (unit: voxel)

  • background (Point3df) – value set in output regions that are outside of the transformed input volume

  • output_data (Volume_POINT3DF) – existing volume to be filled with resampled data (its pre-existing dimensions and voxel size are used)

  • verbose (bool) – print progress to stdout

resample_inv_to_vox(self, input_data: Volume_POINT3DF, inverse_transform_to_vox: soma.Transformation3d, background: AimsVector_FLOAT_3, output_location: AimsVector_FLOAT_3, timestep: int) -> AimsVector_FLOAT_3 resample_inv_to_vox(input_data, inverse_transform_to_vox, background, output_location, timestep) -> output_value

Resample a volume at a single location.

This method does not use the instance state set by setRef() or setDefaultValue().

input_data: Volume_POINT3DF

data to be resampled (its voxel size is taken into account)

inverse_transform_to_vox: Transformation3d

transformation from output coordinates to coordinates of the input volume (unit: voxel)

background: Point3df

value set in output regions that are outside of the transformed input volume

output_location: Point3df (list of 3 floats)

coordinates in output space (destination space of transform)

timestep: int

for 4D volume, time step to be used

Returns:

resampled value

Return type:

Point3df

setDefaultValue(self, a0: AimsVector_FLOAT_3)
setDefaultValue(value) None

Set the background value to be used by the doit() methods

Parameters:

value (Point3df) – background value

setRef(self, a0: rc_ptr_Volume_POINT3DF)
setRef(input_data) None

Set the input data to be resampled by the doit() methods

Parameters:

input_data (Volume_POINT3DF) – volume to be resampled

class soma.aimsalgo.Resampler_RGB(*args)

Resampling of data from a volume, applying a transformation.

The doit() and resample() methods can be used to apply an affine transformation (aims::AffineTransformation3d). They take a direct transformation, i.e. the transformation goes from the space of the input image (unit: mm) to the space of the output image (unit: mm). The transformation is inverted and normalized internally as needed, because the resamplers “pull” data by transforming output coordinates into input coordinates.

The doit() methods work on input data passed to the setRef() method. setDefaultValue() can also be called to set the background value.

The resample() methods provide stateless alternatives.

You can also use arbitrary non-affine transformations (inheriting soma::Transformation3d) by using the resample_inv() family of methods. In this case, you must pass the backward transformation (from output space to input space), because of the “pulling” mechanism described above.

Beware that contrary to the other methods, the resample_inv_to_vox() overloads take a transformation that maps to voxel coordinates of the input image. These methods can be slightly faster than resample_inv() because they map directly to the API of the actual resamplers are implementing (doResample()). This is especially true of the overload that performs resampling for a single point only.

defaultValue(self) AimsRGB
defaultValue() None

Background value used by the doit() methods

Return type:

AimsRGB

doit(self, transform: aims.AffineTransformation3d, output_data: Volume_RGB)
doit(transform, output_data) None

Resample the input volume set with setRef() into an existing volume.

The background value (to be used for regions that are outside of the input volume) can be set with setDefaultValue().

The transformations, referentials, and referential header attributes of output_data are not touched; it is up to the calling code to update them accordingly.

The level of verbosity is taken from carto::verbose (i.e. the –verbose command-line argument is honoured).

Parameters:
  • transform (AffineTransformation3d) – transformation from coordinates of the input volume (unit: mm), to coordinates of the output volume (unit: mm) (its inverse is used for resampling)

  • output_data (Volume_RGB) – existing volume to be filled with resampled data (its pre-existing dimensions and voxel size are used)

Raises:

RuntimeError – if no input volume has been set with setRef.

doit(self, transform: aims.AffineTransformation3d, dimx: int, dimy: int, dimz: int, voxel_size: AimsVector_FLOAT_3) -> rc_ptr_Volume_RGB doit(transform, dimx, dimy, dimz, voxel_size)

Resample the input volume set with setRef() in a newly allocated volume.

The background value (to be used for regions that are outside of the input volume) can be set with setDefaultValue().

The level of verbosity is taken from carto::verbose (i.e. the –verbose command-line argument is honoured).

The transformations, referentials, and referential header attributes of the new volume are reset if transform.isIdentity() is false:

  • the referential attribute is removed

  • each transformation in transformations is composed with transform so that the output volume still points to the original space. If that is not possible (e.g. the transformations attribute is missing or invalid), then a new transformation is added that points to the input volume.

Parameters:
  • transform (AffineTransformation3d) – transformation from coordinates of the input volume (unit: mm), to coordinates of the output volume (unit: mm) (its inverse is used for resampling)

  • dimX (int) – dimensions of the newly allocated volume

  • dimY (int) – dimensions of the newly allocated volume

  • dimZ (int) – dimensions of the newly allocated volume

  • voxel_size (Point3df (list of 3 floats)) – voxel size of the newly allocated volume (unit: mm)

Returns:

a newly allocated volume containing the resampled data (its size along the t axis is the same as the input volume).

Return type:

Volume_RGB

Raises:

RuntimeError – if no input volume has been set with setRef.:

ref(self) rc_ptr_Volume_RGB
ref() None

Input data to be resampled by the doit() methods

Return type:

Volume_RGB

resample(self, input_data: Volume_RGB, transform: aims.AffineTransformation3d, background: AimsRGB, output_data: Volume_RGB, verbose: bool = False)
resample(input_data, transform, background, output_data, verbose=False) None

Resample a volume into an existing output volume.

The transformations, referentials, and referential header attributes of output_data are not touched; it is up to the calling code to update them accordingly.

This method does not use the instance state set by setRef() or setDefaultValue().

Derived classes can override this method to optimize interpolation of a full volume. The base class method simply calls doResample for each point.

Parameters:
  • input_data (Volume_RGB) – data to be resampled (its voxel size is taken into account)

  • transform (AffineTransformation3d) – transformation from coordinates of the input volume (unit: mm), to coordinates of the output volume (unit: mm) (its inverse is used for resampling)

  • background (AimsRGB) – value set in output regions that are outside of the transformed input volume

  • output_data (Volume_RGB) – existing volume to be filled with resampled data (its pre-existing dimensions and voxel size are used)

  • verbose (bool) – print progress to stdout

resample(self, input_data: Volume_RGB, transform: aims.AffineTransformation3d, background: AimsRGB, output_location: AimsVector_FLOAT_3, timestep: int) -> AimsRGB resample(input_data, transform, background, output_location, timestep) -> output_value

Resample a volume at a single location.

This method does not use the instance state set by setRef() or setDefaultValue().

Parameters:
  • input_data (Volume_RGB) – data to be resampled (its voxel size is taken into account)

  • transform (AffineTransformation3d) – transformation from coordinates of the input volume (unit: mm), to output coordinates (its inverse is used for resampling)

  • background (AimsRGB) – value set in output regions that are outside of the transformed input volume

  • output_location (Point3df (list of 3 floats)) – coordinates in output space (destination space of transform)

  • timestep (int) – for 4D volume, time step to be used

Returns:

resampled value

Return type:

AimsRGB

resample_inv(self, input_data: Volume_RGB, inverse_transform: soma.Transformation3d, background: AimsRGB, output_data: Volume_RGB, verbose: bool = False)
resample_inv(input_data, inverse_transform, background, output_data, verbose=False) None

Resample a volume into an existing output volume.

The transformations, referentials, and referential header attributes of output_data are not touched; it is up to the calling code to update them accordingly.

This method does not use the instance state set by setRef() or setDefaultValue().

Parameters:
  • input_data (Volume_RGB) – data to be resampled (its voxel size is taken into account)

  • inverse_transform (Transformation3d) – transformation from coordinates of the output volume (unit: mm), to coordinates of the input volume (unit: mm)

  • background (AimsRGB) – value set in output regions that are outside of the transformed input volume

  • output_data (Volume_RGB) – existing volume to be filled with resampled data (its pre-existing dimensions and voxel size are used)

  • verbose (bool) – print progress to stdout

resample_inv(self, input_data: Volume_RGB, inverse_transform: soma.Transformation3d, background: AimsRGB, output_location: AimsVector_FLOAT_3, timestep: int) -> AimsRGB resample_inv(input_data, inverse_transform, background, output_location, timestep) -> output_value

Resample a volume at a single location.

This method does not use the instance state set by setRef() or setDefaultValue().

input_data: Volume_RGB

data to be resampled (its voxel size is taken into account)

inverse_transform: Transformation3d

transformation from output coordinates to coordinates of the input volume (unit: mm)

background: AimsRGB

value set in output regions that are outside of the transformed input volume

output_location: Point3df (list of 3 floats)

coordinates in output space (destination space of transform)

timestep: int

for 4D volume, time step to be used

Returns:

resampled value

Return type:

AimsRGB

resample_inv_to_vox(self, input_data: Volume_RGB, inverse_transform_to_vox: soma.Transformation3d, background: AimsRGB, output_data: Volume_RGB, verbose: bool = False)
resample_inv_to_vox(input_data, inverse_transform_to_vox, background, output_data, verbose=False) None

Resample a volume into an existing output volume.

The transformations, referentials, and referential header attributes of output_data are not touched; it is up to the calling code to update them accordingly.

This method does not use the instance state set by setRef() or setDefaultValue().

Derived classes can override this method to optimize interpolation of a full volume. The base class method simply calls doResample for each point.

Parameters:
  • input_data (Volume_RGB) – data to be resampled (its voxel size is taken into account)

  • inverse_transform_to_vox (Transformation3d) – transformation from coordinates of the output volume (unit: mm), to coordinates of the input volume (unit: voxel)

  • background (AimsRGB) – value set in output regions that are outside of the transformed input volume

  • output_data (Volume_RGB) – existing volume to be filled with resampled data (its pre-existing dimensions and voxel size are used)

  • verbose (bool) – print progress to stdout

resample_inv_to_vox(self, input_data: Volume_RGB, inverse_transform_to_vox: soma.Transformation3d, background: AimsRGB, output_location: AimsVector_FLOAT_3, timestep: int) -> AimsRGB resample_inv_to_vox(input_data, inverse_transform_to_vox, background, output_location, timestep) -> output_value

Resample a volume at a single location.

This method does not use the instance state set by setRef() or setDefaultValue().

input_data: Volume_RGB

data to be resampled (its voxel size is taken into account)

inverse_transform_to_vox: Transformation3d

transformation from output coordinates to coordinates of the input volume (unit: voxel)

background: AimsRGB

value set in output regions that are outside of the transformed input volume

output_location: Point3df (list of 3 floats)

coordinates in output space (destination space of transform)

timestep: int

for 4D volume, time step to be used

Returns:

resampled value

Return type:

AimsRGB

setDefaultValue(self, a0: AimsRGB)
setDefaultValue(value) None

Set the background value to be used by the doit() methods

Parameters:

value (AimsRGB) – background value

setRef(self, a0: rc_ptr_Volume_RGB)
setRef(input_data) None

Set the input data to be resampled by the doit() methods

Parameters:

input_data (Volume_RGB) – volume to be resampled

class soma.aimsalgo.Resampler_RGBA(*args)

Resampling of data from a volume, applying a transformation.

The doit() and resample() methods can be used to apply an affine transformation (aims::AffineTransformation3d). They take a direct transformation, i.e. the transformation goes from the space of the input image (unit: mm) to the space of the output image (unit: mm). The transformation is inverted and normalized internally as needed, because the resamplers “pull” data by transforming output coordinates into input coordinates.

The doit() methods work on input data passed to the setRef() method. setDefaultValue() can also be called to set the background value.

The resample() methods provide stateless alternatives.

You can also use arbitrary non-affine transformations (inheriting soma::Transformation3d) by using the resample_inv() family of methods. In this case, you must pass the backward transformation (from output space to input space), because of the “pulling” mechanism described above.

Beware that contrary to the other methods, the resample_inv_to_vox() overloads take a transformation that maps to voxel coordinates of the input image. These methods can be slightly faster than resample_inv() because they map directly to the API of the actual resamplers are implementing (doResample()). This is especially true of the overload that performs resampling for a single point only.

defaultValue(self) AimsRGBA
defaultValue() None

Background value used by the doit() methods

Return type:

AimsRGBA

doit(self, transform: aims.AffineTransformation3d, output_data: Volume_RGBA)
doit(transform, output_data) None

Resample the input volume set with setRef() into an existing volume.

The background value (to be used for regions that are outside of the input volume) can be set with setDefaultValue().

The transformations, referentials, and referential header attributes of output_data are not touched; it is up to the calling code to update them accordingly.

The level of verbosity is taken from carto::verbose (i.e. the –verbose command-line argument is honoured).

Parameters:
  • transform (AffineTransformation3d) – transformation from coordinates of the input volume (unit: mm), to coordinates of the output volume (unit: mm) (its inverse is used for resampling)

  • output_data (Volume_RGBA) – existing volume to be filled with resampled data (its pre-existing dimensions and voxel size are used)

Raises:

RuntimeError – if no input volume has been set with setRef.

doit(self, transform: aims.AffineTransformation3d, dimx: int, dimy: int, dimz: int, voxel_size: AimsVector_FLOAT_3) -> rc_ptr_Volume_RGBA doit(transform, dimx, dimy, dimz, voxel_size)

Resample the input volume set with setRef() in a newly allocated volume.

The background value (to be used for regions that are outside of the input volume) can be set with setDefaultValue().

The level of verbosity is taken from carto::verbose (i.e. the –verbose command-line argument is honoured).

The transformations, referentials, and referential header attributes of the new volume are reset if transform.isIdentity() is false:

  • the referential attribute is removed

  • each transformation in transformations is composed with transform so that the output volume still points to the original space. If that is not possible (e.g. the transformations attribute is missing or invalid), then a new transformation is added that points to the input volume.

Parameters:
  • transform (AffineTransformation3d) – transformation from coordinates of the input volume (unit: mm), to coordinates of the output volume (unit: mm) (its inverse is used for resampling)

  • dimX (int) – dimensions of the newly allocated volume

  • dimY (int) – dimensions of the newly allocated volume

  • dimZ (int) – dimensions of the newly allocated volume

  • voxel_size (Point3df (list of 3 floats)) – voxel size of the newly allocated volume (unit: mm)

Returns:

a newly allocated volume containing the resampled data (its size along the t axis is the same as the input volume).

Return type:

Volume_RGBA

Raises:

RuntimeError – if no input volume has been set with setRef.:

ref(self) rc_ptr_Volume_RGBA
ref() None

Input data to be resampled by the doit() methods

Return type:

Volume_RGBA

resample(self, input_data: Volume_RGBA, transform: aims.AffineTransformation3d, background: AimsRGBA, output_data: Volume_RGBA, verbose: bool = False)
resample(input_data, transform, background, output_data, verbose=False) None

Resample a volume into an existing output volume.

The transformations, referentials, and referential header attributes of output_data are not touched; it is up to the calling code to update them accordingly.

This method does not use the instance state set by setRef() or setDefaultValue().

Derived classes can override this method to optimize interpolation of a full volume. The base class method simply calls doResample for each point.

Parameters:
  • input_data (Volume_RGBA) – data to be resampled (its voxel size is taken into account)

  • transform (AffineTransformation3d) – transformation from coordinates of the input volume (unit: mm), to coordinates of the output volume (unit: mm) (its inverse is used for resampling)

  • background (AimsRGBA) – value set in output regions that are outside of the transformed input volume

  • output_data (Volume_RGBA) – existing volume to be filled with resampled data (its pre-existing dimensions and voxel size are used)

  • verbose (bool) – print progress to stdout

resample(self, input_data: Volume_RGBA, transform: aims.AffineTransformation3d, background: AimsRGBA, output_location: AimsVector_FLOAT_3, timestep: int) -> AimsRGBA resample(input_data, transform, background, output_location, timestep) -> output_value

Resample a volume at a single location.

This method does not use the instance state set by setRef() or setDefaultValue().

Parameters:
  • input_data (Volume_RGBA) – data to be resampled (its voxel size is taken into account)

  • transform (AffineTransformation3d) – transformation from coordinates of the input volume (unit: mm), to output coordinates (its inverse is used for resampling)

  • background (AimsRGBA) – value set in output regions that are outside of the transformed input volume

  • output_location (Point3df (list of 3 floats)) – coordinates in output space (destination space of transform)

  • timestep (int) – for 4D volume, time step to be used

Returns:

resampled value

Return type:

AimsRGBA

resample_inv(self, input_data: Volume_RGBA, inverse_transform: soma.Transformation3d, background: AimsRGBA, output_data: Volume_RGBA, verbose: bool = False)
resample_inv(input_data, inverse_transform, background, output_data, verbose=False) None

Resample a volume into an existing output volume.

The transformations, referentials, and referential header attributes of output_data are not touched; it is up to the calling code to update them accordingly.

This method does not use the instance state set by setRef() or setDefaultValue().

Parameters:
  • input_data (Volume_RGBA) – data to be resampled (its voxel size is taken into account)

  • inverse_transform (Transformation3d) – transformation from coordinates of the output volume (unit: mm), to coordinates of the input volume (unit: mm)

  • background (AimsRGBA) – value set in output regions that are outside of the transformed input volume

  • output_data (Volume_RGBA) – existing volume to be filled with resampled data (its pre-existing dimensions and voxel size are used)

  • verbose (bool) – print progress to stdout

resample_inv(self, input_data: Volume_RGBA, inverse_transform: soma.Transformation3d, background: AimsRGBA, output_location: AimsVector_FLOAT_3, timestep: int) -> AimsRGBA resample_inv(input_data, inverse_transform, background, output_location, timestep) -> output_value

Resample a volume at a single location.

This method does not use the instance state set by setRef() or setDefaultValue().

input_data: Volume_RGBA

data to be resampled (its voxel size is taken into account)

inverse_transform: Transformation3d

transformation from output coordinates to coordinates of the input volume (unit: mm)

background: AimsRGBA

value set in output regions that are outside of the transformed input volume

output_location: Point3df (list of 3 floats)

coordinates in output space (destination space of transform)

timestep: int

for 4D volume, time step to be used

Returns:

resampled value

Return type:

AimsRGBA

resample_inv_to_vox(self, input_data: Volume_RGBA, inverse_transform_to_vox: soma.Transformation3d, background: AimsRGBA, output_data: Volume_RGBA, verbose: bool = False)
resample_inv_to_vox(input_data, inverse_transform_to_vox, background, output_data, verbose=False) None

Resample a volume into an existing output volume.

The transformations, referentials, and referential header attributes of output_data are not touched; it is up to the calling code to update them accordingly.

This method does not use the instance state set by setRef() or setDefaultValue().

Derived classes can override this method to optimize interpolation of a full volume. The base class method simply calls doResample for each point.

Parameters:
  • input_data (Volume_RGBA) – data to be resampled (its voxel size is taken into account)

  • inverse_transform_to_vox (Transformation3d) – transformation from coordinates of the output volume (unit: mm), to coordinates of the input volume (unit: voxel)

  • background (AimsRGBA) – value set in output regions that are outside of the transformed input volume

  • output_data (Volume_RGBA) – existing volume to be filled with resampled data (its pre-existing dimensions and voxel size are used)

  • verbose (bool) – print progress to stdout

resample_inv_to_vox(self, input_data: Volume_RGBA, inverse_transform_to_vox: soma.Transformation3d, background: AimsRGBA, output_location: AimsVector_FLOAT_3, timestep: int) -> AimsRGBA resample_inv_to_vox(input_data, inverse_transform_to_vox, background, output_location, timestep) -> output_value

Resample a volume at a single location.

This method does not use the instance state set by setRef() or setDefaultValue().

input_data: Volume_RGBA

data to be resampled (its voxel size is taken into account)

inverse_transform_to_vox: Transformation3d

transformation from output coordinates to coordinates of the input volume (unit: voxel)

background: AimsRGBA

value set in output regions that are outside of the transformed input volume

output_location: Point3df (list of 3 floats)

coordinates in output space (destination space of transform)

timestep: int

for 4D volume, time step to be used

Returns:

resampled value

Return type:

AimsRGBA

setDefaultValue(self, a0: AimsRGBA)
setDefaultValue(value) None

Set the background value to be used by the doit() methods

Parameters:

value (AimsRGBA) – background value

setRef(self, a0: rc_ptr_Volume_RGBA)
setRef(input_data) None

Set the input data to be resampled by the doit() methods

Parameters:

input_data (Volume_RGBA) – volume to be resampled

class soma.aimsalgo.Resampler_S16(*args)

Resampling of data from a volume, applying a transformation.

The doit() and resample() methods can be used to apply an affine transformation (aims::AffineTransformation3d). They take a direct transformation, i.e. the transformation goes from the space of the input image (unit: mm) to the space of the output image (unit: mm). The transformation is inverted and normalized internally as needed, because the resamplers “pull” data by transforming output coordinates into input coordinates.

The doit() methods work on input data passed to the setRef() method. setDefaultValue() can also be called to set the background value.

The resample() methods provide stateless alternatives.

You can also use arbitrary non-affine transformations (inheriting soma::Transformation3d) by using the resample_inv() family of methods. In this case, you must pass the backward transformation (from output space to input space), because of the “pulling” mechanism described above.

Beware that contrary to the other methods, the resample_inv_to_vox() overloads take a transformation that maps to voxel coordinates of the input image. These methods can be slightly faster than resample_inv() because they map directly to the API of the actual resamplers are implementing (doResample()). This is especially true of the overload that performs resampling for a single point only.

defaultValue(self) int
defaultValue() None

Background value used by the doit() methods

Return type:

short

doit(self, transform: aims.AffineTransformation3d, output_data: Volume_S16)
doit(transform, output_data) None

Resample the input volume set with setRef() into an existing volume.

The background value (to be used for regions that are outside of the input volume) can be set with setDefaultValue().

The transformations, referentials, and referential header attributes of output_data are not touched; it is up to the calling code to update them accordingly.

The level of verbosity is taken from carto::verbose (i.e. the –verbose command-line argument is honoured).

Parameters:
  • transform (AffineTransformation3d) – transformation from coordinates of the input volume (unit: mm), to coordinates of the output volume (unit: mm) (its inverse is used for resampling)

  • output_data (Volume_S16) – existing volume to be filled with resampled data (its pre-existing dimensions and voxel size are used)

Raises:

RuntimeError – if no input volume has been set with setRef.

doit(self, transform: aims.AffineTransformation3d, dimx: int, dimy: int, dimz: int, voxel_size: AimsVector_FLOAT_3) -> rc_ptr_Volume_S16 doit(transform, dimx, dimy, dimz, voxel_size)

Resample the input volume set with setRef() in a newly allocated volume.

The background value (to be used for regions that are outside of the input volume) can be set with setDefaultValue().

The level of verbosity is taken from carto::verbose (i.e. the –verbose command-line argument is honoured).

The transformations, referentials, and referential header attributes of the new volume are reset if transform.isIdentity() is false:

  • the referential attribute is removed

  • each transformation in transformations is composed with transform so that the output volume still points to the original space. If that is not possible (e.g. the transformations attribute is missing or invalid), then a new transformation is added that points to the input volume.

Parameters:
  • transform (AffineTransformation3d) – transformation from coordinates of the input volume (unit: mm), to coordinates of the output volume (unit: mm) (its inverse is used for resampling)

  • dimX (int) – dimensions of the newly allocated volume

  • dimY (int) – dimensions of the newly allocated volume

  • dimZ (int) – dimensions of the newly allocated volume

  • voxel_size (Point3df (list of 3 floats)) – voxel size of the newly allocated volume (unit: mm)

Returns:

a newly allocated volume containing the resampled data (its size along the t axis is the same as the input volume).

Return type:

Volume_S16

Raises:

RuntimeError – if no input volume has been set with setRef.:

ref(self) rc_ptr_Volume_S16
ref() None

Input data to be resampled by the doit() methods

Return type:

Volume_S16

resample(self, input_data: Volume_S16, transform: aims.AffineTransformation3d, background: int, output_data: Volume_S16, verbose: bool = False)
resample(input_data, transform, background, output_data, verbose=False) None

Resample a volume into an existing output volume.

The transformations, referentials, and referential header attributes of output_data are not touched; it is up to the calling code to update them accordingly.

This method does not use the instance state set by setRef() or setDefaultValue().

Derived classes can override this method to optimize interpolation of a full volume. The base class method simply calls doResample for each point.

Parameters:
  • input_data (Volume_S16) – data to be resampled (its voxel size is taken into account)

  • transform (AffineTransformation3d) – transformation from coordinates of the input volume (unit: mm), to coordinates of the output volume (unit: mm) (its inverse is used for resampling)

  • background (short) – value set in output regions that are outside of the transformed input volume

  • output_data (Volume_S16) – existing volume to be filled with resampled data (its pre-existing dimensions and voxel size are used)

  • verbose (bool) – print progress to stdout

resample(self, input_data: Volume_S16, transform: aims.AffineTransformation3d, background: int, output_location: AimsVector_FLOAT_3, timestep: int) -> int resample(input_data, transform, background, output_location, timestep) -> output_value

Resample a volume at a single location.

This method does not use the instance state set by setRef() or setDefaultValue().

Parameters:
  • input_data (Volume_S16) – data to be resampled (its voxel size is taken into account)

  • transform (AffineTransformation3d) – transformation from coordinates of the input volume (unit: mm), to output coordinates (its inverse is used for resampling)

  • background (short) – value set in output regions that are outside of the transformed input volume

  • output_location (Point3df (list of 3 floats)) – coordinates in output space (destination space of transform)

  • timestep (int) – for 4D volume, time step to be used

Returns:

resampled value

Return type:

short

resample_inv(self, input_data: Volume_S16, inverse_transform: soma.Transformation3d, background: int, output_data: Volume_S16, verbose: bool = False)
resample_inv(input_data, inverse_transform, background, output_data, verbose=False) None

Resample a volume into an existing output volume.

The transformations, referentials, and referential header attributes of output_data are not touched; it is up to the calling code to update them accordingly.

This method does not use the instance state set by setRef() or setDefaultValue().

Parameters:
  • input_data (Volume_S16) – data to be resampled (its voxel size is taken into account)

  • inverse_transform (Transformation3d) – transformation from coordinates of the output volume (unit: mm), to coordinates of the input volume (unit: mm)

  • background (short) – value set in output regions that are outside of the transformed input volume

  • output_data (Volume_S16) – existing volume to be filled with resampled data (its pre-existing dimensions and voxel size are used)

  • verbose (bool) – print progress to stdout

resample_inv(self, input_data: Volume_S16, inverse_transform: soma.Transformation3d, background: int, output_location: AimsVector_FLOAT_3, timestep: int) -> int resample_inv(input_data, inverse_transform, background, output_location, timestep) -> output_value

Resample a volume at a single location.

This method does not use the instance state set by setRef() or setDefaultValue().

input_data: Volume_S16

data to be resampled (its voxel size is taken into account)

inverse_transform: Transformation3d

transformation from output coordinates to coordinates of the input volume (unit: mm)

background: short

value set in output regions that are outside of the transformed input volume

output_location: Point3df (list of 3 floats)

coordinates in output space (destination space of transform)

timestep: int

for 4D volume, time step to be used

Returns:

resampled value

Return type:

short

resample_inv_to_vox(self, input_data: Volume_S16, inverse_transform_to_vox: soma.Transformation3d, background: int, output_data: Volume_S16, verbose: bool = False)
resample_inv_to_vox(input_data, inverse_transform_to_vox, background, output_data, verbose=False) None

Resample a volume into an existing output volume.

The transformations, referentials, and referential header attributes of output_data are not touched; it is up to the calling code to update them accordingly.

This method does not use the instance state set by setRef() or setDefaultValue().

Derived classes can override this method to optimize interpolation of a full volume. The base class method simply calls doResample for each point.

Parameters:
  • input_data (Volume_S16) – data to be resampled (its voxel size is taken into account)

  • inverse_transform_to_vox (Transformation3d) – transformation from coordinates of the output volume (unit: mm), to coordinates of the input volume (unit: voxel)

  • background (short) – value set in output regions that are outside of the transformed input volume

  • output_data (Volume_S16) – existing volume to be filled with resampled data (its pre-existing dimensions and voxel size are used)

  • verbose (bool) – print progress to stdout

resample_inv_to_vox(self, input_data: Volume_S16, inverse_transform_to_vox: soma.Transformation3d, background: int, output_location: AimsVector_FLOAT_3, timestep: int) -> int resample_inv_to_vox(input_data, inverse_transform_to_vox, background, output_location, timestep) -> output_value

Resample a volume at a single location.

This method does not use the instance state set by setRef() or setDefaultValue().

input_data: Volume_S16

data to be resampled (its voxel size is taken into account)

inverse_transform_to_vox: Transformation3d

transformation from output coordinates to coordinates of the input volume (unit: voxel)

background: short

value set in output regions that are outside of the transformed input volume

output_location: Point3df (list of 3 floats)

coordinates in output space (destination space of transform)

timestep: int

for 4D volume, time step to be used

Returns:

resampled value

Return type:

short

setDefaultValue(self, a0: int)
setDefaultValue(value) None

Set the background value to be used by the doit() methods

Parameters:

value (short) – background value

setRef(self, a0: rc_ptr_Volume_S16)
setRef(input_data) None

Set the input data to be resampled by the doit() methods

Parameters:

input_data (Volume_S16) – volume to be resampled

class soma.aimsalgo.Resampler_S32(*args)

Resampling of data from a volume, applying a transformation.

The doit() and resample() methods can be used to apply an affine transformation (aims::AffineTransformation3d). They take a direct transformation, i.e. the transformation goes from the space of the input image (unit: mm) to the space of the output image (unit: mm). The transformation is inverted and normalized internally as needed, because the resamplers “pull” data by transforming output coordinates into input coordinates.

The doit() methods work on input data passed to the setRef() method. setDefaultValue() can also be called to set the background value.

The resample() methods provide stateless alternatives.

You can also use arbitrary non-affine transformations (inheriting soma::Transformation3d) by using the resample_inv() family of methods. In this case, you must pass the backward transformation (from output space to input space), because of the “pulling” mechanism described above.

Beware that contrary to the other methods, the resample_inv_to_vox() overloads take a transformation that maps to voxel coordinates of the input image. These methods can be slightly faster than resample_inv() because they map directly to the API of the actual resamplers are implementing (doResample()). This is especially true of the overload that performs resampling for a single point only.

defaultValue(self) int
defaultValue() None

Background value used by the doit() methods

Return type:

int

doit(self, transform: aims.AffineTransformation3d, output_data: Volume_S32)
doit(transform, output_data) None

Resample the input volume set with setRef() into an existing volume.

The background value (to be used for regions that are outside of the input volume) can be set with setDefaultValue().

The transformations, referentials, and referential header attributes of output_data are not touched; it is up to the calling code to update them accordingly.

The level of verbosity is taken from carto::verbose (i.e. the –verbose command-line argument is honoured).

Parameters:
  • transform (AffineTransformation3d) – transformation from coordinates of the input volume (unit: mm), to coordinates of the output volume (unit: mm) (its inverse is used for resampling)

  • output_data (Volume_S32) – existing volume to be filled with resampled data (its pre-existing dimensions and voxel size are used)

Raises:

RuntimeError – if no input volume has been set with setRef.

doit(self, transform: aims.AffineTransformation3d, dimx: int, dimy: int, dimz: int, voxel_size: AimsVector_FLOAT_3) -> rc_ptr_Volume_S32 doit(transform, dimx, dimy, dimz, voxel_size)

Resample the input volume set with setRef() in a newly allocated volume.

The background value (to be used for regions that are outside of the input volume) can be set with setDefaultValue().

The level of verbosity is taken from carto::verbose (i.e. the –verbose command-line argument is honoured).

The transformations, referentials, and referential header attributes of the new volume are reset if transform.isIdentity() is false:

  • the referential attribute is removed

  • each transformation in transformations is composed with transform so that the output volume still points to the original space. If that is not possible (e.g. the transformations attribute is missing or invalid), then a new transformation is added that points to the input volume.

Parameters:
  • transform (AffineTransformation3d) – transformation from coordinates of the input volume (unit: mm), to coordinates of the output volume (unit: mm) (its inverse is used for resampling)

  • dimX (int) – dimensions of the newly allocated volume

  • dimY (int) – dimensions of the newly allocated volume

  • dimZ (int) – dimensions of the newly allocated volume

  • voxel_size (Point3df (list of 3 floats)) – voxel size of the newly allocated volume (unit: mm)

Returns:

a newly allocated volume containing the resampled data (its size along the t axis is the same as the input volume).

Return type:

Volume_S32

Raises:

RuntimeError – if no input volume has been set with setRef.:

ref(self) rc_ptr_Volume_S32
ref() None

Input data to be resampled by the doit() methods

Return type:

Volume_S32

resample(self, input_data: Volume_S32, transform: aims.AffineTransformation3d, background: int, output_data: Volume_S32, verbose: bool = False)
resample(input_data, transform, background, output_data, verbose=False) None

Resample a volume into an existing output volume.

The transformations, referentials, and referential header attributes of output_data are not touched; it is up to the calling code to update them accordingly.

This method does not use the instance state set by setRef() or setDefaultValue().

Derived classes can override this method to optimize interpolation of a full volume. The base class method simply calls doResample for each point.

Parameters:
  • input_data (Volume_S32) – data to be resampled (its voxel size is taken into account)

  • transform (AffineTransformation3d) – transformation from coordinates of the input volume (unit: mm), to coordinates of the output volume (unit: mm) (its inverse is used for resampling)

  • background (int) – value set in output regions that are outside of the transformed input volume

  • output_data (Volume_S32) – existing volume to be filled with resampled data (its pre-existing dimensions and voxel size are used)

  • verbose (bool) – print progress to stdout

resample(self, input_data: Volume_S32, transform: aims.AffineTransformation3d, background: int, output_location: AimsVector_FLOAT_3, timestep: int) -> int resample(input_data, transform, background, output_location, timestep) -> output_value

Resample a volume at a single location.

This method does not use the instance state set by setRef() or setDefaultValue().

Parameters:
  • input_data (Volume_S32) – data to be resampled (its voxel size is taken into account)

  • transform (AffineTransformation3d) – transformation from coordinates of the input volume (unit: mm), to output coordinates (its inverse is used for resampling)

  • background (int) – value set in output regions that are outside of the transformed input volume

  • output_location (Point3df (list of 3 floats)) – coordinates in output space (destination space of transform)

  • timestep (int) – for 4D volume, time step to be used

Returns:

resampled value

Return type:

int

resample_inv(self, input_data: Volume_S32, inverse_transform: soma.Transformation3d, background: int, output_data: Volume_S32, verbose: bool = False)
resample_inv(input_data, inverse_transform, background, output_data, verbose=False) None

Resample a volume into an existing output volume.

The transformations, referentials, and referential header attributes of output_data are not touched; it is up to the calling code to update them accordingly.

This method does not use the instance state set by setRef() or setDefaultValue().

Parameters:
  • input_data (Volume_S32) – data to be resampled (its voxel size is taken into account)

  • inverse_transform (Transformation3d) – transformation from coordinates of the output volume (unit: mm), to coordinates of the input volume (unit: mm)

  • background (int) – value set in output regions that are outside of the transformed input volume

  • output_data (Volume_S32) – existing volume to be filled with resampled data (its pre-existing dimensions and voxel size are used)

  • verbose (bool) – print progress to stdout

resample_inv(self, input_data: Volume_S32, inverse_transform: soma.Transformation3d, background: int, output_location: AimsVector_FLOAT_3, timestep: int) -> int resample_inv(input_data, inverse_transform, background, output_location, timestep) -> output_value

Resample a volume at a single location.

This method does not use the instance state set by setRef() or setDefaultValue().

input_data: Volume_S32

data to be resampled (its voxel size is taken into account)

inverse_transform: Transformation3d

transformation from output coordinates to coordinates of the input volume (unit: mm)

background: int

value set in output regions that are outside of the transformed input volume

output_location: Point3df (list of 3 floats)

coordinates in output space (destination space of transform)

timestep: int

for 4D volume, time step to be used

Returns:

resampled value

Return type:

int

resample_inv_to_vox(self, input_data: Volume_S32, inverse_transform_to_vox: soma.Transformation3d, background: int, output_data: Volume_S32, verbose: bool = False)
resample_inv_to_vox(input_data, inverse_transform_to_vox, background, output_data, verbose=False) None

Resample a volume into an existing output volume.

The transformations, referentials, and referential header attributes of output_data are not touched; it is up to the calling code to update them accordingly.

This method does not use the instance state set by setRef() or setDefaultValue().

Derived classes can override this method to optimize interpolation of a full volume. The base class method simply calls doResample for each point.

Parameters:
  • input_data (Volume_S32) – data to be resampled (its voxel size is taken into account)

  • inverse_transform_to_vox (Transformation3d) – transformation from coordinates of the output volume (unit: mm), to coordinates of the input volume (unit: voxel)

  • background (int) – value set in output regions that are outside of the transformed input volume

  • output_data (Volume_S32) – existing volume to be filled with resampled data (its pre-existing dimensions and voxel size are used)

  • verbose (bool) – print progress to stdout

resample_inv_to_vox(self, input_data: Volume_S32, inverse_transform_to_vox: soma.Transformation3d, background: int, output_location: AimsVector_FLOAT_3, timestep: int) -> int resample_inv_to_vox(input_data, inverse_transform_to_vox, background, output_location, timestep) -> output_value

Resample a volume at a single location.

This method does not use the instance state set by setRef() or setDefaultValue().

input_data: Volume_S32

data to be resampled (its voxel size is taken into account)

inverse_transform_to_vox: Transformation3d

transformation from output coordinates to coordinates of the input volume (unit: voxel)

background: int

value set in output regions that are outside of the transformed input volume

output_location: Point3df (list of 3 floats)

coordinates in output space (destination space of transform)

timestep: int

for 4D volume, time step to be used

Returns:

resampled value

Return type:

int

setDefaultValue(self, a0: int)
setDefaultValue(value) None

Set the background value to be used by the doit() methods

Parameters:

value (int) – background value

setRef(self, a0: rc_ptr_Volume_S32)
setRef(input_data) None

Set the input data to be resampled by the doit() methods

Parameters:

input_data (Volume_S32) – volume to be resampled

class soma.aimsalgo.Resampler_U16(*args)

Resampling of data from a volume, applying a transformation.

The doit() and resample() methods can be used to apply an affine transformation (aims::AffineTransformation3d). They take a direct transformation, i.e. the transformation goes from the space of the input image (unit: mm) to the space of the output image (unit: mm). The transformation is inverted and normalized internally as needed, because the resamplers “pull” data by transforming output coordinates into input coordinates.

The doit() methods work on input data passed to the setRef() method. setDefaultValue() can also be called to set the background value.

The resample() methods provide stateless alternatives.

You can also use arbitrary non-affine transformations (inheriting soma::Transformation3d) by using the resample_inv() family of methods. In this case, you must pass the backward transformation (from output space to input space), because of the “pulling” mechanism described above.

Beware that contrary to the other methods, the resample_inv_to_vox() overloads take a transformation that maps to voxel coordinates of the input image. These methods can be slightly faster than resample_inv() because they map directly to the API of the actual resamplers are implementing (doResample()). This is especially true of the overload that performs resampling for a single point only.

defaultValue(self) int
defaultValue() None

Background value used by the doit() methods

Return type:

uint16_t

doit(self, transform: aims.AffineTransformation3d, output_data: Volume_U16)
doit(transform, output_data) None

Resample the input volume set with setRef() into an existing volume.

The background value (to be used for regions that are outside of the input volume) can be set with setDefaultValue().

The transformations, referentials, and referential header attributes of output_data are not touched; it is up to the calling code to update them accordingly.

The level of verbosity is taken from carto::verbose (i.e. the –verbose command-line argument is honoured).

Parameters:
  • transform (AffineTransformation3d) – transformation from coordinates of the input volume (unit: mm), to coordinates of the output volume (unit: mm) (its inverse is used for resampling)

  • output_data (Volume_U16) – existing volume to be filled with resampled data (its pre-existing dimensions and voxel size are used)

Raises:

RuntimeError – if no input volume has been set with setRef.

doit(self, transform: aims.AffineTransformation3d, dimx: int, dimy: int, dimz: int, voxel_size: AimsVector_FLOAT_3) -> rc_ptr_Volume_U16 doit(transform, dimx, dimy, dimz, voxel_size)

Resample the input volume set with setRef() in a newly allocated volume.

The background value (to be used for regions that are outside of the input volume) can be set with setDefaultValue().

The level of verbosity is taken from carto::verbose (i.e. the –verbose command-line argument is honoured).

The transformations, referentials, and referential header attributes of the new volume are reset if transform.isIdentity() is false:

  • the referential attribute is removed

  • each transformation in transformations is composed with transform so that the output volume still points to the original space. If that is not possible (e.g. the transformations attribute is missing or invalid), then a new transformation is added that points to the input volume.

Parameters:
  • transform (AffineTransformation3d) – transformation from coordinates of the input volume (unit: mm), to coordinates of the output volume (unit: mm) (its inverse is used for resampling)

  • dimX (int) – dimensions of the newly allocated volume

  • dimY (int) – dimensions of the newly allocated volume

  • dimZ (int) – dimensions of the newly allocated volume

  • voxel_size (Point3df (list of 3 floats)) – voxel size of the newly allocated volume (unit: mm)

Returns:

a newly allocated volume containing the resampled data (its size along the t axis is the same as the input volume).

Return type:

Volume_U16

Raises:

RuntimeError – if no input volume has been set with setRef.:

ref(self) rc_ptr_Volume_U16
ref() None

Input data to be resampled by the doit() methods

Return type:

Volume_U16

resample(self, input_data: Volume_U16, transform: aims.AffineTransformation3d, background: int, output_data: Volume_U16, verbose: bool = False)
resample(input_data, transform, background, output_data, verbose=False) None

Resample a volume into an existing output volume.

The transformations, referentials, and referential header attributes of output_data are not touched; it is up to the calling code to update them accordingly.

This method does not use the instance state set by setRef() or setDefaultValue().

Derived classes can override this method to optimize interpolation of a full volume. The base class method simply calls doResample for each point.

Parameters:
  • input_data (Volume_U16) – data to be resampled (its voxel size is taken into account)

  • transform (AffineTransformation3d) – transformation from coordinates of the input volume (unit: mm), to coordinates of the output volume (unit: mm) (its inverse is used for resampling)

  • background (uint16_t) – value set in output regions that are outside of the transformed input volume

  • output_data (Volume_U16) – existing volume to be filled with resampled data (its pre-existing dimensions and voxel size are used)

  • verbose (bool) – print progress to stdout

resample(self, input_data: Volume_U16, transform: aims.AffineTransformation3d, background: int, output_location: AimsVector_FLOAT_3, timestep: int) -> int resample(input_data, transform, background, output_location, timestep) -> output_value

Resample a volume at a single location.

This method does not use the instance state set by setRef() or setDefaultValue().

Parameters:
  • input_data (Volume_U16) – data to be resampled (its voxel size is taken into account)

  • transform (AffineTransformation3d) – transformation from coordinates of the input volume (unit: mm), to output coordinates (its inverse is used for resampling)

  • background (uint16_t) – value set in output regions that are outside of the transformed input volume

  • output_location (Point3df (list of 3 floats)) – coordinates in output space (destination space of transform)

  • timestep (int) – for 4D volume, time step to be used

Returns:

resampled value

Return type:

uint16_t

resample_inv(self, input_data: Volume_U16, inverse_transform: soma.Transformation3d, background: int, output_data: Volume_U16, verbose: bool = False)
resample_inv(input_data, inverse_transform, background, output_data, verbose=False) None

Resample a volume into an existing output volume.

The transformations, referentials, and referential header attributes of output_data are not touched; it is up to the calling code to update them accordingly.

This method does not use the instance state set by setRef() or setDefaultValue().

Parameters:
  • input_data (Volume_U16) – data to be resampled (its voxel size is taken into account)

  • inverse_transform (Transformation3d) – transformation from coordinates of the output volume (unit: mm), to coordinates of the input volume (unit: mm)

  • background (uint16_t) – value set in output regions that are outside of the transformed input volume

  • output_data (Volume_U16) – existing volume to be filled with resampled data (its pre-existing dimensions and voxel size are used)

  • verbose (bool) – print progress to stdout

resample_inv(self, input_data: Volume_U16, inverse_transform: soma.Transformation3d, background: int, output_location: AimsVector_FLOAT_3, timestep: int) -> int resample_inv(input_data, inverse_transform, background, output_location, timestep) -> output_value

Resample a volume at a single location.

This method does not use the instance state set by setRef() or setDefaultValue().

input_data: Volume_U16

data to be resampled (its voxel size is taken into account)

inverse_transform: Transformation3d

transformation from output coordinates to coordinates of the input volume (unit: mm)

background: uint16_t

value set in output regions that are outside of the transformed input volume

output_location: Point3df (list of 3 floats)

coordinates in output space (destination space of transform)

timestep: int

for 4D volume, time step to be used

Returns:

resampled value

Return type:

uint16_t

resample_inv_to_vox(self, input_data: Volume_U16, inverse_transform_to_vox: soma.Transformation3d, background: int, output_data: Volume_U16, verbose: bool = False)
resample_inv_to_vox(input_data, inverse_transform_to_vox, background, output_data, verbose=False) None

Resample a volume into an existing output volume.

The transformations, referentials, and referential header attributes of output_data are not touched; it is up to the calling code to update them accordingly.

This method does not use the instance state set by setRef() or setDefaultValue().

Derived classes can override this method to optimize interpolation of a full volume. The base class method simply calls doResample for each point.

Parameters:
  • input_data (Volume_U16) – data to be resampled (its voxel size is taken into account)

  • inverse_transform_to_vox (Transformation3d) – transformation from coordinates of the output volume (unit: mm), to coordinates of the input volume (unit: voxel)

  • background (uint16_t) – value set in output regions that are outside of the transformed input volume

  • output_data (Volume_U16) – existing volume to be filled with resampled data (its pre-existing dimensions and voxel size are used)

  • verbose (bool) – print progress to stdout

resample_inv_to_vox(self, input_data: Volume_U16, inverse_transform_to_vox: soma.Transformation3d, background: int, output_location: AimsVector_FLOAT_3, timestep: int) -> int resample_inv_to_vox(input_data, inverse_transform_to_vox, background, output_location, timestep) -> output_value

Resample a volume at a single location.

This method does not use the instance state set by setRef() or setDefaultValue().

input_data: Volume_U16

data to be resampled (its voxel size is taken into account)

inverse_transform_to_vox: Transformation3d

transformation from output coordinates to coordinates of the input volume (unit: voxel)

background: uint16_t

value set in output regions that are outside of the transformed input volume

output_location: Point3df (list of 3 floats)

coordinates in output space (destination space of transform)

timestep: int

for 4D volume, time step to be used

Returns:

resampled value

Return type:

uint16_t

setDefaultValue(self, a0: int)
setDefaultValue(value) None

Set the background value to be used by the doit() methods

Parameters:

value (uint16_t) – background value

setRef(self, a0: rc_ptr_Volume_U16)
setRef(input_data) None

Set the input data to be resampled by the doit() methods

Parameters:

input_data (Volume_U16) – volume to be resampled

class soma.aimsalgo.Resampler_U32(*args)

Resampling of data from a volume, applying a transformation.

The doit() and resample() methods can be used to apply an affine transformation (aims::AffineTransformation3d). They take a direct transformation, i.e. the transformation goes from the space of the input image (unit: mm) to the space of the output image (unit: mm). The transformation is inverted and normalized internally as needed, because the resamplers “pull” data by transforming output coordinates into input coordinates.

The doit() methods work on input data passed to the setRef() method. setDefaultValue() can also be called to set the background value.

The resample() methods provide stateless alternatives.

You can also use arbitrary non-affine transformations (inheriting soma::Transformation3d) by using the resample_inv() family of methods. In this case, you must pass the backward transformation (from output space to input space), because of the “pulling” mechanism described above.

Beware that contrary to the other methods, the resample_inv_to_vox() overloads take a transformation that maps to voxel coordinates of the input image. These methods can be slightly faster than resample_inv() because they map directly to the API of the actual resamplers are implementing (doResample()). This is especially true of the overload that performs resampling for a single point only.

defaultValue(self) int
defaultValue() None

Background value used by the doit() methods

Return type:

unsigned

doit(self, transform: aims.AffineTransformation3d, output_data: Volume_U32)
doit(transform, output_data) None

Resample the input volume set with setRef() into an existing volume.

The background value (to be used for regions that are outside of the input volume) can be set with setDefaultValue().

The transformations, referentials, and referential header attributes of output_data are not touched; it is up to the calling code to update them accordingly.

The level of verbosity is taken from carto::verbose (i.e. the –verbose command-line argument is honoured).

Parameters:
  • transform (AffineTransformation3d) – transformation from coordinates of the input volume (unit: mm), to coordinates of the output volume (unit: mm) (its inverse is used for resampling)

  • output_data (Volume_U32) – existing volume to be filled with resampled data (its pre-existing dimensions and voxel size are used)

Raises:

RuntimeError – if no input volume has been set with setRef.

doit(self, transform: aims.AffineTransformation3d, dimx: int, dimy: int, dimz: int, voxel_size: AimsVector_FLOAT_3) -> rc_ptr_Volume_U32 doit(transform, dimx, dimy, dimz, voxel_size)

Resample the input volume set with setRef() in a newly allocated volume.

The background value (to be used for regions that are outside of the input volume) can be set with setDefaultValue().

The level of verbosity is taken from carto::verbose (i.e. the –verbose command-line argument is honoured).

The transformations, referentials, and referential header attributes of the new volume are reset if transform.isIdentity() is false:

  • the referential attribute is removed

  • each transformation in transformations is composed with transform so that the output volume still points to the original space. If that is not possible (e.g. the transformations attribute is missing or invalid), then a new transformation is added that points to the input volume.

Parameters:
  • transform (AffineTransformation3d) – transformation from coordinates of the input volume (unit: mm), to coordinates of the output volume (unit: mm) (its inverse is used for resampling)

  • dimX (int) – dimensions of the newly allocated volume

  • dimY (int) – dimensions of the newly allocated volume

  • dimZ (int) – dimensions of the newly allocated volume

  • voxel_size (Point3df (list of 3 floats)) – voxel size of the newly allocated volume (unit: mm)

Returns:

a newly allocated volume containing the resampled data (its size along the t axis is the same as the input volume).

Return type:

Volume_U32

Raises:

RuntimeError – if no input volume has been set with setRef.:

ref(self) rc_ptr_Volume_U32
ref() None

Input data to be resampled by the doit() methods

Return type:

Volume_U32

resample(self, input_data: Volume_U32, transform: aims.AffineTransformation3d, background: int, output_data: Volume_U32, verbose: bool = False)
resample(input_data, transform, background, output_data, verbose=False) None

Resample a volume into an existing output volume.

The transformations, referentials, and referential header attributes of output_data are not touched; it is up to the calling code to update them accordingly.

This method does not use the instance state set by setRef() or setDefaultValue().

Derived classes can override this method to optimize interpolation of a full volume. The base class method simply calls doResample for each point.

Parameters:
  • input_data (Volume_U32) – data to be resampled (its voxel size is taken into account)

  • transform (AffineTransformation3d) – transformation from coordinates of the input volume (unit: mm), to coordinates of the output volume (unit: mm) (its inverse is used for resampling)

  • background (unsigned) – value set in output regions that are outside of the transformed input volume

  • output_data (Volume_U32) – existing volume to be filled with resampled data (its pre-existing dimensions and voxel size are used)

  • verbose (bool) – print progress to stdout

resample(self, input_data: Volume_U32, transform: aims.AffineTransformation3d, background: int, output_location: AimsVector_FLOAT_3, timestep: int) -> int resample(input_data, transform, background, output_location, timestep) -> output_value

Resample a volume at a single location.

This method does not use the instance state set by setRef() or setDefaultValue().

Parameters:
  • input_data (Volume_U32) – data to be resampled (its voxel size is taken into account)

  • transform (AffineTransformation3d) – transformation from coordinates of the input volume (unit: mm), to output coordinates (its inverse is used for resampling)

  • background (unsigned) – value set in output regions that are outside of the transformed input volume

  • output_location (Point3df (list of 3 floats)) – coordinates in output space (destination space of transform)

  • timestep (int) – for 4D volume, time step to be used

Returns:

resampled value

Return type:

unsigned

resample_inv(self, input_data: Volume_U32, inverse_transform: soma.Transformation3d, background: int, output_data: Volume_U32, verbose: bool = False)
resample_inv(input_data, inverse_transform, background, output_data, verbose=False) None

Resample a volume into an existing output volume.

The transformations, referentials, and referential header attributes of output_data are not touched; it is up to the calling code to update them accordingly.

This method does not use the instance state set by setRef() or setDefaultValue().

Parameters:
  • input_data (Volume_U32) – data to be resampled (its voxel size is taken into account)

  • inverse_transform (Transformation3d) – transformation from coordinates of the output volume (unit: mm), to coordinates of the input volume (unit: mm)

  • background (unsigned) – value set in output regions that are outside of the transformed input volume

  • output_data (Volume_U32) – existing volume to be filled with resampled data (its pre-existing dimensions and voxel size are used)

  • verbose (bool) – print progress to stdout

resample_inv(self, input_data: Volume_U32, inverse_transform: soma.Transformation3d, background: int, output_location: AimsVector_FLOAT_3, timestep: int) -> int resample_inv(input_data, inverse_transform, background, output_location, timestep) -> output_value

Resample a volume at a single location.

This method does not use the instance state set by setRef() or setDefaultValue().

input_data: Volume_U32

data to be resampled (its voxel size is taken into account)

inverse_transform: Transformation3d

transformation from output coordinates to coordinates of the input volume (unit: mm)

background: unsigned

value set in output regions that are outside of the transformed input volume

output_location: Point3df (list of 3 floats)

coordinates in output space (destination space of transform)

timestep: int

for 4D volume, time step to be used

Returns:

resampled value

Return type:

unsigned

resample_inv_to_vox(self, input_data: Volume_U32, inverse_transform_to_vox: soma.Transformation3d, background: int, output_data: Volume_U32, verbose: bool = False)
resample_inv_to_vox(input_data, inverse_transform_to_vox, background, output_data, verbose=False) None

Resample a volume into an existing output volume.

The transformations, referentials, and referential header attributes of output_data are not touched; it is up to the calling code to update them accordingly.

This method does not use the instance state set by setRef() or setDefaultValue().

Derived classes can override this method to optimize interpolation of a full volume. The base class method simply calls doResample for each point.

Parameters:
  • input_data (Volume_U32) – data to be resampled (its voxel size is taken into account)

  • inverse_transform_to_vox (Transformation3d) – transformation from coordinates of the output volume (unit: mm), to coordinates of the input volume (unit: voxel)

  • background (unsigned) – value set in output regions that are outside of the transformed input volume

  • output_data (Volume_U32) – existing volume to be filled with resampled data (its pre-existing dimensions and voxel size are used)

  • verbose (bool) – print progress to stdout

resample_inv_to_vox(self, input_data: Volume_U32, inverse_transform_to_vox: soma.Transformation3d, background: int, output_location: AimsVector_FLOAT_3, timestep: int) -> int resample_inv_to_vox(input_data, inverse_transform_to_vox, background, output_location, timestep) -> output_value

Resample a volume at a single location.

This method does not use the instance state set by setRef() or setDefaultValue().

input_data: Volume_U32

data to be resampled (its voxel size is taken into account)

inverse_transform_to_vox: Transformation3d

transformation from output coordinates to coordinates of the input volume (unit: voxel)

background: unsigned

value set in output regions that are outside of the transformed input volume

output_location: Point3df (list of 3 floats)

coordinates in output space (destination space of transform)

timestep: int

for 4D volume, time step to be used

Returns:

resampled value

Return type:

unsigned

setDefaultValue(self, a0: int)
setDefaultValue(value) None

Set the background value to be used by the doit() methods

Parameters:

value (unsigned) – background value

setRef(self, a0: rc_ptr_Volume_U32)
setRef(input_data) None

Set the input data to be resampled by the doit() methods

Parameters:

input_data (Volume_U32) – volume to be resampled

class soma.aimsalgo.Resampler_U8(*args)

Resampling of data from a volume, applying a transformation.

The doit() and resample() methods can be used to apply an affine transformation (aims::AffineTransformation3d). They take a direct transformation, i.e. the transformation goes from the space of the input image (unit: mm) to the space of the output image (unit: mm). The transformation is inverted and normalized internally as needed, because the resamplers “pull” data by transforming output coordinates into input coordinates.

The doit() methods work on input data passed to the setRef() method. setDefaultValue() can also be called to set the background value.

The resample() methods provide stateless alternatives.

You can also use arbitrary non-affine transformations (inheriting soma::Transformation3d) by using the resample_inv() family of methods. In this case, you must pass the backward transformation (from output space to input space), because of the “pulling” mechanism described above.

Beware that contrary to the other methods, the resample_inv_to_vox() overloads take a transformation that maps to voxel coordinates of the input image. These methods can be slightly faster than resample_inv() because they map directly to the API of the actual resamplers are implementing (doResample()). This is especially true of the overload that performs resampling for a single point only.

defaultValue(self) bytes
defaultValue() None

Background value used by the doit() methods

Return type:

unsigned short

doit(self, transform: aims.AffineTransformation3d, output_data: Volume_U8)
doit(transform, output_data) None

Resample the input volume set with setRef() into an existing volume.

The background value (to be used for regions that are outside of the input volume) can be set with setDefaultValue().

The transformations, referentials, and referential header attributes of output_data are not touched; it is up to the calling code to update them accordingly.

The level of verbosity is taken from carto::verbose (i.e. the –verbose command-line argument is honoured).

Parameters:
  • transform (AffineTransformation3d) – transformation from coordinates of the input volume (unit: mm), to coordinates of the output volume (unit: mm) (its inverse is used for resampling)

  • output_data (Volume_U8) – existing volume to be filled with resampled data (its pre-existing dimensions and voxel size are used)

Raises:

RuntimeError – if no input volume has been set with setRef.

doit(self, transform: aims.AffineTransformation3d, dimx: int, dimy: int, dimz: int, voxel_size: AimsVector_FLOAT_3) -> rc_ptr_Volume_U8 doit(transform, dimx, dimy, dimz, voxel_size)

Resample the input volume set with setRef() in a newly allocated volume.

The background value (to be used for regions that are outside of the input volume) can be set with setDefaultValue().

The level of verbosity is taken from carto::verbose (i.e. the –verbose command-line argument is honoured).

The transformations, referentials, and referential header attributes of the new volume are reset if transform.isIdentity() is false:

  • the referential attribute is removed

  • each transformation in transformations is composed with transform so that the output volume still points to the original space. If that is not possible (e.g. the transformations attribute is missing or invalid), then a new transformation is added that points to the input volume.

Parameters:
  • transform (AffineTransformation3d) – transformation from coordinates of the input volume (unit: mm), to coordinates of the output volume (unit: mm) (its inverse is used for resampling)

  • dimX (int) – dimensions of the newly allocated volume

  • dimY (int) – dimensions of the newly allocated volume

  • dimZ (int) – dimensions of the newly allocated volume

  • voxel_size (Point3df (list of 3 floats)) – voxel size of the newly allocated volume (unit: mm)

Returns:

a newly allocated volume containing the resampled data (its size along the t axis is the same as the input volume).

Return type:

Volume_U8

Raises:

RuntimeError – if no input volume has been set with setRef.:

ref(self) rc_ptr_Volume_U8
ref() None

Input data to be resampled by the doit() methods

Return type:

Volume_U8

resample(self, input_data: Volume_U8, transform: aims.AffineTransformation3d, background: bytes, output_data: Volume_U8, verbose: bool = False)
resample(input_data, transform, background, output_data, verbose=False) None

Resample a volume into an existing output volume.

The transformations, referentials, and referential header attributes of output_data are not touched; it is up to the calling code to update them accordingly.

This method does not use the instance state set by setRef() or setDefaultValue().

Derived classes can override this method to optimize interpolation of a full volume. The base class method simply calls doResample for each point.

Parameters:
  • input_data (Volume_U8) – data to be resampled (its voxel size is taken into account)

  • transform (AffineTransformation3d) – transformation from coordinates of the input volume (unit: mm), to coordinates of the output volume (unit: mm) (its inverse is used for resampling)

  • background (unsigned short) – value set in output regions that are outside of the transformed input volume

  • output_data (Volume_U8) – existing volume to be filled with resampled data (its pre-existing dimensions and voxel size are used)

  • verbose (bool) – print progress to stdout

resample(self, input_data: Volume_U8, transform: aims.AffineTransformation3d, background: bytes, output_location: AimsVector_FLOAT_3, timestep: int) -> bytes resample(input_data, transform, background, output_location, timestep) -> output_value

Resample a volume at a single location.

This method does not use the instance state set by setRef() or setDefaultValue().

Parameters:
  • input_data (Volume_U8) – data to be resampled (its voxel size is taken into account)

  • transform (AffineTransformation3d) – transformation from coordinates of the input volume (unit: mm), to output coordinates (its inverse is used for resampling)

  • background (unsigned short) – value set in output regions that are outside of the transformed input volume

  • output_location (Point3df (list of 3 floats)) – coordinates in output space (destination space of transform)

  • timestep (int) – for 4D volume, time step to be used

Returns:

resampled value

Return type:

unsigned short

resample_inv(self, input_data: Volume_U8, inverse_transform: soma.Transformation3d, background: bytes, output_data: Volume_U8, verbose: bool = False)
resample_inv(input_data, inverse_transform, background, output_data, verbose=False) None

Resample a volume into an existing output volume.

The transformations, referentials, and referential header attributes of output_data are not touched; it is up to the calling code to update them accordingly.

This method does not use the instance state set by setRef() or setDefaultValue().

Parameters:
  • input_data (Volume_U8) – data to be resampled (its voxel size is taken into account)

  • inverse_transform (Transformation3d) – transformation from coordinates of the output volume (unit: mm), to coordinates of the input volume (unit: mm)

  • background (unsigned short) – value set in output regions that are outside of the transformed input volume

  • output_data (Volume_U8) – existing volume to be filled with resampled data (its pre-existing dimensions and voxel size are used)

  • verbose (bool) – print progress to stdout

resample_inv(self, input_data: Volume_U8, inverse_transform: soma.Transformation3d, background: bytes, output_location: AimsVector_FLOAT_3, timestep: int) -> bytes resample_inv(input_data, inverse_transform, background, output_location, timestep) -> output_value

Resample a volume at a single location.

This method does not use the instance state set by setRef() or setDefaultValue().

input_data: Volume_U8

data to be resampled (its voxel size is taken into account)

inverse_transform: Transformation3d

transformation from output coordinates to coordinates of the input volume (unit: mm)

background: unsigned short

value set in output regions that are outside of the transformed input volume

output_location: Point3df (list of 3 floats)

coordinates in output space (destination space of transform)

timestep: int

for 4D volume, time step to be used

Returns:

resampled value

Return type:

unsigned short

resample_inv_to_vox(self, input_data: Volume_U8, inverse_transform_to_vox: soma.Transformation3d, background: bytes, output_data: Volume_U8, verbose: bool = False)
resample_inv_to_vox(input_data, inverse_transform_to_vox, background, output_data, verbose=False) None

Resample a volume into an existing output volume.

The transformations, referentials, and referential header attributes of output_data are not touched; it is up to the calling code to update them accordingly.

This method does not use the instance state set by setRef() or setDefaultValue().

Derived classes can override this method to optimize interpolation of a full volume. The base class method simply calls doResample for each point.

Parameters:
  • input_data (Volume_U8) – data to be resampled (its voxel size is taken into account)

  • inverse_transform_to_vox (Transformation3d) – transformation from coordinates of the output volume (unit: mm), to coordinates of the input volume (unit: voxel)

  • background (unsigned short) – value set in output regions that are outside of the transformed input volume

  • output_data (Volume_U8) – existing volume to be filled with resampled data (its pre-existing dimensions and voxel size are used)

  • verbose (bool) – print progress to stdout

resample_inv_to_vox(self, input_data: Volume_U8, inverse_transform_to_vox: soma.Transformation3d, background: bytes, output_location: AimsVector_FLOAT_3, timestep: int) -> bytes resample_inv_to_vox(input_data, inverse_transform_to_vox, background, output_location, timestep) -> output_value

Resample a volume at a single location.

This method does not use the instance state set by setRef() or setDefaultValue().

input_data: Volume_U8

data to be resampled (its voxel size is taken into account)

inverse_transform_to_vox: Transformation3d

transformation from output coordinates to coordinates of the input volume (unit: voxel)

background: unsigned short

value set in output regions that are outside of the transformed input volume

output_location: Point3df (list of 3 floats)

coordinates in output space (destination space of transform)

timestep: int

for 4D volume, time step to be used

Returns:

resampled value

Return type:

unsigned short

setDefaultValue(self, a0: bytes)
setDefaultValue(value) None

Set the background value to be used by the doit() methods

Parameters:

value (unsigned short) – background value

setRef(self, a0: rc_ptr_Volume_U8)
setRef(input_data) None

Set the input data to be resampled by the doit() methods

Parameters:

input_data (Volume_U8) – volume to be resampled

class soma.aimsalgo.Samplable_FLOAT_3
class soma.aimsalgo.Samplable_FLOAT_3(a0: aimsalgo.Samplable_FLOAT_3)
contains(self, a0: AimsVector_FLOAT_3) bool
class soma.aimsalgo.SeventhOrderResampler_DOUBLE(*args)

Volume resampler using seventh-order interpolation.

The resampling API is described in the base classes, Resampler_DOUBLE and SplineResampler_DOUBLE.

getOrder(self) int
class soma.aimsalgo.SeventhOrderResampler_FLOAT(*args)

Volume resampler using seventh-order interpolation.

The resampling API is described in the base classes, Resampler_FLOAT and SplineResampler_FLOAT.

getOrder(self) int
class soma.aimsalgo.SeventhOrderResampler_HSV(*args)

Volume resampler using seventh-order interpolation.

The resampling API is described in the base classes, Resampler_HSV and SplineResampler_HSV.

getOrder(self) int
class soma.aimsalgo.SeventhOrderResampler_POINT3DF(*args)

Volume resampler using seventh-order interpolation.

The resampling API is described in the base classes, Resampler_POINT3DF and SplineResampler_POINT3DF.

getOrder(self) int
class soma.aimsalgo.SeventhOrderResampler_RGB(*args)

Volume resampler using seventh-order interpolation.

The resampling API is described in the base classes, Resampler_RGB and SplineResampler_RGB.

getOrder(self) int
class soma.aimsalgo.SeventhOrderResampler_RGBA(*args)

Volume resampler using seventh-order interpolation.

The resampling API is described in the base classes, Resampler_RGBA and SplineResampler_RGBA.

getOrder(self) int
class soma.aimsalgo.SeventhOrderResampler_S16(*args)

Volume resampler using seventh-order interpolation.

The resampling API is described in the base classes, Resampler_S16 and SplineResampler_S16.

getOrder(self) int
class soma.aimsalgo.SeventhOrderResampler_S32(*args)

Volume resampler using seventh-order interpolation.

The resampling API is described in the base classes, Resampler_S32 and SplineResampler_S32.

getOrder(self) int
class soma.aimsalgo.SeventhOrderResampler_U16(*args)

Volume resampler using seventh-order interpolation.

The resampling API is described in the base classes, Resampler_U16 and SplineResampler_U16.

getOrder(self) int
class soma.aimsalgo.SeventhOrderResampler_U32(*args)

Volume resampler using seventh-order interpolation.

The resampling API is described in the base classes, Resampler_U32 and SplineResampler_U32.

getOrder(self) int
class soma.aimsalgo.SeventhOrderResampler_U8(*args)

Volume resampler using seventh-order interpolation.

The resampling API is described in the base classes, Resampler_U8 and SplineResampler_U8.

getOrder(self) int
class soma.aimsalgo.SixthOrderResampler_DOUBLE(*args)

Volume resampler using sixth-order interpolation.

The resampling API is described in the base classes, Resampler_DOUBLE and SplineResampler_DOUBLE.

getOrder(self) int
class soma.aimsalgo.SixthOrderResampler_FLOAT(*args)

Volume resampler using sixth-order interpolation.

The resampling API is described in the base classes, Resampler_FLOAT and SplineResampler_FLOAT.

getOrder(self) int
class soma.aimsalgo.SixthOrderResampler_HSV(*args)

Volume resampler using sixth-order interpolation.

The resampling API is described in the base classes, Resampler_HSV and SplineResampler_HSV.

getOrder(self) int
class soma.aimsalgo.SixthOrderResampler_POINT3DF(*args)

Volume resampler using sixth-order interpolation.

The resampling API is described in the base classes, Resampler_POINT3DF and SplineResampler_POINT3DF.

getOrder(self) int
class soma.aimsalgo.SixthOrderResampler_RGB(*args)

Volume resampler using sixth-order interpolation.

The resampling API is described in the base classes, Resampler_RGB and SplineResampler_RGB.

getOrder(self) int
class soma.aimsalgo.SixthOrderResampler_RGBA(*args)

Volume resampler using sixth-order interpolation.

The resampling API is described in the base classes, Resampler_RGBA and SplineResampler_RGBA.

getOrder(self) int
class soma.aimsalgo.SixthOrderResampler_S16(*args)

Volume resampler using sixth-order interpolation.

The resampling API is described in the base classes, Resampler_S16 and SplineResampler_S16.

getOrder(self) int
class soma.aimsalgo.SixthOrderResampler_S32(*args)

Volume resampler using sixth-order interpolation.

The resampling API is described in the base classes, Resampler_S32 and SplineResampler_S32.

getOrder(self) int
class soma.aimsalgo.SixthOrderResampler_U16(*args)

Volume resampler using sixth-order interpolation.

The resampling API is described in the base classes, Resampler_U16 and SplineResampler_U16.

getOrder(self) int
class soma.aimsalgo.SixthOrderResampler_U32(*args)

Volume resampler using sixth-order interpolation.

The resampling API is described in the base classes, Resampler_U32 and SplineResampler_U32.

getOrder(self) int
class soma.aimsalgo.SixthOrderResampler_U8(*args)

Volume resampler using sixth-order interpolation.

The resampling API is described in the base classes, Resampler_U8 and SplineResampler_U8.

getOrder(self) int
class soma.aimsalgo.SplineResampler_DOUBLE(*args)

B-Spline-based resampling.

This is the base class for all resamplers based on B-spline interpolation as described by Unser, Aldroubi & Eden in IEEE PAMI (1991). A class computing the actual spline coefficient is derived for each spline order (1 to 7).

SeeLinearResampler, CubicResampler, QuadraticResampler,

QuinticResampler, SixthOrderResampler, SeventhOrderResampler

Coefficients are computed through a recursive scheme from an input reference volume. This recursive algorithm is fast for whole volume resampling, but slower for single points. A cache mechanism has thus been implemented so that coefficients are not recomputed if the input volume did not change.

The Resampling API is described in the base class, Resampler_DOUBLE.

getOrder(self) int

order = getOrder()

Spline order (1 to 7)

Returns:

order

Return type:

int (1 to 7)

getSplineCoef(self, inVolume: Volume_DOUBLE, t: int = 0, verbose: bool = False) rc_ptr_Volume_DOUBLE
reset(self)

Computes spline coefficients corresponding to an input volume.

Spline coefficients are recomputed only if one of these conditions is satisfied: - inVolume is different from the last volume used for coefficients

computation (in the sense that they share the same adress)

  • t is different from the last t used for coefficients computation

  • A call to reset() has previously been made

This method actually calls updateParameters() and returns the coeff container

Parameters:
  • inVolume (Volume_DOUBLE) – input image

  • t (int) – volume to use in the T dimension in the case where inVolume is a time series.

  • verbose (bool) – print progress on stdout

Returns:

Volume of double containing the coefficients in the image domain. Border coefficient need to be retrieved by mirror.

Return type:

Volume_DOUBLE

class soma.aimsalgo.SplineResampler_FLOAT(*args)

B-Spline-based resampling.

This is the base class for all resamplers based on B-spline interpolation as described by Unser, Aldroubi & Eden in IEEE PAMI (1991). A class computing the actual spline coefficient is derived for each spline order (1 to 7).

SeeLinearResampler, CubicResampler, QuadraticResampler,

QuinticResampler, SixthOrderResampler, SeventhOrderResampler

Coefficients are computed through a recursive scheme from an input reference volume. This recursive algorithm is fast for whole volume resampling, but slower for single points. A cache mechanism has thus been implemented so that coefficients are not recomputed if the input volume did not change.

The Resampling API is described in the base class, Resampler_FLOAT.

getOrder(self) int

order = getOrder()

Spline order (1 to 7)

Returns:

order

Return type:

int (1 to 7)

getSplineCoef(self, inVolume: Volume_FLOAT, t: int = 0, verbose: bool = False) rc_ptr_Volume_DOUBLE
reset(self)

Computes spline coefficients corresponding to an input volume.

Spline coefficients are recomputed only if one of these conditions is satisfied: - inVolume is different from the last volume used for coefficients

computation (in the sense that they share the same adress)

  • t is different from the last t used for coefficients computation

  • A call to reset() has previously been made

This method actually calls updateParameters() and returns the coeff container

Parameters:
  • inVolume (Volume_FLOAT) – input image

  • t (int) – volume to use in the T dimension in the case where inVolume is a time series.

  • verbose (bool) – print progress on stdout

Returns:

Volume of double containing the coefficients in the image domain. Border coefficient need to be retrieved by mirror.

Return type:

Volume_DOUBLE

class soma.aimsalgo.SplineResampler_HSV(*args)

B-Spline-based resampling.

This is the base class for all resamplers based on B-spline interpolation as described by Unser, Aldroubi & Eden in IEEE PAMI (1991). A class computing the actual spline coefficient is derived for each spline order (1 to 7).

SeeLinearResampler, CubicResampler, QuadraticResampler,

QuinticResampler, SixthOrderResampler, SeventhOrderResampler

Coefficients are computed through a recursive scheme from an input reference volume. This recursive algorithm is fast for whole volume resampling, but slower for single points. A cache mechanism has thus been implemented so that coefficients are not recomputed if the input volume did not change.

The Resampling API is described in the base class, Resampler_HSV.

getOrder(self) int

order = getOrder()

Spline order (1 to 7)

Returns:

order

Return type:

int (1 to 7)

getSplineCoef(self, inVolume: Volume_HSV, t: int = 0, verbose: bool = False) rc_ptr_Volume_DOUBLE
reset(self)

Computes spline coefficients corresponding to an input volume.

Spline coefficients are recomputed only if one of these conditions is satisfied: - inVolume is different from the last volume used for coefficients

computation (in the sense that they share the same adress)

  • t is different from the last t used for coefficients computation

  • A call to reset() has previously been made

This method actually calls updateParameters() and returns the coeff container

Parameters:
  • inVolume (Volume_HSV) – input image

  • t (int) – volume to use in the T dimension in the case where inVolume is a time series.

  • verbose (bool) – print progress on stdout

Returns:

Volume of double containing the coefficients in the image domain. Border coefficient need to be retrieved by mirror.

Return type:

Volume_DOUBLE

class soma.aimsalgo.SplineResampler_POINT3DF(*args)

B-Spline-based resampling.

This is the base class for all resamplers based on B-spline interpolation as described by Unser, Aldroubi & Eden in IEEE PAMI (1991). A class computing the actual spline coefficient is derived for each spline order (1 to 7).

SeeLinearResampler, CubicResampler, QuadraticResampler,

QuinticResampler, SixthOrderResampler, SeventhOrderResampler

Coefficients are computed through a recursive scheme from an input reference volume. This recursive algorithm is fast for whole volume resampling, but slower for single points. A cache mechanism has thus been implemented so that coefficients are not recomputed if the input volume did not change.

The Resampling API is described in the base class, Resampler_POINT3DF.

getOrder(self) int

order = getOrder()

Spline order (1 to 7)

Returns:

order

Return type:

int (1 to 7)

getSplineCoef(self, inVolume: Volume_POINT3DF, t: int = 0, verbose: bool = False) rc_ptr_Volume_DOUBLE
reset(self)

Computes spline coefficients corresponding to an input volume.

Spline coefficients are recomputed only if one of these conditions is satisfied: - inVolume is different from the last volume used for coefficients

computation (in the sense that they share the same adress)

  • t is different from the last t used for coefficients computation

  • A call to reset() has previously been made

This method actually calls updateParameters() and returns the coeff container

Parameters:
  • inVolume (Volume_POINT3DF) – input image

  • t (int) – volume to use in the T dimension in the case where inVolume is a time series.

  • verbose (bool) – print progress on stdout

Returns:

Volume of double containing the coefficients in the image domain. Border coefficient need to be retrieved by mirror.

Return type:

Volume_DOUBLE

class soma.aimsalgo.SplineResampler_RGB(*args)

B-Spline-based resampling.

This is the base class for all resamplers based on B-spline interpolation as described by Unser, Aldroubi & Eden in IEEE PAMI (1991). A class computing the actual spline coefficient is derived for each spline order (1 to 7).

SeeLinearResampler, CubicResampler, QuadraticResampler,

QuinticResampler, SixthOrderResampler, SeventhOrderResampler

Coefficients are computed through a recursive scheme from an input reference volume. This recursive algorithm is fast for whole volume resampling, but slower for single points. A cache mechanism has thus been implemented so that coefficients are not recomputed if the input volume did not change.

The Resampling API is described in the base class, Resampler_RGB.

getOrder(self) int

order = getOrder()

Spline order (1 to 7)

Returns:

order

Return type:

int (1 to 7)

getSplineCoef(self, inVolume: Volume_RGB, t: int = 0, verbose: bool = False) rc_ptr_Volume_DOUBLE
reset(self)

Computes spline coefficients corresponding to an input volume.

Spline coefficients are recomputed only if one of these conditions is satisfied: - inVolume is different from the last volume used for coefficients

computation (in the sense that they share the same adress)

  • t is different from the last t used for coefficients computation

  • A call to reset() has previously been made

This method actually calls updateParameters() and returns the coeff container

Parameters:
  • inVolume (Volume_RGB) – input image

  • t (int) – volume to use in the T dimension in the case where inVolume is a time series.

  • verbose (bool) – print progress on stdout

Returns:

Volume of double containing the coefficients in the image domain. Border coefficient need to be retrieved by mirror.

Return type:

Volume_DOUBLE

class soma.aimsalgo.SplineResampler_RGBA(*args)

B-Spline-based resampling.

This is the base class for all resamplers based on B-spline interpolation as described by Unser, Aldroubi & Eden in IEEE PAMI (1991). A class computing the actual spline coefficient is derived for each spline order (1 to 7).

SeeLinearResampler, CubicResampler, QuadraticResampler,

QuinticResampler, SixthOrderResampler, SeventhOrderResampler

Coefficients are computed through a recursive scheme from an input reference volume. This recursive algorithm is fast for whole volume resampling, but slower for single points. A cache mechanism has thus been implemented so that coefficients are not recomputed if the input volume did not change.

The Resampling API is described in the base class, Resampler_RGBA.

getOrder(self) int

order = getOrder()

Spline order (1 to 7)

Returns:

order

Return type:

int (1 to 7)

getSplineCoef(self, inVolume: Volume_RGBA, t: int = 0, verbose: bool = False) rc_ptr_Volume_DOUBLE
reset(self)

Computes spline coefficients corresponding to an input volume.

Spline coefficients are recomputed only if one of these conditions is satisfied: - inVolume is different from the last volume used for coefficients

computation (in the sense that they share the same adress)

  • t is different from the last t used for coefficients computation

  • A call to reset() has previously been made

This method actually calls updateParameters() and returns the coeff container

Parameters:
  • inVolume (Volume_RGBA) – input image

  • t (int) – volume to use in the T dimension in the case where inVolume is a time series.

  • verbose (bool) – print progress on stdout

Returns:

Volume of double containing the coefficients in the image domain. Border coefficient need to be retrieved by mirror.

Return type:

Volume_DOUBLE

class soma.aimsalgo.SplineResampler_S16(*args)

B-Spline-based resampling.

This is the base class for all resamplers based on B-spline interpolation as described by Unser, Aldroubi & Eden in IEEE PAMI (1991). A class computing the actual spline coefficient is derived for each spline order (1 to 7).

SeeLinearResampler, CubicResampler, QuadraticResampler,

QuinticResampler, SixthOrderResampler, SeventhOrderResampler

Coefficients are computed through a recursive scheme from an input reference volume. This recursive algorithm is fast for whole volume resampling, but slower for single points. A cache mechanism has thus been implemented so that coefficients are not recomputed if the input volume did not change.

The Resampling API is described in the base class, Resampler_S16.

getOrder(self) int

order = getOrder()

Spline order (1 to 7)

Returns:

order

Return type:

int (1 to 7)

getSplineCoef(self, inVolume: Volume_S16, t: int = 0, verbose: bool = False) rc_ptr_Volume_DOUBLE
reset(self)

Computes spline coefficients corresponding to an input volume.

Spline coefficients are recomputed only if one of these conditions is satisfied: - inVolume is different from the last volume used for coefficients

computation (in the sense that they share the same adress)

  • t is different from the last t used for coefficients computation

  • A call to reset() has previously been made

This method actually calls updateParameters() and returns the coeff container

Parameters:
  • inVolume (Volume_S16) – input image

  • t (int) – volume to use in the T dimension in the case where inVolume is a time series.

  • verbose (bool) – print progress on stdout

Returns:

Volume of double containing the coefficients in the image domain. Border coefficient need to be retrieved by mirror.

Return type:

Volume_DOUBLE

class soma.aimsalgo.SplineResampler_S32(*args)

B-Spline-based resampling.

This is the base class for all resamplers based on B-spline interpolation as described by Unser, Aldroubi & Eden in IEEE PAMI (1991). A class computing the actual spline coefficient is derived for each spline order (1 to 7).

SeeLinearResampler, CubicResampler, QuadraticResampler,

QuinticResampler, SixthOrderResampler, SeventhOrderResampler

Coefficients are computed through a recursive scheme from an input reference volume. This recursive algorithm is fast for whole volume resampling, but slower for single points. A cache mechanism has thus been implemented so that coefficients are not recomputed if the input volume did not change.

The Resampling API is described in the base class, Resampler_S32.

getOrder(self) int

order = getOrder()

Spline order (1 to 7)

Returns:

order

Return type:

int (1 to 7)

getSplineCoef(self, inVolume: Volume_S32, t: int = 0, verbose: bool = False) rc_ptr_Volume_DOUBLE
reset(self)

Computes spline coefficients corresponding to an input volume.

Spline coefficients are recomputed only if one of these conditions is satisfied: - inVolume is different from the last volume used for coefficients

computation (in the sense that they share the same adress)

  • t is different from the last t used for coefficients computation

  • A call to reset() has previously been made

This method actually calls updateParameters() and returns the coeff container

Parameters:
  • inVolume (Volume_S32) – input image

  • t (int) – volume to use in the T dimension in the case where inVolume is a time series.

  • verbose (bool) – print progress on stdout

Returns:

Volume of double containing the coefficients in the image domain. Border coefficient need to be retrieved by mirror.

Return type:

Volume_DOUBLE

class soma.aimsalgo.SplineResampler_U16(*args)

B-Spline-based resampling.

This is the base class for all resamplers based on B-spline interpolation as described by Unser, Aldroubi & Eden in IEEE PAMI (1991). A class computing the actual spline coefficient is derived for each spline order (1 to 7).

SeeLinearResampler, CubicResampler, QuadraticResampler,

QuinticResampler, SixthOrderResampler, SeventhOrderResampler

Coefficients are computed through a recursive scheme from an input reference volume. This recursive algorithm is fast for whole volume resampling, but slower for single points. A cache mechanism has thus been implemented so that coefficients are not recomputed if the input volume did not change.

The Resampling API is described in the base class, Resampler_U16.

getOrder(self) int

order = getOrder()

Spline order (1 to 7)

Returns:

order

Return type:

int (1 to 7)

getSplineCoef(self, inVolume: Volume_U16, t: int = 0, verbose: bool = False) rc_ptr_Volume_DOUBLE
reset(self)

Computes spline coefficients corresponding to an input volume.

Spline coefficients are recomputed only if one of these conditions is satisfied: - inVolume is different from the last volume used for coefficients

computation (in the sense that they share the same adress)

  • t is different from the last t used for coefficients computation

  • A call to reset() has previously been made

This method actually calls updateParameters() and returns the coeff container

Parameters:
  • inVolume (Volume_U16) – input image

  • t (int) – volume to use in the T dimension in the case where inVolume is a time series.

  • verbose (bool) – print progress on stdout

Returns:

Volume of double containing the coefficients in the image domain. Border coefficient need to be retrieved by mirror.

Return type:

Volume_DOUBLE

class soma.aimsalgo.SplineResampler_U32(*args)

B-Spline-based resampling.

This is the base class for all resamplers based on B-spline interpolation as described by Unser, Aldroubi & Eden in IEEE PAMI (1991). A class computing the actual spline coefficient is derived for each spline order (1 to 7).

SeeLinearResampler, CubicResampler, QuadraticResampler,

QuinticResampler, SixthOrderResampler, SeventhOrderResampler

Coefficients are computed through a recursive scheme from an input reference volume. This recursive algorithm is fast for whole volume resampling, but slower for single points. A cache mechanism has thus been implemented so that coefficients are not recomputed if the input volume did not change.

The Resampling API is described in the base class, Resampler_U32.

getOrder(self) int

order = getOrder()

Spline order (1 to 7)

Returns:

order

Return type:

int (1 to 7)

getSplineCoef(self, inVolume: Volume_U32, t: int = 0, verbose: bool = False) rc_ptr_Volume_DOUBLE
reset(self)

Computes spline coefficients corresponding to an input volume.

Spline coefficients are recomputed only if one of these conditions is satisfied: - inVolume is different from the last volume used for coefficients

computation (in the sense that they share the same adress)

  • t is different from the last t used for coefficients computation

  • A call to reset() has previously been made

This method actually calls updateParameters() and returns the coeff container

Parameters:
  • inVolume (Volume_U32) – input image

  • t (int) – volume to use in the T dimension in the case where inVolume is a time series.

  • verbose (bool) – print progress on stdout

Returns:

Volume of double containing the coefficients in the image domain. Border coefficient need to be retrieved by mirror.

Return type:

Volume_DOUBLE

class soma.aimsalgo.SplineResampler_U8(*args)

B-Spline-based resampling.

This is the base class for all resamplers based on B-spline interpolation as described by Unser, Aldroubi & Eden in IEEE PAMI (1991). A class computing the actual spline coefficient is derived for each spline order (1 to 7).

SeeLinearResampler, CubicResampler, QuadraticResampler,

QuinticResampler, SixthOrderResampler, SeventhOrderResampler

Coefficients are computed through a recursive scheme from an input reference volume. This recursive algorithm is fast for whole volume resampling, but slower for single points. A cache mechanism has thus been implemented so that coefficients are not recomputed if the input volume did not change.

The Resampling API is described in the base class, Resampler_U8.

getOrder(self) int

order = getOrder()

Spline order (1 to 7)

Returns:

order

Return type:

int (1 to 7)

getSplineCoef(self, inVolume: Volume_U8, t: int = 0, verbose: bool = False) rc_ptr_Volume_DOUBLE
reset(self)

Computes spline coefficients corresponding to an input volume.

Spline coefficients are recomputed only if one of these conditions is satisfied: - inVolume is different from the last volume used for coefficients

computation (in the sense that they share the same adress)

  • t is different from the last t used for coefficients computation

  • A call to reset() has previously been made

This method actually calls updateParameters() and returns the coeff container

Parameters:
  • inVolume (Volume_U8) – input image

  • t (int) – volume to use in the T dimension in the case where inVolume is a time series.

  • verbose (bool) – print progress on stdout

Returns:

Volume of double containing the coefficients in the image domain. Border coefficient need to be retrieved by mirror.

Return type:

Volume_DOUBLE

class soma.aimsalgo.TopologicalClassificationBase
class soma.aimsalgo.TopologicalClassificationBase(a0: TopologicalClassificationBase)
Cbar(self) int
Cstar(self) int
class PointNumber
computeLocalCCNumbers(self, a0: AimsVector_S16_3, a1: int)
computeLocalCCNumbers(self, a0: AimsVector_S16_3, a1: int, a2: int) None
computeLocalCCNumbersComplement(self, a0: AimsVector_S16_3, a1: int)
isCurvesPoint(self) bool
isRealSurfacePoint(self) bool
isSimplePoint(self) bool
isSimplePoint(self, a0: AimsVector_S16_3, a1: int) bool
isSimplePoint(self, a0: AimsVector_S16_3, a1: int, a2: int) bool
isSimplePointComplement(self, a0: AimsVector_S16_3, a1: int) bool
isSurfacesPoint(self) bool
class soma.aimsalgo.TopologicalClassificationMeaning

Meaning of TopologicalClassification results

class TopoType
class TopoTypeFull
classification(a0: int, a1: int) int
name(a0: int, a1: int) object
stringFromDefine(a0: int) object
class soma.aimsalgo.TopologicalClassification_DOUBLE

Topological classification per voxel

class soma.aimsalgo.TopologicalClassification_FLOAT

Topological classification per voxel

class soma.aimsalgo.TopologicalClassification_S16

Topological classification per voxel

class soma.aimsalgo.TopologicalClassification_S32

Topological classification per voxel

class soma.aimsalgo.TopologicalClassification_U16

Topological classification per voxel

class soma.aimsalgo.TopologicalClassification_U32

Topological classification per voxel

class soma.aimsalgo.TopologicalClassification_U8

Topological classification per voxel

class soma.aimsalgo.TopologicalClassifier_Volume_DOUBLE

Topological classification of voxels (normally on a skeleton) for a whole volume

doit(self, a0: rc_ptr_Volume_DOUBLE) rc_ptr_Volume_DOUBLE
class soma.aimsalgo.TopologicalClassifier_Volume_FLOAT

Topological classification of voxels (normally on a skeleton) for a whole volume

doit(self, a0: rc_ptr_Volume_FLOAT) rc_ptr_Volume_FLOAT
class soma.aimsalgo.TopologicalClassifier_Volume_S16

Topological classification of voxels (normally on a skeleton) for a whole volume

doit(self, a0: rc_ptr_Volume_S16) rc_ptr_Volume_S16
class soma.aimsalgo.TopologicalClassifier_Volume_S32

Topological classification of voxels (normally on a skeleton) for a whole volume

doit(self, a0: rc_ptr_Volume_S32) rc_ptr_Volume_S32
class soma.aimsalgo.TopologicalClassifier_Volume_U16

Topological classification of voxels (normally on a skeleton) for a whole volume

doit(self, a0: rc_ptr_Volume_U16) rc_ptr_Volume_U16
class soma.aimsalgo.TopologicalClassifier_Volume_U32

Topological classification of voxels (normally on a skeleton) for a whole volume

doit(self, a0: rc_ptr_Volume_U32) rc_ptr_Volume_U32
class soma.aimsalgo.TopologicalClassifier_Volume_U8

Topological classification of voxels (normally on a skeleton) for a whole volume

doit(self, a0: rc_ptr_Volume_U8) rc_ptr_Volume_U8
class soma.aimsalgo.TriangulationMoment(a0: MomentBase.MomentType = MomentBase.Volumic)
class soma.aimsalgo.TriangulationMoment(a0: TriangulationMoment)
doit(self, a0: AimsTimeSurface_3_VOID)
setMomentType(self, a0: MomentBase.MomentType)
class soma.aimsalgo.Writer_FfdTransformation

FFD vector field transformation writer. It actually reads a volume of Point3df.

write(self, obj: aims.FfdTransformation, ascii: bool = False, format: object | None = None) bool
soma.aimsalgo.blobsHeights(mesh: AimsTimeSurface_3_VOID, field: vector_DOUBLE, watershedlabels: vector_S32) vector_S32 | None
soma.aimsalgo.hyp0f1(a: float, x: Any, MAX: int) float
soma.aimsalgo.hyp1f1(a: float, b: float, x: Any, MAX: int) float
soma.aimsalgo.loghyp0f1(a: float, x: Any, MAX: int) float
soma.aimsalgo.loghyp1f1(a: float, b: float, x: Any, MAX: int) float
soma.aimsalgo.meshBlobsBifurcation(mesh: AimsTimeSurface_3_VOID, field: vector_DOUBLE, idx: vector_S32, height: vector_DOUBLE, father: vector_S32, label: vector_S32, th: float) int
soma.aimsalgo.meshBlobsBifurcation(mesh: AimsTimeSurface_3_VOID, field: TimeTexture_DOUBLE, th: float) None
soma.aimsalgo.meshBlobsBifurcation(mesh: AimsTimeSurface_3_VOID, field: TimeTexture_FLOAT, th: float) None
soma.aimsalgo.meshWatershed(mesh: AimsTimeSurface_3_VOID, field: vector_DOUBLE, idx: vector_S32, depth: vector_S32, major: vector_S32, label: vector_S32, threshold: float) int
soma.aimsalgo.meshWatershed(mesh: AimsTimeSurface_3_VOID, field: TimeTexture_DOUBLE, threshold: float) None
soma.aimsalgo.meshWatershed(mesh: AimsTimeSurface_3_VOID, field: TimeTexture_FLOAT, threshold: float) None
class soma.aimsalgo.rc_ptr_FfdTransformation
class soma.aimsalgo.rc_ptr_FfdTransformation(a0: aims.FfdTransformation | None)
class soma.aimsalgo.rc_ptr_FfdTransformation(a0: rc_ptr_FfdTransformation)
isNull(self) bool
release(self)
reset(self, a0: aims.FfdTransformation | None)
class soma.aimsalgo.rc_ptr_GeometricProperties
class soma.aimsalgo.rc_ptr_GeometricProperties(a0: aims.GeometricProperties | None)
class soma.aimsalgo.rc_ptr_GeometricProperties(a0: rc_ptr_GeometricProperties)
isNull(self) bool
release(self)
reset(self, a0: aims.GeometricProperties | None)
class soma.aimsalgo.rc_ptr_SplineFfd
class soma.aimsalgo.rc_ptr_SplineFfd(a0: aims.SplineFfd | None)
class soma.aimsalgo.rc_ptr_SplineFfd(a0: rc_ptr_SplineFfd)
isNull(self) bool
release(self)
reset(self, a0: aims.SplineFfd | None)
class soma.aimsalgo.rc_ptr_TrilinearFfd
class soma.aimsalgo.rc_ptr_TrilinearFfd(a0: aims.TrilinearFfd | None)
class soma.aimsalgo.rc_ptr_TrilinearFfd(a0: rc_ptr_TrilinearFfd)
isNull(self) bool
release(self)
reset(self, a0: aims.TrilinearFfd | None)
soma.aimsalgo.resampleBucket(bck: BucketMap_VOID, direct_transformation: soma.Transformation3d, inverse_transformation: soma.Transformation3d, vs: AimsVector_FLOAT_3 = Point3df(0, 0, 0), also_pushforward: bool = True) rc_ptr_BucketMap_VOID
resampleBucket(bck, direct_transformation, inverse_transformation,

vs=aims.Point3df(0., 0., 0.), also_pushforward=True)

Apply a spatial transformation to a BucketMap.

The bucket is transformed by resampling, using a pull-back method in the same way as nearest neighbour resampling of a Volume.

Pure pull-back resampling does not behave well when downsampling (it introduces holes), so by default this function returns the union of voxels transformed using the pushforward and pullback methods. Set also_pushforward to false to disable this behaviour and only perform pure pullback.

The voxel size of the output bucket can optionally be specified in vs. By default, the same voxel size as the input bucket is used.

Warning

Alhtough this method is more reliable than transformBucketDirect, it still provides no guarantees of topology preservation.

soma.aimsalgo.simple_delaunay_triangulation(points: vector_POINT2DF, verbose: bool = False) vector_AimsVector_U32_3 | None

triangles = simple_delaunay_triangulation(points, verbose=False)

Get a Delaunay triangulation for a polygon. Poins in the polygon should be ordered in a clockwise or counterclockwise order.

Note that it is different from a classical Delaunay algorithm wich meshes a cloud point (and its convex hull), not a polygon as here.

soma.aimsalgo.transformBucketDirect(bck: BucketMap_VOID, direct_transformation: soma.Transformation3d, vs: AimsVector_FLOAT_3 = Point3df(0, 0, 0)) rc_ptr_BucketMap_VOID
soma.aimsalgo.transformBucketDirect(bck, direct_transformation, vs=aims.Point3df(0., 0., 0.)) None

Apply a spatial transformation to a BucketMap

Each voxel of the input bucket is transformed with direct_transformation, and the closest voxel of the output bucket is set. The voxel size of the output bucket can optionally be specified in vs. By default, the same voxel size as the input bucket is used.

Warning

This method provides no guarantees of topology preservation; in fact it will create holes in the resulting bucket, particularly when upsampling. When possible, you should use resampleBucket() instead, which performs nearest-neighbour resampling.

soma.aimsalgo.transformGraph(graph: Graph, direct_transformation: soma.Transformation3d, inverse_transformation: soma.Transformation3d | None, vs: AimsVector_FLOAT_3 = Point3df(0, 0, 0))
transformGraph(graph, direct_transformation, inverse_transformation,

vs=aims.Point3df(0., 0., 0.))

Apply a spatial transformation to all objects contained in a Graph.

The graph is modified in-place.

An inverse transformation is necessary for correctly transforming Buckets (see resampleBucket). If inverse_transformation is NULL, buckets will be transformed with the push-forward method only (transformBucketDirect).

Warning

Volumes are not transformed, neither are graph attributes. Please run AimsFoldArgAtt to fix the values of basic attributes, or the CorticalFoldsGraphUpgradeFromOld BrainVisa process, which can be found under Morphologist/Sulci/graphmanipulation, for a complete update.

soma.aimsalgo.transformMesh(mesh: AimsTimeSurface_2_VOID, direct_transformation: soma.Transformation3d)
soma.aimsalgo.transformMesh(mesh, direct_transformation) None

Apply a spatial transformation to a segments mesh (AimsTimeSurface).

The mesh is transformed in-place and modified.

Each vertex of the mesh is transformed according to the supplied transformation. Normals are re-calculated from the new vertex positions.

transformMesh(mesh: AimsTimeSurface_3_VOID, direct_transformation: soma.Transformation3d) transformMesh(mesh, direct_transformation)

Apply a spatial transformation to a triangles mesh (AimsTimeSurface)

The mesh is transformed in-place and modified.

Each vertex of the mesh is transformed according to the supplied transformation. Normals are re-calculated from the new vertex positions.

transformMesh(mesh: AimsTimeSurface_4_VOID, direct_transformation: soma.Transformation3d) transformMesh(mesh, direct_transformation)

Apply a spatial transformation to a quads mesh (AimsTimeSurface)

The mesh is transformed in-place and modified.

Each vertex of the mesh is transformed according to the supplied transformation. Normals are re-calculated from the new vertex positions.

soma.aimsalgo.t1mapping module

Reconstruct magnetic resonance parametres.

This is mainly a re-implementation of scripts provided by Alexandre Vignaud, plus a few improvements functions (such as mask and B1 map holes filling).

class soma.aimsalgo.t1mapping.BAFIData(amplitude_volume, phase_volume)[source]

B1 map reconstruction class using the VFA (Variable Flip Angle) method.

Pass the BAFI data as two amplitude-phase 4D AIMS volumes.

The last dimension of both arrays represents the different echos.

static correctB0(FA_map, FA_phase, B0_map, tau, echo_time)[source]

Apply B0 correction to a B1 map.

This is a re-implementation of correctB0.m, courtesy of Alexandre Vignaud.

fix_b1_map(b1map, smooth_type='median', gaussian=False, output_median=False)[source]

Fix/improve the B1 map by filling holes, smoothing, and extending it a little bit spacially so as to use it on the complete whole brain.

Parameters:
  • b1map (volume) – the B1 map to be corrected, may be the output of self.make_flip_angle_map()

  • smooth_type (str (optional)) – smoothing correction type. default: ‘median’ median: dilated:

  • gaussian (float (optional)) – default: 0 (not applied) perform an additional gaussian filtering of given stdev

  • output_median (bool (optional)) – if set, the output will be a tuple including a 2nd volume: the median-filtered B1 map. Only valid if smooth_type is ‘median’.

Returns:

  • The corrected B1 map.

  • If output_median is set, the return value is a tuple

  • (corrected B1 map, median-filtered B1 map)

make_B0_map()[source]

Build a map of B0 in Hz from BAFI data.

Return the map as a numpy array.

This is a re-implementation of Phase2B0Map.m, courtesy of Alexandre Vignaud.

make_B1_map(B0_correction=False)[source]

Build a map of B1 (in radians) from BAFI data.

Return a numpy array of complex type.

This is a re-implementation of BAFI2B1map.m, courtesy of Alexandre Vignaud.

  • The method is Yarnykh’s (MRM 57:192-200 (2007)) +

  • Amadon ISMRM2008 (MAFI sequence: simultaneaous cartography of B0

and B1)

make_flip_angle_map()[source]

Build a map of actual flip angle (in radians) from BAFI data.

This is a re-implementation of BAFI2FAmap.m (courtesy of Alexandre Vignaud) modified to return only the real flip angle (omitting the phase).

  • The method is Yarnykh’s (MRM 57:192-200 (2007)) +

  • Amadon ISMRM2008 (MAFI sequence: simultaneaous cartography of B0

and B1)

class soma.aimsalgo.t1mapping.GREData2FlipAngles(min_FA_volume, max_FA_volume)[source]
soma.aimsalgo.t1mapping.correct_bias(biased_vol, b1map, dp_gre_low_contrast=None, field_threshold=None)[source]

Apply bias correction on biased_vol according to the B1 map, and possibly a GRE low contrast image.

Without dp_gre_low_contrast image:

\[unbiased\_vol = biased\_vol / b1map\]

(plus improvements)

With dp_gre_low_contrast image:

\[unbiased\_vol = biased\_vol / (lowpass(dp\_gre\_low\_contrast) * b1map)\]

(roughly)

\(lowpass\) is currently a gaussian filter with sigma=8mm.

method: courtesy of Alexandre Vignaud.

ref: ISMRM abstract Mauconduit et al.

All input images are expected to contain transformation information to a common space in their header (1st transformation, normally to the scanner-based referential). They are thus not expected to have the same field of view or voxel size, all are resampled to the biased_vol space.

The returned value is a tuple containing 2 images: the corrected image, and the multiplicative correction field.

Parameters:
  • biased_vol (volume) – volume to be corrected

  • b1map (volume) – B1 map as flip angles in degrees, generally returned by BAFIData.make_flip_angle_map. May be improved (holes filled, dilated) using BAFIData.fix_b1_map() which is generally better.

  • dp_gre_low_contrast (volume (optional)) – GRE low contrast image

  • field_threshold (float (optional)) – Threshold for the corrective field before inversion: the biased image will be divided by this field. To avoid too high values, field values under this threshold are clamped. Null values are masked out, so the threshold applies only to non-null values. If not specified, the threshold is 100 if the dp_gre_low_contrast is not provided, and 3000 when dp_gre_low_contrast is used. If field_threshold is 0, then no thresholding is applied.

Returns:

  • unbiased_vol (volume) – according to the calculations explained above. The returned image has the same voxel type as the input one (althrough calculations are performed in float in the function), and the grey levels are roughly adjusted to the level of input data (unless it produces overflow, in which case the max value is adjusted to fit in the voxel type).

  • field (volume) – The correction field applied to the image (multiplicatively)

soma.aimsalgo.t1mapping.correct_sensitivity_map(sensitivity_map, flip_angle_map)[source]

Factor out the effect of the transmit field from a sensitivity map.

soma.aimsalgo.t1mapping.t1mapping_VFA(flip_angle_factor, GRE_data)[source]

Reconstruct a T1 relaxometry map from DESPOT1 data (2 flip angles).

This is a re-implementation of GetT1_VAFI3Dp_Brebis.m, courtesy of Alexandre Vignaud.

soma.wip.aimsalgo module

class soma.wip.aimsalgo.foldsgraphthickness.FoldsGraphThickness(fold_graph, lgw_vol, gm_wm_mesh, gm_lcr_mesh, voronoi=None)[source]
class soma.wip.aimsalgo.moment.Moment[source]
class soma.wip.aimsalgo.samplables.SuperQuadricSamplable(coefficients, bending=True, tapering=True, checkActivated=True, maxBoundingBoxVolume=10000000)[source]

Constructor of the class.

@type coefficients: list @param checkActivated: list of the 10 deformable superquadric coefficients. - e1 : first shape parameter - e2 : second shape parameter - a1 : x axis ray - a2 : y axis ray - a3 : z axis ray - k1 : first tapering parameter - k2 : second tapering parameter - k3 : third tapering parameter - alpha : angle of bending plan - kapa : curvature radius for the bending transform

contains(self, a0: AimsVector_FLOAT_3) bool[source]
class soma.wip.aimsalgo.transform.BendingTransform(coefficients)[source]
class soma.wip.aimsalgo.transform.TaperingTransform(coefficients)[source]