The Asclepios subpackage serves as a swissarmy toolkit for MARS ALT as it implements many image processing routines used throughout the pipeline. The code is contributed by the INRIA Asclepios Team.
Contents
It processes to an automated linear registration method using a blockmatching based method.
The principle of this method is to pair subimages (or blocks) between both images to be registered and then to compute a transformation that explains the obtained pairings. Pairing is achieved by maximizing the correlation coefficient between blocks of the two images, while the rigid transformation that best superimposes them is computed by minimizing the squared distances between the paired blocks centers. This is iterated until convergence, and embedded into a multiscale strategy.
Controling the output:  

By default an image is resampled (either the floating or the reference depending on the inv. If you just want only to compute the transformation, pass only_register=True. (The returned value will still be a tuple, but the first element will be None instead of an image).
By default too the returned matrix is inverted  from (floating_image)’ to floating_image. This is undesired if you want to use the matrix in a matrix composition. If you want the direct matrix pass direct_matrix=True.
Parameters : 

ref (SpatialImage)  reference image
flo (SpatialImage)  floating image
inivox (numpy.ndarray)  initial matrix : name of the initial transformation (voxel coordinates) from reference to floating
inireel (numpy.ndarray)  initial real matrix : name of the initial transformation (coordinates of the ‘real world’)
vsf (float,float,float)  voxel size of the floating image overrides the one given in the image header (if any)
vsr (float,float,float)  voxel size of the reference image overrides the one given in the image header (if any)
ltf (int)  low threshold for the floating image
points of the floating image that will be considered have a value strictly superior to the low threshold and strictly inferior to the high threshold
points of the reference image that will be considered have a value strictly superior to the low threshold and strictly inferior to the high threshold
htr (int)  high threshold for the reference image
this fraction of voxels with an intensity between the low and the high threshold (default is 0.5)
this fraction of voxels with an intensity between the low and the high threshold
ltscut (float)  cutting value for (weighted) least trimmed squares
tsi (float)  threshold on the similarity measure : pairings below that threshold will not be considered
nbiter (int)  maximum number of iterations at one level of the pyramid
rms (bool)  use the RMS as an end condition at each pyramid level
bld (int,int,int)  block sizes : sizes of the blocks along X, Y, Z
blp (int,int,int)  blockspacing : block spacing in the floating image
blb (int,int,int)  blocks borders: to be added twice at each dimension for statistics computation
bldv (int,int,int)  block neighborhood sizes : sizes of the exploration neighborhood around a block
blpv (int,int,int)  blocksteps : progressionstep in the exploration neighborhood
level of the pyramid
vd (float)  decrement fraction variance blocks : the decrement of this fraction from one level of the pyramid to the next (default is 0.2)
vs (float)  minimum fraction variance blocks : the minimum admissible value of this fraction
The constant value of the fraction is set to 1.0 but can be changed afterwards with ‘fractionvarianceblocks’
pyn (int)  pyramid levels : number of levels of the pyramid (default is 3)
pys (int)  pyramid finest level : stop at the level “pys” of the pyramid (default is 0, ie stop at the finest level)
pyfilt (int)  pyramid built by Gaussian (recursive) filtering
warning : override the parameters already set by previous options
inv (bool)  after matching, resample reference image instead of floating one
`stop`(bool)  just resample : do not match the images. Just compute the transformation matrix from voxel sizes (and eventually input matrices)
only_register  does not create a resampled image, only computes the transformation. The returned image will be None
Returns : 

Compute a nonlinear transformation that places voxels from “floating” over those of “reference”.
SuperBaloo in an image registration algorithm based on a similar blockmatching and pyramidal registration algorithm as Baladin. The main difference is that SuperBaloo estimates a dense deformation field instead of a linear or affine matrix.
Parameters : 


This function allows 2D or 3D image resampling using a 4x4 matrix. The value of a point in the result image is estimated :
 either by [bitri]linear interpolation,
 or by using the value of the nearest point.
: Parameters :  image (numpy.ndarray)  input image
from ‘imageout’ to ‘imagein’ : M(in) = MAT * M(out).
in case of deformation field which is applied BEFORE the deformation field.
M(in) = MAT * ( M(out) + deformation ) and after “matrix_before” : M(in) = MAT * ( MATB*M(out) + deformation )
(only with “deformation” and “linear”)
`output_shape`(tuple, optional)  dimension of output image
iso (float, optional)  isotropic mode
vin (tuple, optional)  voxel size of input image
vout (tuple, optional)  voxel size of output image
inv (bool, optional)  inverse “matrix”
inv_before (bool, optional)  inverse “matrix_before”
This function allows 2D or 3D image resampling using a 4x4 matrix. The value of a point in the result image is estimated :
 either by [bitri]linear interpolation,
 or by using the value of the nearest point.
: Parameters :  image (numpy.ndarray)  input image
from ‘imageout’ to ‘imagein’ : M(in) = MAT * M(out).
in case of deformation field which is applied BEFORE the deformation field.
M(in) = MAT * ( M(out) + deformation ) and after “matrix_before” : M(in) = MAT * ( MATB*M(out) + deformation )
(only with “deformation” and “linear”)
`output_shape`(tuple, optional)  dimension of output image
iso (float, optional)  isotropic mode
vin (tuple, optional)  voxel size of input image
vout (tuple, optional)  voxel size of output image
inv (bool, optional)  inverse “matrix”
inv_before (bool, optional)  inverse “matrix_before”
Applies the Watershed algorithm
Parameters : 


image (SpatialImage)  input image
filter_value (float or (float,float,float), required for “alpha” and “sigma”)  standard deviation of the Gaussian according to X,Y or Z
default : no derivative (no filtering)
cont (int or (int,int,int), optional)  added points to the edges
Extraction of local minima of the input image.
Parameters : 


Applies a hysteresis thresholding and cast the result image.
Such a thresholding keeps the connected components, made of points whose value is larger or equal to “low_threshold”, and which contains at least one (or some, see parameters) point whose value is larger or equal to “high_threshold”.
Parameters : 

