Module: soma.aimsalgo

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

Bases: int

class soma.aimsalgo.AimsGradient_FLOAT(type: int = AIMS_GRADIENT_CENTRAL)
class soma.aimsalgo.AimsGradient_FLOAT(a0: AimsGradient_FLOAT)

Bases: wrapper

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

Bases: int

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)

Bases: 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.CubicResampler_DOUBLE(*args)

Bases: SplineResampler_DOUBLE

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)

Bases: SplineResampler_FLOAT

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)

Bases: SplineResampler_HSV

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)

Bases: SplineResampler_POINT3DF

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)

Bases: SplineResampler_RGB

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)

Bases: SplineResampler_RGBA

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)

Bases: SplineResampler_S16

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)

Bases: SplineResampler_S32

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)

Bases: SplineResampler_U16

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)

Bases: SplineResampler_U32

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)

Bases: SplineResampler_U8

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)

Bases: wrapper

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)

Bases: wrapper

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)

Bases: wrapper

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)

Bases: wrapper

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)

Bases: wrapper

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)

Bases: wrapper

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)

Bases: wrapper

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)

Bases: wrapper

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)

Bases: wrapper

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

Bases: wrapper

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

Bases: wrapper

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

Bases: wrapper

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

Bases: wrapper

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

Bases: wrapper

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

Bases: wrapper

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

Bases: wrapper

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

Bases: wrapper

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)

Bases: MomentBase, Moment_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)

Bases: MomentBase, Moment_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)

Bases: MomentBase, Moment_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)

Bases: MomentBase, Moment_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)

Bases: MomentBase, Moment_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)

Bases: MomentBase, Moment_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)

Bases: MomentBase, Moment_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)

Bases: wrapper

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)

Bases: wrapper

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)

Bases: wrapper

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)

Bases: wrapper

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)

Bases: wrapper

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)

Bases: wrapper

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)

Bases: wrapper

data(self) rc_ptr_Volume_S32
doit(self, a0: rc_ptr_Volume_U8)
class soma.aimsalgo.LinearResampler_DOUBLE(*args)

Bases: SplineResampler_DOUBLE

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)

Bases: SplineResampler_FLOAT

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)

Bases: SplineResampler_HSV

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)

Bases: SplineResampler_POINT3DF

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)

Bases: SplineResampler_RGB

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)

Bases: SplineResampler_RGBA

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)

Bases: SplineResampler_S16

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)

Bases: SplineResampler_S32

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)

Bases: SplineResampler_U16

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)

Bases: SplineResampler_U32

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)

Bases: SplineResampler_U8

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)

Bases: SplineResampler_DOUBLE

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)

Bases: SplineResampler_FLOAT

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)

Bases: SplineResampler_HSV

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)

Bases: SplineResampler_POINT3DF

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)

Bases: SplineResampler_RGB

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)

Bases: SplineResampler_RGBA

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)

Bases: SplineResampler_S16

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)

Bases: SplineResampler_S32

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)

Bases: SplineResampler_U16

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)

Bases: SplineResampler_U32

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)

Bases: SplineResampler_U8

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)

Bases: Resampler_S16

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)

Bases: wrapper

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)

Bases: wrapper

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)

Bases: SplineResampler_DOUBLE

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)

Bases: SplineResampler_FLOAT

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)

Bases: SplineResampler_HSV

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)

Bases: SplineResampler_POINT3DF

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)

Bases: SplineResampler_RGB

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)

Bases: SplineResampler_RGBA

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)

Bases: SplineResampler_S16

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)

Bases: SplineResampler_S32

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)

Bases: SplineResampler_U16

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)

Bases: SplineResampler_U32

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)

Bases: SplineResampler_U8

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)

Bases: wrapper

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)

Bases: wrapper

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)

Bases: wrapper

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)

Bases: wrapper

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)

Bases: wrapper

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)

Bases: wrapper

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)

Bases: wrapper

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)

Bases: wrapper

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)

Bases: wrapper

doit(self, surface: AimsTimeSurface_3_VOID, spacing: float = 1, connexity: int = 26) rc_ptr_Volume_U32
class soma.aimsalgo.Mesher

Bases: wrapper

Mesh binary objects in a volume and produce surface meshes.

LAPLACIAN = 0
LOWPASS = 3
POLYGONSPRING = 2
SIMPLESPRING = 1
class SmoothingType

Bases: int

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)

Bases: wrapper

Incremental = 1
class MomentType

Bases: int

Normal = 0
Surfacic = 3
Volumic = 2
class soma.aimsalgo.MomentInvariant_DOUBLE(a0: Moment_DOUBLE | None = None)
class soma.aimsalgo.MomentInvariant_DOUBLE(a0: MomentInvariant_DOUBLE)

Bases: wrapper

I00_2 = 0
I112_23 = 9
I11_3 = 3
I123_23 = 10
I222_3 = 2
I22_2 = 1
I233_23 = 11
I3111_3 = 5
I3131_3 = 6
I3331_3 = 7
I3333_3 = 8
I33_3 = 4
class InvariantId

Bases: int

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)

Bases: wrapper

I00_2 = 0
I112_23 = 9
I11_3 = 3
I123_23 = 10
I222_3 = 2
I22_2 = 1
I233_23 = 11
I3111_3 = 5
I3131_3 = 6
I3331_3 = 7
I3333_3 = 8
I33_3 = 4
class InvariantId

Bases: int

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)

Bases: wrapper

I00_2 = 0
I112_23 = 9
I11_3 = 3
I123_23 = 10
I222_3 = 2
I22_2 = 1
I233_23 = 11
I3111_3 = 5
I3131_3 = 6
I3331_3 = 7
I3333_3 = 8
I33_3 = 4
class InvariantId

Bases: int

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)

Bases: wrapper

I00_2 = 0
I112_23 = 9
I11_3 = 3
I123_23 = 10
I222_3 = 2
I22_2 = 1
I233_23 = 11
I3111_3 = 5
I3131_3 = 6
I3331_3 = 7
I3333_3 = 8
I33_3 = 4
class InvariantId

Bases: int

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)

Bases: wrapper

I00_2 = 0
I112_23 = 9
I11_3 = 3
I123_23 = 10
I222_3 = 2
I22_2 = 1
I233_23 = 11
I3111_3 = 5
I3131_3 = 6
I3331_3 = 7
I3333_3 = 8
I33_3 = 4
class InvariantId

Bases: int

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)

Bases: wrapper

I00_2 = 0
I112_23 = 9
I11_3 = 3
I123_23 = 10
I222_3 = 2
I22_2 = 1
I233_23 = 11
I3111_3 = 5
I3131_3 = 6
I3331_3 = 7
I3333_3 = 8
I33_3 = 4
class InvariantId

Bases: int

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)

Bases: wrapper

I00_2 = 0
I112_23 = 9
I11_3 = 3
I123_23 = 10
I222_3 = 2
I22_2 = 1
I233_23 = 11
I3111_3 = 5
I3131_3 = 6
I3331_3 = 7
I3333_3 = 8
I33_3 = 4
class InvariantId

Bases: int

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)

Bases: wrapper

class MomentId

Bases: int

class Operation

Bases: int

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
m000 = 0
m001 = 2
m002 = 2
m003 = 2
m010 = 1
m011 = 5
m012 = 8
m020 = 1
m021 = 6
m030 = 1
m1(self) vector_DOUBLE | None
m100 = 0
m101 = 4
m102 = 7
m110 = 3
m111 = 9
m120 = 5
m2(self) vector_DOUBLE | None
m200 = 0
m201 = 4
m210 = 3
m3(self) vector_DOUBLE | None
m300 = 0
mAdd = 1
mSub = -1
orientation(self)
sum(self) float
class soma.aimsalgo.Moment_FLOAT
class soma.aimsalgo.Moment_FLOAT(a0: Moment_FLOAT)

Bases: wrapper

class MomentId

Bases: int

class Operation

Bases: int

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
m000 = 0
m001 = 2
m002 = 2
m003 = 2
m010 = 1
m011 = 5
m012 = 8
m020 = 1
m021 = 6
m030 = 1
m1(self) vector_DOUBLE | None
m100 = 0
m101 = 4
m102 = 7
m110 = 3
m111 = 9
m120 = 5
m2(self) vector_DOUBLE | None
m200 = 0
m201 = 4
m210 = 3
m3(self) vector_DOUBLE | None
m300 = 0
mAdd = 1
mSub = -1
orientation(self)
sum(self) float
class soma.aimsalgo.Moment_S16
class soma.aimsalgo.Moment_S16(a0: Moment_S16)

Bases: wrapper

class MomentId

Bases: int

class Operation

Bases: int

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
m000 = 0
m001 = 2
m002 = 2
m003 = 2
m010 = 1
m011 = 5
m012 = 8
m020 = 1
m021 = 6
m030 = 1
m1(self) vector_DOUBLE | None
m100 = 0
m101 = 4
m102 = 7
m110 = 3
m111 = 9
m120 = 5
m2(self) vector_DOUBLE | None
m200 = 0
m201 = 4
m210 = 3
m3(self) vector_DOUBLE | None
m300 = 0
mAdd = 1
mSub = -1
orientation(self)
sum(self) float
class soma.aimsalgo.Moment_S32
class soma.aimsalgo.Moment_S32(a0: Moment_S32)

Bases: wrapper

class MomentId

Bases: int

class Operation

Bases: int

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
m000 = 0
m001 = 2
m002 = 2
m003 = 2
m010 = 1
m011 = 5
m012 = 8
m020 = 1
m021 = 6
m030 = 1
m1(self) vector_DOUBLE | None
m100 = 0
m101 = 4
m102 = 7
m110 = 3
m111 = 9
m120 = 5
m2(self) vector_DOUBLE | None
m200 = 0
m201 = 4
m210 = 3
m3(self) vector_DOUBLE | None
m300 = 0
mAdd = 1
mSub = -1
orientation(self)
sum(self) float
class soma.aimsalgo.Moment_U16
class soma.aimsalgo.Moment_U16(a0: Moment_U16)

Bases: wrapper

class MomentId

Bases: int

class Operation

Bases: int

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
m000 = 0
m001 = 2
m002 = 2
m003 = 2
m010 = 1
m011 = 5
m012 = 8
m020 = 1
m021 = 6
m030 = 1
m1(self) vector_DOUBLE | None
m100 = 0
m101 = 4
m102 = 7
m110 = 3
m111 = 9
m120 = 5
m2(self) vector_DOUBLE | None
m200 = 0
m201 = 4
m210 = 3
m3(self) vector_DOUBLE | None
m300 = 0
mAdd = 1
mSub = -1
orientation(self)
sum(self) float
class soma.aimsalgo.Moment_U32
class soma.aimsalgo.Moment_U32(a0: Moment_U32)

Bases: wrapper

class MomentId

Bases: int

class Operation

Bases: int

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
m000 = 0
m001 = 2
m002 = 2
m003 = 2
m010 = 1
m011 = 5
m012 = 8
m020 = 1
m021 = 6
m030 = 1
m1(self) vector_DOUBLE | None
m100 = 0
m101 = 4
m102 = 7
m110 = 3
m111 = 9
m120 = 5
m2(self) vector_DOUBLE | None
m200 = 0
m201 = 4
m210 = 3
m3(self) vector_DOUBLE | None
m300 = 0
mAdd = 1
mSub = -1
orientation(self)
sum(self) float
class soma.aimsalgo.Moment_U8
class soma.aimsalgo.Moment_U8(a0: Moment_U8)

Bases: wrapper

class MomentId

Bases: int

class Operation

Bases: int

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
m000 = 0
m001 = 2
m002 = 2
m003 = 2
m010 = 1
m011 = 5
m012 = 8
m020 = 1
m021 = 6
m030 = 1
m1(self) vector_DOUBLE | None
m100 = 0
m101 = 4
m102 = 7
m110 = 3
m111 = 9
m120 = 5
m2(self) vector_DOUBLE | None
m200 = 0
m201 = 4
m210 = 3
m3(self) vector_DOUBLE | None
m300 = 0
mAdd = 1
mSub = -1
orientation(self)
sum(self) float
class soma.aimsalgo.MorphoGreyLevel_DOUBLE

Bases: wrapper

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

Bases: wrapper

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

Bases: wrapper

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

Bases: wrapper

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

Bases: wrapper

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

Bases: wrapper

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

Bases: wrapper

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)

Bases: Resampler_DOUBLE

Volume resampler using nearest-neighbour interpolation.

The Resampling API is described in the base Resampler class.

class soma.aimsalgo.NearestNeighborResampler_FLOAT(*args)

Bases: Resampler_FLOAT

Volume resampler using nearest-neighbour interpolation.

The Resampling API is described in the base Resampler class.

class soma.aimsalgo.NearestNeighborResampler_HSV(*args)

Bases: Resampler_HSV

Volume resampler using nearest-neighbour interpolation.

The Resampling API is described in the base Resampler class.

class soma.aimsalgo.NearestNeighborResampler_POINT3DF(*args)

Bases: Resampler_POINT3DF

Volume resampler using nearest-neighbour interpolation.

The Resampling API is described in the base Resampler class.

class soma.aimsalgo.NearestNeighborResampler_RGB(*args)

Bases: Resampler_RGB

Volume resampler using nearest-neighbour interpolation.

The Resampling API is described in the base Resampler class.

class soma.aimsalgo.NearestNeighborResampler_RGBA(*args)

Bases: Resampler_RGBA

Volume resampler using nearest-neighbour interpolation.

The Resampling API is described in the base Resampler class.

class soma.aimsalgo.NearestNeighborResampler_S16(*args)

Bases: Resampler_S16

Volume resampler using nearest-neighbour interpolation.

The Resampling API is described in the base Resampler class.

class soma.aimsalgo.NearestNeighborResampler_S32(*args)

Bases: Resampler_S32

Volume resampler using nearest-neighbour interpolation.

The Resampling API is described in the base Resampler class.

class soma.aimsalgo.NearestNeighborResampler_U16(*args)

Bases: Resampler_U16

Volume resampler using nearest-neighbour interpolation.

The Resampling API is described in the base Resampler class.

class soma.aimsalgo.NearestNeighborResampler_U32(*args)

Bases: Resampler_U32

Volume resampler using nearest-neighbour interpolation.

The Resampling API is described in the base Resampler class.

class soma.aimsalgo.NearestNeighborResampler_U8(*args)

Bases: Resampler_U8

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)

Bases: Samplable_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)

Bases: SplineResampler_DOUBLE

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)

Bases: SplineResampler_FLOAT

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)

Bases: SplineResampler_HSV

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)

Bases: SplineResampler_POINT3DF

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)

Bases: SplineResampler_RGB

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)

Bases: SplineResampler_RGBA

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)

Bases: SplineResampler_S16

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)

Bases: SplineResampler_S32

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)

Bases: SplineResampler_U16

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)

Bases: SplineResampler_U32

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)

Bases: SplineResampler_U8

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)

Bases: SplineResampler_DOUBLE

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)

Bases: SplineResampler_FLOAT

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)

Bases: SplineResampler_HSV

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)

Bases: SplineResampler_POINT3DF

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)

Bases: SplineResampler_RGB

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)

Bases: SplineResampler_RGBA

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)

Bases: SplineResampler_S16

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)

Bases: SplineResampler_S32

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)

Bases: SplineResampler_U16

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)

Bases: SplineResampler_U32

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)

Bases: SplineResampler_U8

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

Bases: wrapper

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)

Bases: RCObject

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)

Bases: RCObject

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)

Bases: RCObject

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)

Bases: RCObject

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)

Bases: RCObject

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)

Bases: RCObject

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)

Bases: RCObject

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)

Bases: RCObject

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)

Bases: RCObject

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)

Bases: RCObject

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)

Bases: RCObject

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)

Bases: wrapper

contains(self, a0: AimsVector_FLOAT_3) bool
class soma.aimsalgo.SeventhOrderResampler_DOUBLE(*args)

Bases: SplineResampler_DOUBLE

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)

Bases: SplineResampler_FLOAT

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)

Bases: SplineResampler_HSV

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)

Bases: SplineResampler_POINT3DF

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)

Bases: SplineResampler_RGB

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)

Bases: SplineResampler_RGBA

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)

Bases: SplineResampler_S16

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)

Bases: SplineResampler_S32

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)

Bases: SplineResampler_U16

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)

Bases: SplineResampler_U32

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)

Bases: SplineResampler_U8

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)

Bases: SplineResampler_DOUBLE

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)

Bases: SplineResampler_FLOAT

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)

Bases: SplineResampler_HSV

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)

Bases: SplineResampler_POINT3DF

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)

Bases: SplineResampler_RGB

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)

Bases: SplineResampler_RGBA

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)

Bases: SplineResampler_S16

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)

Bases: SplineResampler_S32

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)

Bases: SplineResampler_U16

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)

Bases: SplineResampler_U32

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)

Bases: SplineResampler_U8

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)

Bases: Resampler_DOUBLE

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)

Bases: Resampler_FLOAT

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)

Bases: Resampler_HSV

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)

Bases: Resampler_POINT3DF

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)

Bases: Resampler_RGB

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)

Bases: Resampler_RGBA

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)

Bases: Resampler_S16

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)

Bases: Resampler_S32

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)

Bases: Resampler_U16

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)

Bases: Resampler_U32

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)

Bases: Resampler_U8

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)

Bases: wrapper

Cbar(self) int
Cstar(self) int
Point0 = 19
Point1 = 11
Point10 = 2
Point11 = 15
Point12 = 1
Point13 = 6
Point14 = 10
Point15 = 5
Point16 = 18
Point17 = 20
Point18 = 12
Point19 = 24
Point2 = 23
Point20 = 9
Point21 = 4
Point22 = 17
Point23 = 22
Point24 = 14
Point25 = 26
Point3 = 8
Point4 = 3
Point5 = 16
Point6 = 21
Point7 = 13
Point8 = 25
Point9 = 7
PointC = 0
class PointNumber

Bases: int

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

Bases: wrapper

Meaning of TopologicalClassification results

BorderPoint = 30
CurvePoint = 40
CurvesJunction = 50
IsolatedPoint = 20
SimplePoint = 30
SurfaceCurvesJunction = 70
SurfacePoint = 60
SurfacesCurvesJunction = 90
SurfacesJunction = 80
TopoA = 10
TopoB = 20
TopoC = 30
TopoD = 40
TopoE = 50
TopoF = 60
TopoG = 70
TopoH = 80
TopoI = 90
class TopoType

Bases: int

class TopoTypeFull

Bases: int

VolumePoint = 10
classification(a0: int, a1: int) int
name(a0: int, a1: int) object
stringFromDefine(a0: int) object
class soma.aimsalgo.TopologicalClassification_DOUBLE

Bases: TopologicalClassificationBase

Topological classification per voxel

class soma.aimsalgo.TopologicalClassification_FLOAT

Bases: TopologicalClassificationBase

Topological classification per voxel

class soma.aimsalgo.TopologicalClassification_S16

Bases: TopologicalClassificationBase

Topological classification per voxel

class soma.aimsalgo.TopologicalClassification_S32

Bases: TopologicalClassificationBase

Topological classification per voxel

class soma.aimsalgo.TopologicalClassification_U16

Bases: TopologicalClassificationBase

Topological classification per voxel

class soma.aimsalgo.TopologicalClassification_U32

Bases: TopologicalClassificationBase

Topological classification per voxel

class soma.aimsalgo.TopologicalClassification_U8

Bases: TopologicalClassificationBase

Topological classification per voxel

class soma.aimsalgo.TopologicalClassifier_Volume_DOUBLE

Bases: wrapper

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

Bases: wrapper

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

Bases: wrapper

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

Bases: wrapper

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

Bases: wrapper

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

Bases: wrapper

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

Bases: wrapper

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)

Bases: MomentBase, Moment_S16

doit(self, a0: AimsTimeSurface_3_VOID)
setMomentType(self, a0: MomentBase.MomentType)
class soma.aimsalgo.Writer_FfdTransformation

Bases: Writer_Volume_POINT3DF

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
class soma.aimsalgo.aimsalgo

Bases: simplewrapper

class BucketMapSampler_FLOAT_3
class BucketMapSampler_FLOAT_3(a0: aimsalgo.BucketMapSampler_FLOAT_3)

Bases: 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 GeneralSampler_FLOAT_3

Bases: wrapper

sample(self, a0: aimsalgo.Samplable_FLOAT_3, a1: AimsVector_FLOAT_3, a2: AimsVector_FLOAT_3, a3: AimsVector_FLOAT_3) carto.Object
class Polynomial_FLOAT_3(a0: vector_FLOAT | None, a1: float = 1)
class Polynomial_FLOAT_3(a0: aimsalgo.Polynomial_FLOAT_3)

Bases: Samplable_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 Samplable_FLOAT_3
class Samplable_FLOAT_3(a0: aimsalgo.Samplable_FLOAT_3)

Bases: wrapper

contains(self, a0: AimsVector_FLOAT_3) 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)

Bases: wrapper

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)

Bases: wrapper

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)

Bases: wrapper

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)

Bases: wrapper

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.