mia-2dmult...gistration(1)
โจ NAME โจ
mia-2dmultiimageregistration โ Non-linear registration of 2D images ๐
It's a General Commands Manual situation, bestie, and this is the whole vibe. ๐
๐ธ SYNOPSIS ๐ธ
mia-2dmultiimageregistration -o <out-transform> [options]
<PLUGINS:2dimage/fullcost>
๐ฆ DESCRIPTION ๐ฆ
okay so mia-2dmultiimageregistration runs a non-rigid registration based on the cost criteria you hand it and a transformation model you pick. That's the whole plot. โจ
But here's the tea: unlike mia-2dnonrigidreg, this one does not have special command line parameters where you hand over the images. Nope. Instead the images get specified directly when you define the cost function. So like, the images live inside the cost function setup, and because of that you can run registrations that optimize the alignment of more than one image pair at the same time. Multi-tasking icon behavior honestly. ๐
One thing though โ all input images must be of the same dimension (in pixels). No mixing sizes, no exceptions. Vibe check failed otherwise. ๐ญ
๐ OPTIONS ๐
-o,--out-transform=(output, required); ioโ output transformation For supported file types seePLUGINS:2dtransform/io-l,--levels=3โ multi-resolution levels ๐-O,--optimizer=gsl:opt=gd,step=0.1โ Optimizer used for minimization For supported plugins seePLUGINS:minimizer/singlecost-f,--transForm=spline:rate=10,penalty=divcurlโ transformation type For supported plugins seePLUGINS:2dimage/transform
๐ฌ 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/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: 2dimage/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.
lsdโ Least-Squares Distance measure- (no parameters)
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. Various evaluation kernels are available., supported parameters are:eval = ds; dictโ plugin subtype. Supported values are:sqโ square of differencedsโ square of scaled differencedotโ scalar product kernelcrossโ cross product kernel
ssdโ 2D imaga 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โ 2D 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: 2dimage/fullcost ๐
imageโ Generalized image similarity cost function that also handles multi-resolution processing. The actual similarity measure is given es extra parameter., supported parameters are:cost = ssd; factoryโ Cost function kernel. For supported plug-ins seePLUGINS:2dimage/costdebug = 0; boolโ Save intermediate resuts for debugging.ref =(input, io)โ Reference image. For supported file types seePLUGINS:2dimage/iosrc =(input, io)โ Study image. For supported file types seePLUGINS:2dimage/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:debug = 0; int in [0, 1]โ write the distance transforms to a 3D image.maxlabel = 256; int in [2, 32000]โ maximum number of labels to consider.ref =(input, io)โ Reference image. For supported file types seePLUGINS:2dimage/iosrc =(input, io)โ Study image. For supported file types seePLUGINS:2dimage/ioweight = 1; floatโ weight of cost function.
maskedimageโ Generalized masked image similarity cost function that also handles multi-resolution processing. 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 reference mask and the transformed mask of the study image are combined by binary AND. The actual similarity measure is given es extra parameter., supported parameters are:cost = ssd; factoryโ Cost function kernel. For supported plug-ins seePLUGINS:2dimage/maskedcostref =(input, io)โ Reference image. For supported file types seePLUGINS:2dimage/ioref-mask =(input, io)โ Reference image mask (binary). For supported file types seePLUGINS:2dimage/iosrc =(input, io)โ Study image. For supported file types seePLUGINS:2dimage/iosrc-mask =(input, io)โ Study image mask (binary). For supported file types seePLUGINS:2dimage/ioweight = 1; floatโ weight of cost function.
โจ PLUGINS: 2dimage/io โจ
okay bestie this is the whole reader/writer squad โ every one of these handles a different file format so your images can come in and go out in peace ๐
bmpโ BMP 2D-image input/output support. She can read and write binary images and 8-bit gray scale images, and she does read-only duty for 4-bit gray scale images. Heads up: the color table gets straight-up ignored, and the pixel values are just taken as literal gray scale values. periodt.
Recognized file extensions: .BMP, .bmp
Supported element types:
- binary data, unsigned 8 bit
datapoolโ Virtual IO to and from the internal data pool. it's giving "files but make it in-memory" โจ
Recognized file extensions: .@
dicomโ 2D image io for DICOM. medical girlies rise up ๐ฉบ
Recognized file extensions: .DCM, .dcm
Supported element types:
- signed 16 bit, unsigned 16 bit
exrโ a 2dimage io plugin for OpenEXR images. HDR queen ๐
Recognized file extensions: .EXR, .exr
Supported element types:
- unsigned 32 bit, floating point 32 bit
jpgโ a 2dimage io plugin for jpeg gray scale images. gray scale only, no color, we stay focused ๐
Recognized file extensions: .JPEG, .JPG, .jpeg, .jpg
Supported element types:
- unsigned 8 bit
pngโ a 2dimage io plugin for png images. the versatile icon we all know and love ๐
Recognized file extensions: .PNG, .png
Supported element types:
- binary data, unsigned 8 bit, unsigned 16 bit
rawโ RAW 2D-image output support. output only, so don't come here looking to read anything back. also she supports so many types it's honestly iconic.
Recognized file extensions: .RAW, .raw
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
tifโ TIFF 2D-image input/output support. the workhorse bestie ๐ซถ
Recognized file extensions: .TIF, .TIFF, .tif, .tiff
Supported element types:
- binary data, unsigned 8 bit, unsigned 16 bit, unsigned 32 bit
vistaโ a 2dimage io plugin for vista images. literally the whole element-type buffet, no cap.
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
๐ PLUGINS: 2dimage/maskedcost ๐
these are the cost functions that know how to mask โ like they only pay attention to the pixels you told them to care about. self-care, honestly ๐ธ
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 window is basicallywon each side, iykyk.
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. bye 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 histogram. 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 histogram. For supported plug-ins see PLUGINS:1d/splinekernel
nccโ normalized cross correlation with masking support.
(no parameters) โ yeah she's low maintenance, zero config, just vibes โจ
ssdโ Sum of squared differences with masking.
(no parameters) โ also zero config. also vibes. ๐
๐ฆ PLUGINS: 2dimage/transform ๐ฆ
the transformation girlies!! each one is a different flavor of "how do we move this image around" ๐ซ
affineโ Affine transformation (six degrees of freedom). supported parameters are:imgboundary = mirror; factoryโ image interpolation boundary conditions. For supported plug-ins see PLUGINS:1d/splinebcimgkernel = [bspline:d=3]; factoryโ image interpolator kernel. For supported plug-ins see PLUGINS:1d/splinekernel
rigidโ Rigid transformations (i.e. rotation and translation, three degrees of freedom). supported parameters are:imgboundary = mirror; factoryโ image interpolation boundary conditions. For supported plug-ins see PLUGINS:1d/splinebcimgkernel = [bspline:d=3]; factoryโ image interpolator kernel. For supported plug-ins see PLUGINS:1d/splinekernelrot-center = [[0,0]]; 2dfvectorโ Relative rotation center, i.e.<0.5,0.5>corresponds to the center of the support rectangle. so if you want to spin around the middle, that's your number bestie ๐ฏ
rotationโ Rotation transformations (i.e. rotation about a given center, one degree of freedom). supported parameters are:imgboundary = mirror; factoryโ image interpolation boundary conditions. For supported plug-ins see PLUGINS:1d/splinebcimgkernel = [bspline:d=3]; factoryโ image interpolator kernel. For supported plug-ins see PLUGINS:1d/splinekernelrot-center = [[0,0]]; 2dfvectorโ Relative rotation center, i.e.<0.5,0.5>corresponds to the center of the support rectangle.
splineโ Free-form transformation that can be described by a set of B-spline coefficients and an underlying B-spline kernel. the flexible one. the main character. ๐anisorate = [[0,0]]; 2dfvectorโ anisotropic coefficient rate in pixels, nonpositive values will be overwritten by theratevalue.imgboundary = mirror; factoryโ image interpolation boundary conditions. For supported plug-ins see PLUGINS:1d/splinebcimgkernel = [bspline:d=3]; factoryโ image interpolator kernel. For supported plug-ins see PLUGINS:1d/splinekernelkernel = [bspline:d=3]; factoryโ transformation spline kernel. For supported plug-ins see PLUGINS:1d/splinekernelpenalty = ; factoryโ Transformation penalty term. For supported plug-ins see PLUGINS:2dtransform/splinepenaltyrate = 10; float in [1, inf)โ isotropic coefficient rate in pixels.
translateโ Translation only (two degrees of freedom). supported parameters are:imgboundary = mirror; factoryโ image interpolation boundary conditions. For supported plug-ins see PLUGINS:1d/splinebcimgkernel = [bspline:d=3]; factoryโ image interpolator kernel. For supported plug-ins see PLUGINS: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, every single point gets its own lil translation. it's giving chaotic but make it precise ๐ญimgboundary = mirror; factoryโ image interpolation boundary conditions. For supported plug-ins see PLUGINS:1d/splinebcimgkernel = [bspline:d=3]; factoryโ image interpolator kernel. For supported plug-ins see PLUGINS:1d/splinekernel
๐ PLUGINS: 2dtransform/io ๐
where 2D transformations themselves get saved and loaded. storing the transformation, not the image. very meta of her ๐
bbsโ Binary (non-portable) serialized IO of 2D transformations. non-portable, so don't expect to carry this file across machines, fr fr.
Recognized file extensions: .bbs
datapoolโ Virtual IO to and from the internal data pool.
Recognized file extensions: .@
vistaโ Vista storage of 2D transformations.
Recognized file extensions: .v2dt
xmlโ XML serialized IO of 2D transformations. portable, readable, very demure โจ
Recognized file extensions: .x2dt
๐ PLUGINS: 2dtransform/splinepenalty ๐
penalties! but like, the math kind, not the time-out kind ๐ these keep your transformation from getting too wild.
divcurlโ divcurl penalty on the transformation, supported parameters are:curl = 1; float in [0, inf)โ penalty weight on curl.div = 1; float in [0, inf)โ penalty weight on divergence.norm = 0; boolโ Set to 1 if the penalty should be normalized with respect to the image size.weight = 1; float in (0, inf)โ weight of penalty energy.
๐งฎ minimizer/singlecost
Okay bestie, these are the actual minimizer plugins โ the lil engines that go brrr and actually do the minimizing. Four of them. Pick your fighter. โจ
gdas โ Gradient descent with automatic step size correction.
Not me being obsessed with a gradient descent that fixes its own step size ๐ . Params:
ftolr=0; double in[0, inf)โ Stop if the relative change of the criterion is below this. ๐max-step=2; double in(0, inf)โ Maximal absolute step size. (yes,max-stepwith the hyphen, no typo fr fr)maxiter=200; uint in[1, inf)โ Stopping criterion: the maximum number of iterations.min-step=0.1; double in(0, inf)โ Minimal absolute step size.xtola=0.01; double in[0, inf)โ Stop if the inf-norm of the change applied to x is below this value.
gdsq โ Gradient descent with quadratic step estimation
This one's the quadratic-step-estimation girlie ๐ธ. Params:
ftolr=0; double in[0, inf)โ Stop if the relative change of the criterion is below this.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 of x-update is below this value.
gsl โ optimizer plugin based on the multimin optimizers of the GNU Scientific Library (GSL)
Link drop, no shame: https://www.gnu.org/software/gsl/ ๐ซถ 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
The big one. The main character. ๐ For a description of the optimizers please see 'http://ab-initio.mit.edu/wiki/index.php/NLopt_Algorithms'. 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.
Yeah bestie,optandlocal-optreally do both take basically the same big menu. I'm not the one who did that, I'm just the one telling you. ๐ And heads up:local-opthasnonein the list butoptdoes not โ it's gotauglag,auglag-eq,g-mlsl,g-mlsl-ldsandld-slsqpextra instead. Read the list you actually need, okay? ๐
๐ EXAMPLE ๐
So the assignment is: register image test.v to image ref.v, using a spline transformation with a coefficient rate of 5, and write the registered image to reg.v. Use two multiresolution levels, ssd as image cost function, and divcurl weighted by 10.0 as transformation smoothness penalty. The resulting transformation is saved in reg.vf. โจ
mia-2dmultiimageregistration -o reg.vf -l 2
-f spline:rate=3,penalty=divcurl
image:cost=ssd,src=test.v,ref=ref.v
๐ Not me side-eyeing that the prose says a coefficient rate of5and10.0for the penalty, but the actual example command usesrate=3and no weight ondivcurlโฆ I'm just reading the page, bestie, I don't write the lore. Copy the command exactly as it is. No cap. ๐
๐ AUTHOR(s) ๐
Gert Wollny
That's the legend. Periodt. ๐
๐ COPYRIGHT ๐
okay bestie, the legal bit, and I need you to actually read this one because it's giving "we're cute but we're serious" ๐
This software is Copyright (c) 1999โ2015 โ yep, that's Leipzig, Germany and Madrid, Spain holding the copyright, iconic duo, no cap. ๐ซถ
It comes with ABSOLUTELY NO WARRANTY. fr fr. Like, capital letters, absolutely, no warranty. If it breaks, that's between you and the universe. ๐ญ
And you may redistribute it under the terms of the GNU GENERAL PUBLIC LICENSE Version 3 (or later). Free software, share the love, periodt. ๐
Want the whole spiel in your terminal instead of reading it here? Just run the program with the option --copyright and it'll spill everything. โจ
๐ that's the whole page, bestie ๐
this came out of the USER COMMANDS source, version v2.4.7, dated mia-2dmult...gistration(1) โ and yes the name is literally truncated with dots, that's just how it's written, we don't question it. ๐
you made it through all four parts, you absolute legend ๐ go run it, slay, and if something explodes remember: no warranty ๐โจ
๐ฆ where this page comes from
- debian bookworm: mia-tools 2.4.7-11+b1 ยท GPL-3.0-or-later
- ubuntu jammy: mia-tools 2.4.7-8ubuntu1 ยท GPL-3.0-or-later
- ubuntu noble: mia-tools 2.4.7-13build4 ยท GPL-3.0-or-later
- 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