mia-3dprealign-nonrigid(1)
mia-3dprealign-nonrigid(1) ๐ โ the 3D image registration manual, but make it cute โจ
๐ NAME ๐
okay so like, mia-3dprealign-nonrigid is literally Registration of a series of 3D images. that's it. that's the whole name. ๐ง๐ฆ
๐ SYNOPSIS ๐
bestie, the way you run it is:
mia-3dprealign-nonrigid -i <in-file> -o <out-file> [options]
๐ DESCRIPTION ๐
so basically, mia-3dprealign-nonrigid runs the non-rigid registration of an image series. how? first it registers an already aligned subset of the images to one reference, and then it registers the remaining images by using synthetic references. lowkey iconic. โจ
this is a 3D version of:
G. Wollny, M-J Ledesma-Cabryo, P.Kellman, and A.Santos, "Exploiting Quasiperiodicity in Motion Correction of Free-Breathing," IEEE Transactions on Medical Imaging, 29(8), 2010.
periodt. ๐
โ๏ธ OPTIONS โ๏ธ
๐ File-IO
-i --in-file=(input, required); ioโ bestie, this is your input images, and they follow the naming patternnameXXXX.ext. For supported file types seePLUGINS:3dimage/io. you literally need this. ๐ผ๏ธ-o --out-file=(output, required); ioโ file name base for the registered files, given as a C-format string. For supported file types seePLUGINS:3dimage/io. also required, no skipping. ๐--save-referencesโ saves synthetic references to files namedrefXXXX.v. ๐พ
๐งน Preconditions & Preprocessing
-k --skip=0โ skips images at the begin of the series. (yes, "begin". we don't make the rules.) default is 0. โ๏ธ--preskip=20โ when searching for a high contrats image, skip images at the beginning+skip of the series. default 20. ๐--postskip=2โ when searching for a high contrats image, skip images at the end of the series. default 2. ๐--max-candidates=20โ maximum number of candidates for the global reference image. default 20. ๐ฏ-S --cost-series=image:cost=[ngf:eval=ds]โ Const function to use for the analysis of the series. For supported plugins seePLUGINS:3dimage/fullcost. ๐--ref-idx=โ save reference index number to this file. ๐-R --global-reference=-1โ save reference index number to this file. (yes, same description. it's giving copy-paste but we don't judge.) ๐พ-D --max-subset-delta=0โ maximum delta between two elements of the prealigned subset. default 0. ๐
๐ฏ Registration
-O --optimizer=gsl:opt=gd,step=0.01โ optimizer used for minimization. For supported plugins seePLUGINS:minimizer/singlecost. ๐โโ๏ธ-l --mr-levels=3โ multi-resolution levels. default 3. ๐ช-f --transForm=splineโ transformation type. For supported plugins seePLUGINS:3dimage/transform. ๐-1 --cost-subset=image:cost=[ngf:eval=ds]โ cost function for registration during the subset registration. For supported plugins seePLUGINS:3dimage/fullcost. ๐งฎ-2 --cost-final=image:cost=ssdโ cost function for registration during the final registration. For supported plugins seePLUGINS:3dimage/fullcost. ๐
๐ฌ Help & Info
-V --verbose=warningโ verbosity of output, print messages of given level and higher priorities. Supported priorities starting at lowest level are:traceโ Function call tracedebugโ Debug outputinfoโ Low level messagesmessageโ Normal messageswarningโ Warningsfailโ Report test failureserrorโ Report errorsfatalโ Report only fatal errors
--copyrightโ print copyright information. ๐-h --helpโ print this help. ๐โโ๏ธ-? --usageโ print a short help. ๐ค--versionโ print the version number and exit. ๐ข
๐ Processing
--threads=-1โ Maxiumum number of threads to use for processing,This number should be lower or equal to the number of logical processor cores in the machine. (-1: automatic estimation). ๐งต
๐งฉ PLUGINS: 1d/spacialkernel
cdiffโ Central difference filter kernel, mirror boundary conditions are used.(no parameters)
gaussโ spacial Gauss filter kernel, supported parameters are:w = 1; uint in [0, inf)โ half filter width.
scharrโ This plugin provides the 1D folding kernel for the Scharr gradient filter.(no parameters)
๐งฉ PLUGINS: 1d/splinebc
mirrorโ Spline interpolation boundary conditions that mirror on the boundary.(no parameters)
repeatโ Spline interpolation boundary conditions that repeats the value at the boundary.(no parameters)
zeroโ Spline interpolation boundary conditions that assumes zero for values outside.(no parameters)
๐งฉ PLUGINS: 1d/splinekernel
bsplineโ B-spline kernel creation , supported parameters are:d = 3; int in [0, 5]โ Spline degree.
omomsโ OMoms-spline kernel creation, supported parameters are:d = 3; int in [3, 3]โ Spline degree.
๐งฉ PLUGINS: 3dimage/combiner
absdiffโ Image combiner 'absdiff'(no parameters)
addโ Image combiner 'add'(no parameters)
divโ Image combiner 'div'(no parameters)
mulโ Image combiner 'mul'(no parameters)
subโ Image combiner 'sub'(no parameters)
๐งฉ PLUGINS: 3dimage/cost
lnccโ local normalized cross correlation with masking support., supported parameters are:w = 5; uint in [1, 256]โ half width of the window used for evaluating the localized cross correlation.
miโ Spline parzen based mutual information., supported parameters are:cut = 0; float in [0, 40]โ Percentage of pixels to cut at high and low intensities to remove outliers.mbins = 64; uint in [1, 256]โ Number of histogram bins used for the moving image.mkernel = [bspline:d=3]; factoryโ Spline kernel for moving image parzen hinstogram. For supported plug-ins seePLUGINS:1d/splinekernelrbins = 64; uint in [1, 256]โ Number of histogram bins used for the reference image.rkernel = [bspline:d=0]; factoryโ Spline kernel for reference image parzen hinstogram. For supported plug-ins seePLUGINS:1d/splinekernel
nccโ normalized cross correlation.(no parameters)
ngfโ This function evaluates the image similarity based on normalized gradient fields. Given normalized gradient fields$ _S$of the src image and$ _R$of the ref image various evaluators are implemented., supported parameters are:eval = ds; dictโ plugin subtype (sq,ds,dot,cross). Supported values are:dsโ square of scaled differencedotโ scalar product kernelcrossโ cross product kernel
ssdโ 3D image cost: sum of squared differences, supported parameters are:autothresh = 0; float in [0, 1000]โ Use automatic masking of the moving image by only takeing intensity values into accound that are larger than the given threshold.norm = 0; boolโ Set whether the metric should be normalized by the number of image pixels.
ssd-automaskโ 3D image cost: sum of squared differences, with automasking based on given thresholds, supported parameters are:rthresh = 0; doubleโ Threshold intensity value for reference image.sthresh = 0; doubleโ Threshold intensity value for source image.
๐งฉ PLUGINS: 3dimage/filter
bandpassโ intensity bandpass filter, supported parameters are:max = 3.40282e+38; floatโ maximum of the band.min = 0; floatโ minimum of the band.
binarizeโ image binarize filter, supported parameters are:max = 3.40282e+38; floatโ maximum of accepted range.min = 0; floatโ minimum of accepted range.
closeโ morphological close, supported parameters are:hint = black; stringโ a hint at the main image content (black|white).shape = [sphere:r=2]; factoryโ structuring element. For supported plug-ins seePLUGINS:3dimage/shape
combinerโ Combine two images with the given combiner operator. if 'reverse' is set to false, the first operator is the image passed through the filter pipeline, and the second image is loaded from the file given with the 'image' parameter the moment the filter is run., supported parameters are:image =(input, required, io)โ second image that is needed in the combiner. For supported file types seePLUGINS:3dimage/ioop =(required, factory)โ Image combiner to be applied to the images. For supported plug-ins seePLUGINS:3dimage/combinerreverse = 0; boolโ reverse the order in which the images passed to the combiner.
convertโ image pixel format conversion filter, supported parameters are:a = 1; floatโ linear conversion parameter a.b = 0; floatโ linear conversion parameter b.map = opt; dictโ conversion mapping. Supported values are:copyโ copy data when convertinglinearโ apply linear transformation x -> a*x+brangeโ apply linear transformation that maps the input data type range to the output data type rangeoptโ apply a linear transformation that maps the real input range to the full output rangeoptstatโ apply a linear transform that maps based on input mean and variation to the full output range
Okay so picking right back up with the parameter list ๐
repn = ubyte; dictโ output pixel type โจ the supported values are literally:bitโ binary data ๐sbyteโ signed 8 bitubyteโ unsigned 8 bitsshortโ signed 16 bitushortโ unsigned 16 bitsintโ signed 32 bituintโ unsigned 32 bitslongโ signed 64 bitulongโ unsigned 64 bitfloatโ floating point 32 bitdoubleโ floating point 64 bitnoneโ no pixel type defined
๐ crop
Crops out a region of an image, bestie โ๏ธ and the region is always clamped to the original image size, in the sense that the given range is kept. Params:
end = [[4294967295,4294967295,4294967295]]; streamable โ end of the cropping range, maximum =(-1,-1,-1)๐start = [[0,0,0]]; streamable โ begin of the cropping range. Slay, we love a clean start ๐ซถ
๐ dilate
3d image stack dilate filter, it's giving expansion energy. Params:
hint = black; string โ a hint at the main image content (black|white).shape = [sphere:r=2]; factory โ structuring element. For supported plug-ins seePLUGINS:3dimage/shape.
๐ฆ distance
Evaluate the 3D distance transform of an image ๐ If the image is a binary mask, then the result of the distance transform in each point corresponds to the Euclidian distance to the mask. If the input image is of a scalar pixel value, then the this scalar is interpreted as heighfield and the per pixel value adds to the distance. Lowkey iconic math tbh.
- (no parameters) โ nothing to configure, it just goes ๐
๐ downscale
Downscales the input image by using a given block size to define the downscale factor. Prior to scaling, the image is filtered by a smoothing filter to eliminate high frequency data and avoid aliasing artifacts (the glow-up is on purpose โจ). Params:
b = [[1,1,1]]; 3dbounds โ blocksize.bx = 1; uint in [1, inf) โ blocksize in x direction.by = 1; uint in [1, inf) โ blocksize in y direction.bz = 1; uint in [1, inf) โ blocksize in z direction.kernel = gauss; factory โ smoothing filter kernel to be applied, and the size of the filter is estimated based on the blocksize. For supported plug-ins seePLUGINS:1d/spacialkernel.
๐ง erode
3d image stack erode filter, the inverse vibe of dilate ๐ Params:
hint = black; string โ a hint at the main image content (black|white).shape = [sphere:r=2]; factory โ structuring element. For supported plug-ins seePLUGINS:3dimage/shape.
๐ธ gauss
Isotropic 3D gauss filter, smooth and soft, main character energy. Params:
w = 1; int in [0, inf) โ filter width parameter.
โญ gradnorm
3D image to gradient norm filter ๐ฅ
- (no parameters) โ it eats and leaves no crumbs.
๐ growmask
Use an input binary mask and a reference gray scale image to do region growing โ it adds the neighborhood pixels of an already added pixel if they have a lower intensity that is above the given threshold. Params:
min = 1; float โ lower threshold for mask growing.ref =(input, required, io)โ reference image for mask region growing. For supported file types seePLUGINS:3dimage/io.shape = 6n; factory โ neighborhood mask. For supported plug-ins seePLUGINS:3dimage/shape.
๐
invert
Intensity invert filter ๐ the flip is real.
- (no parameters) โ no knobs, just vibes.
๐ isovoxel
This filter scales an image to make the voxel size isometric and its size to correspond to the given value. Params:
interp = [bspline:d=3]; factory โ interpolation kernel to be used . For supported plug-ins seePLUGINS:1d/splinekernel.size = 1; float in (0, inf) โ isometric target voxel size.
๐ kmeans
3D image k-means filter ๐ง In the output image the pixel value represents the class membership and the class centers are stored as attribute in the image. Params:
c = 3; int in [2, inf) โ number of classes.
๐ซถ label
A filter to label the connected components of a binary image. Params:
n = 6n; factory โ neighborhood mask. For supported plug-ins seePLUGINS:3dimage/shape.
๐ labelmap
Image filter to remap label id's. Only applicable to images with integer valued intensities/labels, so don't try this on your float data bestie ๐ญ Params:
map =(input, required, string)โ Label mapping file.
๐ฆ labelscale
A filter that only creates output voxels that are already created in the input image. Scaling is done by using a voting algorithms that selects the target pixel value based on the highest pixel count of a certain label in the corresponding source region. If the region comprises two labels with the same count, the one with the lower number wins ๐ (tie-break rules, but make it demure). Params:
out-size =(required, 3dbounds)โ target size given as two coma separated values.
๐ load
Loads the input image from a file and uses it to replace the current image in the pipeline ๐ Params:
file =(input, required, io)โ name of the input file to load from. For supported file types seePLUGINS:3dimage/io.
โจ lvdownscale
This is a label voting downscale filter. It adownscales a 3D image by blocks. For each block, the (non-zero) label that appears most times in the block is issued as output pixel in the target image. If two labels appear the same number of times, the one with the lower absolute value wins ๐ฅ Params:
b = [[1,1,1]]; 3dbounds โ blocksize for the downscaling. Each block will be represented by one pixel in the target image.
๐ธ mask
Mask an image โ one image is taken from the parameters list and the other from the normal filter input. Both images must be of the same dimensions and one must be binary. The attributes of the image coming through the filter pipeline are preserved. The output pixel type corresponds to the input image that is not binary ๐ Params:
input =(input, required, io)โ second input image file name. For supported file types seePLUGINS:3dimage/io.
โญ mean
3D image mean filter, average queen behavior. Params:
w = 1; int in [1, inf) โ half filter width.
๐ median
Median 3d filter, the classic. Params:
w = 1; int in [1, inf) โ filter width parameter.
๐ mlv
Mean of Least Variance 3D image filter, say that three times fast. Params:
w = 1; int in [1, inf) โ filter width parameter.
๐ง msnormalizer
3D image mean-sigma normalizing filter ๐ Params:
w = 1; int in [1, inf) โ half filter width.
๐ open
Morphological open, the third member of the morph trio. Params:
hint = black; string โ a hint at the main image content (black|white).shape = [sphere:r=2]; factory โ structuring element. For supported plug-ins seePLUGINS:3dimage/shape.
๐ reorient
3D image reorientation filter, spin that image around ๐ Params:
map = xyz; dict โ orientation mapping to be applied. The supported values are:xyzโ keep orientationp-yzxโ permutatex->z->y->xp-zxyโ permutatex->y->z->xf-yzโ flip y-zf-xyโ flip x-yf-xzโ flip x-zr-x90โ rotate around x-axis clockwise 90 degreer-x180โ rotate around x-axis clockwise 180 degreer-x270โ rotate around x-axis clockwise 270 degreer-y90โ rotate around y-axis clockwise 90 degreer-y180โ rotate around y-axis clockwise 180 degreer-y270โ rotate around y-axis clockwise 270 degreer-z90โ rotate around z-axis clockwise 90 degreer-z180โ rotate around z-axis clockwise 180 degreer-z270โ rotate around z-axis clockwise 270 degree
๐ resize
Resize an image. The original data is centered within the new sized image ๐ผ๏ธ Params:
size = [[0,0,0]]; streamable โ new size of the image, a size 0 indicates to keep the size for the corresponding dimension.
๐ sandp
Salt and pepper 3d filter ๐ง๐ถ๏ธ yes that's really the name. Params:
thresh = 100; float in [0, inf) โ thresh value.w = 1; int in [1, inf) โ filter width parameter.
๐ฆ scale
3D image filter that scales to a given target size ๐ Params:
interp = [bspline:d=3]; factory โ interpolation kernel to be used . For supported plug-ins seePLUGINS:1d/splinekernel.s = [[0,0,0]]; 3dbounds โ target size to set all components at once (component 0: use input image size).sx = 0; uint in [0, inf) โ target size in x direction (0: use input image size).sy = 0; uint in [0, inf) โ target size in y direction (0: use input image size).sz = 0; uint in [0, inf) โ target size in y direction (0: use input image size).scharrโ the 3D Scharr filter, for gradient evaluation. Heads up bestie: the output pixel type of the filtered image is the same as the input pixel type, so converting the input beforehand to a floating point valued image is recommendable ๐ . Supported parameters are:dir = x; dictโ Gradient direction. Supported values are:xโ gradient in x-directionyโ gradient in y-directionzโ gradient in z-direction
selectbigโ a filter that creats a binary mask representing the intensity with the highest pixel count. โ ๏ธ the pixel value0will be ignored, and if two intensities have the same pixel count, then the result is undefined. The input pixel must have an integral pixel type.- (no parameters)
sepconvโ 3D image intensity separaple convolution filter ๐ซถ. Supported parameters are:kx = [gauss:w=1]; factoryโ filter kernel in x-direction. For supported plug-ins seePLUGINS:1d/spacialkernelky = [gauss:w=1]; factoryโ filter kernel in y-direction. For supported plug-ins seePLUGINS:1d/spacialkernelkz = [gauss:w=1]; factoryโ filter kernel in z-direction. For supported plug-ins seePLUGINS:1d/spacialkernel
sobelโ the 2D Sobel filter, also for gradient evaluation. Same lil reminder asscharr, no cap: the output pixel type of the filtered image is the same as the input pixel type, so converting the input beforehand to a floating point valued image is recommendable. Supported parameters are:dir = x; dictโ Gradient direction. Supported values are:xโ gradient in x-directionyโ gradient in y-directionzโ gradient in z-direction
swsโ seeded watershead (yes bestie, that's the spelling, live with it ๐). The algorithm extracts exactly so many reagions as initial labels are given in the seed image. Supported parameters are:grad = 0; boolโ Interpret the input image as gradient.mark = 0; boolโ Mark the segmented watersheds with a special gray scale value.n = [sphere:r=1]; factoryโ Neighborhood for watershead region growing. For supported plug-ins seePLUGINS:3dimage/shapeseed =(input, required, string)โ seed input image containing the labels for the initial regions.
teeโ Save the input image to a file and also pass it through to the next filter. Two things at once, main character energy fr fr ๐. Supported parameters are:file =(output, required, io)โ name of the output file to save the image too.. For supported file types seePLUGINS:3dimage/io
thinningโ 3D morphological thinning, based on: Lee and Kashyap, 'Building Skeleton Models via 3-D Medial Surface/Axis Thinning Algorithms', Graphical Models and Image Processing, 56(6):462-478, 1994. This implementation only supports the 26 neighbourhood.- (no parameters)
transformโ Transform the input image with the given transformation. Supported parameters are:file =(input, required, io)โ Name of the file containing the transformation.. For supported file types seePLUGINS:3dtransform/ioimgboundary = ; factoryโ override image interpolation boundary conditions. For supported plug-ins seePLUGINS:1d/splinebcimgkernel = ; factoryโ override image interpolator kernel. For supported plug-ins seePLUGINS:1d/splinekernel
varianceโ 3D image variance filter ๐. Supported parameters are:w = 1; int in [1, inf)โ half filter width.
wsโ basic watershead segmentation. Supported parameters are:evalgrad = 0; boolโ Set to1if the input image does not represent a gradient norm image.mark = 0; boolโ Mark the segmented watersheds with a special gray scale value.n = [sphere:r=1]; factoryโ Neighborhood for watershead region growing. For supported plug-ins seePLUGINS:3dimage/shapethresh = 0; float in [0, 1)โ Relative gradient norm threshold. The actual value threshold value isthresh * (max_grad - min_grad) + min_grad. Bassins separated by gradients with a lower norm will be joined.
๐ PLUGINS: 3dimage/fullcost ๐
image
Generalized image similarity cost function that also handles multi-resolution processing ๐ฆ. The actual similarity measure is handed over as an extra parameter. Supported parameters are:
cost = ssd; factoryโ Cost function kernel. For supported plug-ins seePLUGINS:3dimage/costdebug = 0; boolโ Save intermediate resuts for debugging.ref =(input, io)โ Reference image. For supported file types seePLUGINS:3dimage/iosrc =(input, io)โ Study image. For supported file types seePLUGINS:3dimage/ioweight = 1; floatโ weight of cost function.
labelimage
Similarity cost function that maps labels of two images and handles label-preserving multi-resolution processing ๐ท๏ธโจ. Supported parameters are:
maxlabel = 256; int in [2, 32000]โ maximum number of labels to consider.ref =(input, io)โ Reference image. For supported file types seePLUGINS:3dimage/iosrc =(input, io)โ Study image. For supported file types seePLUGINS:3dimage/ioweight = 1; floatโ weight of cost function.
maskedimage
Generalized masked image similarity cost function that also handles multi-resolution processing ๐ค. Ok listen, important deets:
The provided masks should be densly filled regions in multi-resolution procesing because otherwise the mask information may get lost when downscaling the image. The mask may be pre-filtered โ after pre-filtering the masks must be of bit-type. The reference mask and the transformed mask of the study image are combined by binary AND.
The actual similarity measure is handed over as an extra parameter. Supported parameters are:
cost = ssd; factoryโ Cost function kernel. For supported plug-ins seePLUGINS:3dimage/maskedcostref =(input, io)โ Reference image. For supported file types seePLUGINS:3dimage/ioref-mask =(input, io)โ Reference image mask (binary). For supported file types seePLUGINS:3dimage/ioref-mask-filter = ; factoryโ Filter to prepare the reference mask image, the output must be a binary image.. For supported plug-ins seePLUGINS:3dimage/filtersrc =(input, io)โ Study image. For supported file types seePLUGINS:3dimage/iosrc-mask =(input, io)โ Study image mask (binary). For supported file types seePLUGINS:3dimage/iosrc-mask-filter = ; factoryโ Filter to prepare the study mask image, the output must be a binary image.. For supported plug-ins seePLUGINS:3dimage/filterweight = 1; floatโ weight of cost function.
taggedssd
Evaluates the Sum of Squared Differences similarity measure by using three tagged image pairs ๐ฅ. The cost function value is evaluated based on all image pairs, but the gradient is composed by composing its component based on the tag direction. Supported parameters are:
refx =(input, io)โ Reference image X-tag. For supported file types seePLUGINS:3dimage/iorefy =(input, io)โ Reference image Y-tag. For supported file types seePLUGINS:3dimage/iorefz =(input, io)โ Reference image Z-tag. For supported file types seePLUGINS:3dimage/iosrcx =(input, io)โ Study image X-tag. For supported file types seePLUGINS:3dimage/iosrcy =(input, io)โ Study image Y-tag. For supported file types seePLUGINS:3dimage/iosrcz =(input, io)โ Study image Z-tag. For supported file types seePLUGINS:3dimage/ioweight = 1; floatโ weight of cost function.
๐พ PLUGINS: 3dimage/io ๐พ
okay bestie, this one's the whole file-reading squad ๐ every plugin here is a reader/writer for a different image format, and each one tells you which file extensions it recognizes and which element types it can handle. so if your pipeline is screaming "unknown format", this is the list to check. noted. โจ
๐ผ analyze โ Analyze 7.5 image
- Recognized file extensions:
.HDR,.hdr - Supported element types:
- unsigned 8 bit
- signed 16 bit
- signed 32 bit
- floating point 32 bit
- floating point 64 bit
๐ช datapool โ Virtual IO to and from the internal data pool
- Recognized file extensions:
.@
(yes that's the whole extension, it's giving minimalism ๐)
๐ฉป dicom โ Dicom image series as 3D
- Recognized file extensions:
.DCM,.dcm - Supported element types:
- signed 16 bit
- unsigned 16 bit
๐ง hdf5 โ HDF5 3D image IO
- Recognized file extensions:
.H5,.h5 - Supported element types:
- binary data
- signed 8 bit
- unsigned 8 bit
- signed 16 bit
- unsigned 16 bit
- signed 32 bit
- unsigned 32 bit
- signed 64 bit
- unsigned 64 bit
- floating point 32 bit
- floating point 64 bit
lowkey the full roster of element types, we love a plugin that does everything ๐
๐ซ๐ท inria โ INRIA image
- Recognized file extensions:
.INR,.inr - Supported element types:
- signed 8 bit
- unsigned 8 bit
- signed 16 bit
- unsigned 16 bit
- signed 32 bit
- unsigned 32 bit
- floating point 32 bit
- floating point 64 bit
๐งช mhd โ MetaIO 3D image IO using the VTK implementation (experimental).
- Recognized file extensions:
.MHA,.MHD,.mha,.mhd - Supported element types:
- signed 8 bit
- unsigned 8 bit
- signed 16 bit
- unsigned 16 bit
- signed 32 bit
- unsigned 32 bit
- floating point 32 bit
- floating point 64 bit
โ ๏ธ heads up bestie, this one is experimental. it said so itself, i'm just the messenger ๐ญ
๐ง nifti โ NIFTI-1 3D image IO
The orientation is transformed in the same way like it is done with dicomtonifti --no-reorder from the vtk-dicom package. (yes, exact flags, no edits, iykyk ๐)
- Recognized file extensions:
.NII,.nii - Supported element types:
- signed 8 bit
- unsigned 8 bit
- signed 16 bit
- unsigned 16 bit
- signed 32 bit
- unsigned 32 bit
- signed 64 bit
- unsigned 64 bit
- floating point 32 bit
- floating point 64 bit
๐ vff โ VFF Sun raster format
- Recognized file extensions:
.VFF,.vff - Supported element types:
- unsigned 8 bit
- signed 16 bit
๐ vista โ Vista 3D
- Recognized file extensions:
.-,.V,.VISTA,.v,.vista - Supported element types:
- binary data
- signed 8 bit
- unsigned 8 bit
- signed 16 bit
- unsigned 16 bit
- signed 32 bit
- unsigned 32 bit
- floating point 32 bit
- floating point 64 bit
(that .- extension is so real, unhinged but iconic ๐ฆ)
๐งฉ vti โ 3D image VTK-XML in- and output (experimental).
- Recognized file extensions:
.VTI,.vti - Supported element types:
- signed 8 bit
- unsigned 8 bit
- signed 16 bit
- unsigned 16 bit
- signed 32 bit
- unsigned 32 bit
- floating point 32 bit
- floating point 64 bit
โ ๏ธ also experimental, no cap. handle with care ๐ซถ
๐ฟ vtk โ 3D VTK image legacy in- and output (experimental).
- Recognized file extensions:
.VTK,.VTKIMAGE,.vtk,.vtkimage - Supported element types:
- signed 8 bit
- unsigned 8 bit
- signed 16 bit
- unsigned 16 bit
- signed 32 bit
- unsigned 32 bit
- floating point 32 bit
- floating point 64 bit
โ ๏ธ yep, experimental too. it's the legacy one so, yk, respect your elders ๐
๐ญ PLUGINS: 3dimage/maskedcost ๐ญ
the cost-function girlies but with masking support โจ these are the ones you reach for when some pixels just don't deserve an opinion. ๐
๐ lncc
local normalized cross correlation with masking support., supported parameters are:
w = 5; uint in [1, 256]โ half width of the window used for evaluating the localized cross correlation.
(so the actual window is 2*w wide-ish in spirit, but the manpage says half width, and we report, we don't editorialize ๐
)
๐ฎ mi
Spline parzen based mutual information with masking., supported parameters are:
cut = 0; float in [0, 40]โ Percentage of pixels to cut at high and low intensities to remove outliers.mbins = 64; uint in [1, 256]โ Number of histogram bins used for the moving image.mkernel = [bspline:d=3]; factoryโ Spline kernel for moving image parzen hinstogram. For supported plug-ins see PLUGINS:1d/splinekernelrbins = 64; uint in [1, 256]โ Number of histogram bins used for the reference image.rkernel = [bspline:d=0]; factoryโ Spline kernel for reference image parzen hinstogram. For supported plug-ins see PLUGINS:1d/splinekernel
๐ซถ psst:mkerneldefaults to a degree-3 bspline andrkernelto a degree-0 one. the two "hinstogram" typos are hers, i am simply relaying the message ๐ญ
๐งฎ ncc
normalized cross correlation with masking support.
(no parameters)
๐ ssd
Sum of squared differences with masking.
(no parameters)
๐ท PLUGINS: 3dimage/shape ๐ท
shape neighborhoods!! these build the little neighborhood blobs that the algorithm vibes with ๐ธ
๐ฒ 18n
18n neighborhood 3D shape creator
(no parameters)
๐ฒ 26n
26n neighborhood 3D shape creator
(no parameters)
๐ฒ 6n
6n neighborhood 3D shape creator
(no parameters)
๐ฎ sphere
Closed spherical shape neighborhood including the pixels within a given radius r., supported parameters are:
r = 2; float in (0, inf)โ sphere radius.
bestie note: that interval is open at zero โ(0, inf)โ sor = 0is not invited to the party. ๐ซ
and that's the shape section, main character energy for real ๐
๐ PLUGINS: 3dimage/transform ๐
okay so this is the glow-up factory, bestie โจ every plug-in in here takes your image and moves it โ rotates it, squishes it, bends it, whatever the optimizer tells it to do. The <italic>degrees of freedom</italic> number = how many knobs the optimizer gets to fiddle with. More knobs = more power = more chaos ๐ฅ
Every single one of these bad boys shares the two same interpolation parameters, so imma say the vibe once and then just list them each time so nobody's scrolling up like a lost little ghost ๐ป
imgboundary=mirror; factory โ the interpolation boundary conditions for your image. Wanna know which plug-ins you can slot in here? Run don't walk toPLUGINS:1d/splinebc๐ฆimgkernel=[bspline:d=3]; factory โ the image interpolator kernel. Same deal, supported plug-ins are chilling inPLUGINS:1d/splinekernel๐ธ
๐ affine
Affine transformation with 12 degrees of freedom โ she's doing the absolute most, periodt. Supported parameters are:
imgboundary=mirror; factory โ image interpolation boundary conditions. Supported plug-ins: seePLUGINS:1d/splinebcimgkernel=[bspline:d=3]; factory โ image interpolator kernel. Supported plug-ins: seePLUGINS:1d/splinekernel
๐ axisrot
Restricted rotation transformation โ only 1 degree of freedom, so she's on a leash but she's still serving ๐ The transformation is locked to a rotation around the given axis, about the given rotation center. Supported parameters are:
axis= (required, 3dfvector) โ the rotation axis.imgboundary=mirror; factory โ image interpolation boundary conditions. Supported plug-ins: seePLUGINS:1d/splinebcimgkernel=[bspline:d=3]; factory โ image interpolator kernel. Supported plug-ins: seePLUGINS:1d/splinekernelorigin= (required, 3dfvector) โ the center of the transformation.
๐ raffine
Restricted affine transformation, working with just 3 degrees of freedom. The way this one works: the rotation is restricted to spinning around the given axis, and the shearing happens along the two axes perpendicular to that given one. Supported parameters are:
axis= (required, 3dfvector) โ the rotation axis.imgboundary=mirror; factory โ image interpolation boundary conditions. Supported plug-ins: seePLUGINS:1d/splinebcimgkernel=[bspline:d=3]; factory โ image interpolator kernel. Supported plug-ins: seePLUGINS:1d/splinekernelorigin= (required, 3dfvector) โ the center of the transformation.
๐ rigid
Rigid transformation โ that's rotation plus translation, aka six degrees of freedom in one cute little package ๐ซถ Supported parameters are:
imgboundary=mirror; factory โ image interpolation boundary conditions. Supported plug-ins: seePLUGINS:1d/splinebcimgkernel=[bspline:d=3]; factory โ image interpolator kernel. Supported plug-ins: seePLUGINS:1d/splinekernelorigin=[[0,0,0]]; 3dfvector โ the relative rotation center, meaning<0.5,0.5,0.5>lands you right in the center of the volume. Lowkey the most important default here, don't sleep on it.
๐ rotation
Rotation transformation, three degrees of freedom of pure spinning energy ๐ Supported parameters are:
imgboundary=mirror; factory โ image interpolation boundary conditions. Supported plug-ins: seePLUGINS:1d/splinebcimgkernel=[bspline:d=3]; factory โ image interpolator kernel. Supported plug-ins: seePLUGINS:1d/splinekernelorigin=[[0,0,0]]; 3dfvector โ the relative rotation center, where<0.5,0.5,0.5>is the center of the volume. Same energy asrigid, no cap.
๐ rotbend
Restricted transformation with 4 degrees of freedom. This one gets bendy: the rotation is restricted to spinning around the x and y axis, plus a bending along the x axis, independent in each direction, and that bending increases with the squared distance from the rotation axis ๐คธ Supported parameters are:
imgboundary=mirror; factory โ image interpolation boundary conditions. Supported plug-ins: seePLUGINS:1d/splinebcimgkernel=[bspline:d=3]; factory โ image interpolator kernel. Supported plug-ins: seePLUGINS:1d/splinekernelnorot=0; bool โ don't optimize the rotation. Set it and the rotation stays exactly where it is, bestie, she's clocked out ๐ดorigin= (required, 3dfvector) โ the center of the transformation.
๐ spline
Free-form transformation, aka the chaos gremlin ๐ง She can be described by a set of B-spline coefficients plus an underlying B-spline kernel. Supported parameters are:
anisorate=[[0,0,0]]; 3dfvector โ the anisotropic coefficient rate in pixels. Heads up: any nonpositive values get overwritten by theratevalue ๐ so don't get cute with zeros.debug=0; bool โ enable additional debugging output. Turn her on when you're in your detective era ๐imgboundary=mirror; factory โ image interpolation boundary conditions. Supported plug-ins: seePLUGINS:1d/splinebcimgkernel=[bspline:d=3]; factory โ image interpolator kernel. Supported plug-ins: seePLUGINS:1d/splinekernelkernel=[bspline:d=3]; factory โ the transformation spline kernel. Supported plug-ins: seePLUGINS:1d/splinekernelpenalty= ; factory โ the transformation penalty energy term. Supported plug-ins: seePLUGINS:3dtransform/splinepenalty๐rate=10; float in[1, inf)โ the isotropic coefficient rate in pixels.
๐ translate
Translation, three degrees of freedom โ she just slides, no spinning, no drama ๐ Supported parameters are:
imgboundary=mirror; factory โ image interpolation boundary conditions. Supported plug-ins: seePLUGINS:1d/splinebcimgkernel=[bspline:d=3]; factory โ image interpolator kernel. Supported plug-ins: seePLUGINS:1d/splinekernel
๐ vf
This plug-in implements a transformation that defines a translation for each point of the grid defining the domain of the transformation. Yes bestie, a whole translation per point, she's thorough like that ๐ Supported parameters are:
imgboundary=mirror; factory โ image interpolation boundary conditions. Supported plug-ins: seePLUGINS:1d/splinebcimgkernel=[bspline:d=3]; factory โ image interpolator kernel. Supported plug-ins: seePLUGINS:1d/splinekernel
๐ฆ PLUGINS: 3dtransform/io ๐ฆ
This is where your 3D transformations get saved and loaded โ the โจmemoryโจ department. Here's the roster of file-format plug-ins, and what extensions they claim:
bbsโ Binary (non-portable) serialized IO of 3D transformations.- Recognized file extensions:
.bbs
- Recognized file extensions:
datapoolโ Virtual IO to and from the internal data pool.- Recognized file extensions:
.@
- Recognized file extensions:
vistaโ Vista storage of 3D transformations.- Recognized file extensions:
.v,.v3dt
- Recognized file extensions:
xmlโ XML serialized IO of 3D transformations.- Recognized file extensions:
.x3dt
- Recognized file extensions:
ngl <pink>bbs</pink> says non-portable right there in the description โ that's not me being shady, that's the manpage being honest. Take her to another machine at your own risk ๐ญ
๐ PLUGINS: 3dtransform/splinepenalty ๐
The discipline section ๐ These are the energy terms that keep your spline transformation from doing whatever unhinged nonsense it wants. Right now there's exactly one plug-in here:
๐ divcurl
divcurl penalty on the transformation. Supported parameters are:
curl=1; float in[0, inf)โ the penalty weight on curl.div=1; float in[0, inf)โ the penalty weight on divergence.norm=0; bool โ set to1if the penalty should be normalized with respect to the image size.weight=1; float in(0, inf)โ the weight of the penalty energy.
psst โ see the difference?curl,divandweightare all allowed to be bigger than zero, butweightstarts its range above zero ((0, inf)) while the other two can legitimately hit0([0, inf)). Little bracket, big difference, iykyk ๐
๐ PLUGINS: minimizer/singlecost ๐
Okay bestie, this is the minimizer shelf โ the little optimizer plugins that live under minimizer/singlecost. These are the girls who actually do the walking downhill, and you gotta pick your fighter. ๐
โจ gdas โจ
Gradient descent with automatic step size correction. She's simple, she's reliable, she fixes her own step size like a queen. Params:
ftolr = 0(double in [0, inf)) โ stop if the relative change of the criterion is below.max-step = 2(double in (0, inf)) โ the maximal absolute step size.maxiter = 200(uint in [1, inf)) โ stopping criterion: the maximum number of iterations.min-step = 0.1(double in (0, inf)) โ the minimal absolute step size.xtola = 0.01(double in [0, inf)) โ stop if the inf-norm of the change applied toxis below this value.
๐ธ gdsq ๐ธ
Gradient descent but with quadratic step estimation โ she guessed the step size and honestly? she ate. Params:
ftolr = 0(double in [0, inf)) โ stop if the relative change of the criterion is below.gtola = 0(double in [0, inf)) โ stop if the inf-norm of the gradient is below this value.maxiter = 100(uint in [1, inf)) โ stopping criterion: the maximum number of iterations.scale = 2(double in (1, inf)) โ fallback fixed step size scaling.step = 0.1(double in (0, inf)) โ initial step size.xtola = 0(double in [0, inf)) โ stop if the inf-norm ofx-update is below this value.
๐ฆ gsl ๐ฆ
Optimizer plugin based on the multimin optimizers of the GNU Scientific Library (GSL), https://www.gnu.org/software/gsl/ โ yes she's the library girl, no cap. Params:
eps = 0.01(double in (0, inf)) โ gradient based optimizers: stop when|grad| < eps, simplex: stop when simplex size <eps.iter = 100(uint in [1, inf)) โ maximum number of iterations.opt = gd(dict) โ specific optimizer to be used. Supported values are:simplexโ Simplex algorithm of Nelder and Meadcg-frโ Flecher-Reeves conjugate gradient algorithmcg-prโ Polak-Ribiere conjugate gradient algorithmbfgsโ Broyden-Fletcher-Goldfarb-Shannbfgs2โ Broyden-Fletcher-Goldfarb-Shann (most efficient version)gdโ Gradient descent.
step = 0.001(double in (0, inf)) โ initial step size.tol = 0.1(double in (0, inf)) โ some tolerance parameter.
๐ nlopt ๐
Minimizer algorithms using the NLOPT library. For a description of the optimizers please see http://ab-initio.mit.edu/wiki/index.php/NLopt_Algorithms. This one has a whole menu of glowy options, so buckle up buttercup. Params:
ftola = 0(double in [0, inf)) โ stopping criterion: the absolute change of the objective value is below this value.ftolr = 0(double in [0, inf)) โ stopping criterion: the relative change of the objective value is below this value.higher = inf(double) โ higher boundary (equal for all parameters).local-opt = none(dict) โ local minimization algorithm that may be required for the main minimization algorithm. Supported values are:gn-directโ Dividing Rectanglesgn-direct-lโ Dividing Rectangles (locally biased)gn-direct-l-randโ Dividing Rectangles (locally biased, randomized)gn-direct-noscalโ Dividing Rectangles (unscaled)gn-direct-l-noscalโ Dividing Rectangles (unscaled, locally biased)gn-direct-l-rand-noscaleโ Dividing Rectangles (unscaled, locally biased, randomized)gn-orig-directโ Dividing Rectangles (original implementation)gn-orig-direct-lโ Dividing Rectangles (original implementation, locally biased)ld-lbfgs-nocedalโ Noneld-lbfgsโ Low-storage BFGSln-praxisโ Gradient-free Local Optimization via the Principal-Axis Methodld-var1โ Shifted Limited-Memory Variable-Metric, Rank 1ld-var2โ Shifted Limited-Memory Variable-Metric, Rank 2ld-tnewtonโ Truncated Newtonld-tnewton-restartโ Truncated Newton with steepest-descent restartingld-tnewton-precondโ Preconditioned Truncated Newtonld-tnewton-precond-restartโ Preconditioned Truncated Newton with steepest-descent restartinggn-crs2-lmโ Controlled Random Search with Local Mutationld-mmaโ Method of Moving Asymptotesln-cobylaโ Constrained Optimization BY Linear Approximationln-newuoaโ Derivative-free Unconstrained Optimization by Iteratively Constructed Quadratic Approximationln-newuoa-boundโ Derivative-free Bound-constrained Optimization by Iteratively Constructed Quadratic Approximationln-neldermeadโ Nelder-Mead simplex algorithmln-sbplxโ Subplex variant of Nelder-Meadln-bobyqaโ Derivative-free Bound-constrained Optimizationgn-isresโ Improved Stochastic Ranking Evolution Strategynoneโ don't specify algorithm
lower = -inf(double) โ lower boundary (equal for all parameters).maxiter = 100(int in [1, inf)) โ stopping criterion: the maximum number of iterations.opt = ld-lbfgs(dict) โ main minimization algorithm. Supported values are:gn-directโ Dividing Rectanglesgn-direct-lโ Dividing Rectangles (locally biased)gn-direct-l-randโ Dividing Rectangles (locally biased, randomized)gn-direct-noscalโ Dividing Rectangles (unscaled)gn-direct-l-noscalโ Dividing Rectangles (unscaled, locally biased)gn-direct-l-rand-noscaleโ Dividing Rectangles (unscaled, locally biased, randomized)gn-orig-directโ Dividing Rectangles (original implementation)gn-orig-direct-lโ Dividing Rectangles (original implementation, locally biased)ld-lbfgs-nocedalโ Noneld-lbfgsโ Low-storage BFGSln-praxisโ Gradient-free Local Optimization via the Principal-Axis Methodld-var1โ Shifted Limited-Memory Variable-Metric, Rank 1ld-var2โ Shifted Limited-Memory Variable-Metric, Rank 2ld-tnewtonโ Truncated Newtonld-tnewton-restartโ Truncated Newton with steepest-descent restartingld-tnewton-precondโ Preconditioned Truncated Newtonld-tnewton-precond-restartโ Preconditioned Truncated Newton with steepest-descent restartinggn-crs2-lmโ Controlled Random Search with Local Mutationld-mmaโ Method of Moving Asymptotesln-cobylaโ Constrained Optimization BY Linear Approximationln-newuoaโ Derivative-free Unconstrained Optimization by Iteratively Constructed Quadratic Approximationln-newuoa-boundโ Derivative-free Bound-constrained Optimization by Iteratively Constructed Quadratic Approximationln-neldermeadโ Nelder-Mead simplex algorithmln-sbplxโ Subplex variant of Nelder-Meadln-bobyqaโ Derivative-free Bound-constrained Optimizationgn-isresโ Improved Stochastic Ranking Evolution Strategyauglagโ Augmented Lagrangian algorithmauglag-eqโ Augmented Lagrangian algorithm with equality constraints onlyg-mlslโ Multi-Level Single-Linkage (require local optimization and bounds)g-mlsl-ldsโ Multi-Level Single-Linkage (low-discrepancy-sequence, require local gradient based optimization and bounds)ld-slsqpโ Sequential Least-Squares Quadratic Programming
step = 0(double in [0, inf)) โ initial step size for gradient free methods.stop = -inf(double) โ stopping criterion: function value falls below this value.xtola = 0(double in [0, inf)) โ stopping criterion: the absolute change of all x-values is below this value.xtolr = 0(double in [0, inf)) โ stopping criterion: the relative change of all x-values is below this value.
โจ EXAMPLE โจ
Bestie here's the whole recipe in one go: register the image series given by images imageXXXX.v by optimizing a spline based transformation with a coefficient rate of 16 pixel, skipping two images at the beginning and using normalized gradient fields as initial cost measure and SSD as final measure. Penalize the transformation by using divcurl with a weight of 2.0. As optimizer an nlopt based newton method is used. Slay. ๐
mia-3dprealign-nonrigid mia-3dprealign-nonrigid -i imageXXXX.v -o
registered -t vista -k 2-F
spline:rate=16,penalty=[divcurl:weight=2] -1
image:cost=[ngf:eval=ds] -2 image:cost=ssd -O
nlopt:opt=ld-var1,xtola=0.001,ftolr=0.001,maxiter=300
๐ AUTHOR(s) ๐
Gert Wollny
โจ COPYRIGHT โจ
okay bestie, legal o'clock ๐ and no we're not skipping it, it literally takes ten seconds.
This software is Copyright (c) 1999โ2015 Leipzig, Germany and Madrid, Spain ๐ Like, the whole thing, both cities, that era. Iconic run tbh.
It comes with ABSOLUTELY NO WARRANTY ๐ญ bestie not even a little one, not a vibe, not a hypothetical. Cap that in your head fr fr.
You may redistribute it under the terms of the GNU GENERAL PUBLIC LICENSE Version 3 (or later) ๐ so like, version 3 is the floor, you can go up from there, we're not gatekeeping.
Want the whole receipts? For more information run the program with the option --copyright ๐
aaaand that's a wrap on the whole page, bestie ๐ซถ you made it to the very end, main character energy fr ๐ this one lives in the USER COMMANDS section, it's v2.4.7 of ya girl, and it's the mia-3dprealign-nonrigid(1) manual page ๐ go forth and prealign some nonrigid stuff, slay, periodt ๐ โจ
๐ฆ where this page comes from
- ubuntu resolute: mia-tools 2.4.7-18 ยท GPL-3.0-or-later
- ubuntu stonking: mia-tools 2.4.7-19build1 ยท GPL-3.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms