mia-2dimageregistration(1)
π mia-2dimageregistration(1) π
General Commands Manual, but make it cute. this is the page for mia-2dimageregistration and bestie it's serving serious registration energy β¨
πΈ NAME
mia-2dimageregistration β runs a 2d image registration. that's it, that's the vibe π
π¦ SYNOPSIS
mia-2dimageregistration -i <in-image> -r <ref-image> -t <transformation>
[options] <PLUGINS:2dimage/fullcost>
β¨ DESCRIPTION
okay so mia-2dimageregistration literally runs a registration of two images π«Ά it takes a transformation from whatever transformation model you gave it and optimizes the heck out of it, using certain cost measures β and those cost measures are handed in as free parameters. the way that it justβ¦ aligns things? obsessed. π
π OPTIONS π
π File-IO
-i,--in-image=(input, required); ioβ the test image, aka the one that's getting registered π for supported file types see PLUGINS:2dimage/io-r,--ref-image=(input, required); ioβ the reference image, aka the one everything gets registered to πΈ for supported file types see PLUGINS:2dimage/io-o,--out-image=(output); ioβ the registered output image that falls out at the end π for supported file types see PLUGINS:2dimage/io-t,--transformation=(output, required); ioβ the output transformation that comprises the registration π for supported file types see PLUGINS:2dtransform/io
π§ Help & Info
-V,--verbose=warningβ how chatty the output is. it prints messages of the given level and every higher priority. the supported priorities, starting at the 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β prints the copyright information π-h,--helpβ prints this help π«Ά-?,--usageβ prints a short help--versionβ prints the version number and then exits, main character exit π«
π Parameters
-l,--levels=3β number of multi-resolution levels πͺ-O,--optimizer=gsl:opt=gd,step=0.1β the optimizer used for minimization π₯ for supported plugins see PLUGINS:minimizer/singlecost-R,--refiner=β the optimizer used for refinement after the main optimizer was called, like a lil glow-up pass β¨ for supported plugins see PLUGINS:minimizer/singlecost-f,--transForm=splineβ transformation type π for supported plugins see PLUGINS:2dimage/transform
βοΈ Processing
--threads=-1β maximum number of threads to use for processing. this number should be lower than or equal to the number of logical processor cores in the machine. (-1means automatic estimation) π§΅
π¦ PLUGINS: 1d/splinebc
mirror πͺ
Spline interpolation boundary conditions that mirror right on the boundary.
(no parameters) β yeah, it's just that simple, no notes π
repeat π
Spline interpolation boundary conditions that repeats the value at the boundary.
(no parameters) β nothing to tune, iconic behaviour π«Ά
zero 0οΈβ£
Spline interpolation boundary conditions that assumes zero for values outside.
(no parameters) β no knobs, no drama πΈ
π PLUGINS: 1d/splinekernel
bspline π
B-spline kernel creation. here's what you can set:
d = 3; int in [0, 5]β spline degree.
omoms π«
OMoms-spline kernel creation. here's what you can set:
d = 3; int in [3, 3]β spline degree.
π PLUGINS: 2dimage/cost
lncc π
local normalized cross correlation, and yes it has masking support. parameters:
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) β nothing to tweak, it just measures π
mi π²
Spline parzen based mutual information. parameters:
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 the 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 the reference image parzen hinstogram. for supported plug-ins see PLUGINS:1d/splinekernel
ncc π
normalized cross correlation.
(no parameters) β clean, minimal, slay β¨
ngf π
this one evaluates the image similarity based on normalized gradient fields, and there are various evaluation kernels available. parameters:
eval = ds; dictβ plugin subtype. the 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. parameters:
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. parameters:
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. parameters:
cost = ssd; factoryβ cost function kernel. for supported plug-ins see PLUGINS:2dimage/costdebug = 0; boolβ save intermediate resuts for debugging.ref =(input, io)β reference image. for supported file types see PLUGINS:2dimage/iosrc =(input, io)β study image. for supported file types see PLUGINS: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. parameters:
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 see PLUGINS:2dimage/iosrc =(input, io)β study image. for supported file types see PLUGINS:2dimage/ioweight = 1; floatβ weight of cost function.
maskedimage π
generalized masked image similarity cost function that also handles multi-resolution processing.
fair warning bestie: the provided masks should be densly filled regions in multi-resolution procesing, because otherwise the mask information may get lost when downscaling the image π no cap, that's a real one.
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. parameters:
cost = ssd; factoryβ cost function kernel. for supported plug-ins see PLUGINS:2dimage/maskedcostref =(input, io)β reference image. for supported file types see PLUGINS:2dimage/ioref-mask =(input, io)β reference image mask (binary). for supported file types see PLUGINS:2dimage/iosrc =(input, io)β study image. for supported file types see PLUGINS:2dimage/iosrc-mask =(input, io)β study image mask (binary). for supported file types see PLUGINS:2dimage/ioweight = 1; floatβ weight of cost function.
π PLUGINS: 2dimage/io πΎ
ok so these are the little file-format besties that let your 2D images go in and out of the program. each one handles its own β¨vibesβ¨ of file extensions and pixel types, so let's go:
π bmp
BMP 2D-image input/output support. this plugin can read AND write binary images and 8-bit gray scale images, and it's read-only for 4-bit gray scale images. the color table? completely ignored, bestie β pixel values get 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 teleportation but for data.
- 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. highkey fancy β¨
- 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, she's minimal like that π
- Recognized file extensions:
.JPEG,.JPG,.jpeg,.jpg - Supported element types:
- unsigned 8 bit
π png
a 2dimage io plugin for png images. the people's princess π
- Recognized file extensions:
.PNG,.png - Supported element types:
- binary data, unsigned 8 bit, unsigned 16 bit
π raw
RAW 2D-image output support. output β so keep that in mind, she's not about the reading life.
- 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. an icon, truly.
- 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. look at that extension list, she's got range π
- 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 π«Ά
cost functions but make them masked, so you can tell the registration bestie which pixels actually matter. here's the lineup:
π 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 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 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 with masking support.
- (no parameters)
not a single knob to turn. she just works. no cap.
π ssd
Sum of squared differences with masking.
- (no parameters)
same energy β zero parameters, all confidence π
π¦ PLUGINS: 2dimage/transform β¨
these are the transformation besties β the ones that actually describe how your image gets moved, squished, rotated and otherwise manipulated. each one has its own degrees of freedom and its own little pile of parameters:
π affine
Affine transformation (six degrees of freedom)., supported parameters are:
imgboundary=mirror;factoryβ image interpolation boundary conditions. For supported plug-ins seePLUGINS:1d/splinebcimgkernel=[bspline:d=3];factoryβ image interpolator kernel. For supported plug-ins seePLUGINS: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 seePLUGINS:1d/splinebcimgkernel=[bspline:d=3];factoryβ image interpolator kernel. For supported plug-ins seePLUGINS:1d/splinekernelrot-center=[[0,0]];2dfvectorβ Relative rotation center, i.e.<0.5,0.5>corresponds to the center of the support rectangle.
π 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 seePLUGINS:1d/splinebcimgkernel=[bspline:d=3];factoryβ image interpolator kernel. For supported plug-ins seePLUGINS: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., supported parameters are:
anisorate=[[0,0]];2dfvectorβ anisotropic coefficient rate in pixels, nonpositive values will be overwritten by the 'rate' value..imgboundary=mirror;factoryβ image interpolation boundary conditions. For supported plug-ins seePLUGINS:1d/splinebcimgkernel=[bspline:d=3];factoryβ image interpolator kernel. For supported plug-ins seePLUGINS:1d/splinekernelkernel=[bspline:d=3];factoryβ transformation spline kernel.. For supported plug-ins seePLUGINS:1d/splinekernelpenalty= ``;factoryβ Transformation penalty term. For supported plug-ins seePLUGINS: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 seePLUGINS:1d/splinebcimgkernel=[bspline:d=3];factoryβ image interpolator kernel. For 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., supported parameters are:
imgboundary=mirror;factoryβ image interpolation boundary conditions. For supported plug-ins seePLUGINS:1d/splinebcimgkernel=[bspline:d=3];factoryβ image interpolator kernel. For supported plug-ins seePLUGINS:1d/splinekernel
π PLUGINS: 2dtransform/io π
the io besties for 2D transformations specifically (yes, transformations get their own file formats, she's that girl):
π bbs
Binary (non-portable) serialized IO of 2D transformations.
non-portable, bestie. don't be shocked when it doesn't travel well π©
- 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.
- Recognized file extensions:
.x2dt
β PLUGINS: 2dtransform/splinepenalty π§
penalty terms for spline transformations β basically the little voice going "girl, not that much wiggle" π«
π 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 to1if the penalty should be normalized with respect to the image size.weight=1;float in (0, inf)β weight of penalty energy.
π gdas
Gradient descent with automatic step size correction. The glow-up version of just walking downhill π . The params it fw:
ftolr=0; double in[0, inf)β stop if the relative change of the criterion is below. bestie is done when the numbers stop moving fr.max-step=2; double in(0, inf)β the maximal absolute step size. biggest stride allowed, no zooming off a cliff π¦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 to x is below this value.
π gdsq
Gradient descent with quadratic step estimation. she's guessing her stride size with math β¨. her 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 of x-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/>. classic library core, no cap. the 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 β the 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> β go read it, it's giving very thorough π. supported parameters are:
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 πΈ
Register the image moving.png to the image reference.png by using a rigid transformation model and ssd as cost function. Write the result to output.png.
mia-2dimageregistration -i moving.png -r reference.png -o output.png -f rigid image:cost=ssd
π«Ά AUTHOR(s) π«Ά
Gert Wollny
π COPYRIGHT π
This software is Copyright (c) 1999β2015 Leipzig, Germany and Madrid, Spain. It comes with ABSOLUTELY NO WARRANTY and you may redistribute it under the terms of the GNU GENERAL PUBLIC LICENSE Version 3 (or later). For more information run the program with the option --copyright.
and that's a wrap bestie, we literally made it to the end of the page π this whole manual is from the USER COMMANDS section, version v2.4.7 of mia-2dimageregistration(1). go register some images, you got this, mwah πβ¨π¦
π¦ where this page comes from
- 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