mia-2dmyoica-nonrigid(1)

๐Ÿ“ฆ
version 2.4.7 ยท 3 versions
, in ubuntu jammy, ubuntu resolute, ubuntu stonking

okay so bestie, this is the mia-2dmyoica-nonrigid(1) page from the General Commands Manual, and it is literally about running a registration of a series of 2D images. buckle up, we're going full main-character energy through every flag, every plugin, every tiny default. no skips. periodt. ๐Ÿ’…โœจ

โœจ NAME โœจ

mia-2dmyoica-nonrigid โ€” Run a registration of a series of 2D images.

๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

mia-2dmyoica-nonrigid -i <in-file> -o <out-file> [options]

๐ŸŒธ DESCRIPTION ๐ŸŒธ

mia-2dmyoica-nonrigid This program implements the motion compensation algorithm described in

Wollny G, Kellman P, Santos A, Ledesma-Carbayo M-J, "Automatic Motion Compensation of Free Breathing acquired Myocardial Perfusion Data by using Independent Component Analysis" Medical Image Analysis, 2012.

so yeah, it's giving motion compensation, and the citation is right there. iconic. ๐Ÿ‘‘


๐Ÿ’– OPTIONS ๐Ÿ’–

๐ŸŽ€ File-IO ๐ŸŽ€

  • -i, --in-file=(input, required); string โ€” input perfusion data set
  • -o, --out-file=(output, required); string โ€” output perfusion data set
  • -r, --registered=reg โ€” file name base for registered fiels
  • --save-cropped= โ€” save cropped set to this file
  • --save-feature= โ€” save the features images resulting from the ICA and some intermediate images used for the RV-LV segmentation with the given file name base to PNG files. Also save the coefficients of the initial best and the final IC mixing matrix.
  • --save-refs= โ€” save synthetic reference images
  • --save-regs= โ€” save intermediate registered images

๐Ÿซถ 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 trace
    • debug โ€ Debug output
    • info โ€ Low level messages
    • message โ€ Normal messages
    • warning โ€ Warnings
    • fail โ€ Report test failures
    • error โ€ Report errors
    • fatal โ€ 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

๐Ÿงš ICA ๐Ÿงš

  • --fastica=internal โ€” FastICA implementationto be used
    • For supported plugins see PLUGINS:fastica/implementation
  • -C, --components=0 โ€” ICA components 0 = automatic estimation
  • --normalize โ€” normalized ICs
  • --no-meanstrip โ€” don't strip the mean from the mixing curves
  • -s, --segscale=0 โ€” segment and scale the crop box around the LV (0=no segmentation)
  • -k, --skip=0 โ€” skip images at the beginning of the series e.g. because as they are of other modalities
  • -m, --max-ica-iter=400 โ€” maximum number of iterations in ICA
  • -E, --segmethod=features โ€” Segmentation method
    • delta-feature โ€ difference of the feature images
    • delta-peak โ€ difference of the peak enhancement images
    • features โ€ feature images
  • -b, --min-breathing-frequency=-1 โ€” minimal mean frequency a mixing curve can have to be considered to stem from brething. A healthy rest breating rate is 12 per minute. A negative value disables the test.

๐ŸŒˆ 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).

๐Ÿ‘‘ Registration ๐Ÿ‘‘

  • -O, --optimizer=gsl:opt=gd,step=0.1 โ€” Optimizer used for minimization
    • For supported plugins see PLUGINS:minimizer/singlecost
  • -R, --refiner= โ€” optimizer used for refinement after the main optimizer was called
    • For supported plugins see PLUGINS:minimizer/singlecost
  • -a, --start-c-rate=16 โ€” start coefficinet rate in spines, gets divided by --c-rate-divider with every pass
  • --c-rate-divider=2 โ€” cofficient rate divider for each pass
  • -d, --start-divcurl=10 โ€” start divcurl weight, gets divided by --divcurl-divider with every pass
  • --divcurl-divider=2 โ€” divcurl weight scaling with each new pass
  • -w, --imagecost=image:weight=1,cost=ssd โ€” image cost
    • For supported plugins see PLUGINS:2dimage/fullcost
  • -l, --mg-levels=3 โ€” multi-resolution levels
  • -P, --passes=5 โ€” registration passes

โญ 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 see PLUGINS:1d/splinekernel
    • rbins = 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
  • 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 difference
      • ds โ€ square of scaled difference
      • dot โ€ scalar product kernel
      • cross โ€ 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 see PLUGINS:2dimage/cost
    • debug = 0; bool โ€” Save intermediate resuts for debugging.
    • ref =(input, io) โ€” Reference image. For supported file types see PLUGINS:2dimage/io
    • src =(input, io) โ€” Study image. For supported file types see PLUGINS:2dimage/io
    • weight = 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 see PLUGINS:2dimage/io
    • src =(input, io) โ€” Study image. For supported file types see PLUGINS:2dimage/io
    • weight = 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 see PLUGINS:2dimage/maskedcost
    • ref =(input, io) โ€” Reference image. For supported file types see PLUGINS:2dimage/io
    • ref-mask =(input, io) โ€” Reference image mask (binary). For supported file types see PLUGINS:2dimage/io
    • src =(input, io) โ€” Study image. For supported file types see PLUGINS:2dimage/io
    • src-mask =(input, io) โ€” Study image mask (binary). For supported file types see PLUGINS:2dimage/io
    • weight = 1; float โ€” weight of cost function.

๐ŸŒˆ PLUGINS: 2dimage/io ๐ŸŽ€

okay so these are all the little io besties โ€” the ones that actually read and write your images. each one has its own vibe, its own file extensions, and its own list of element types it'll fw. let's go ๐Ÿ’…

๐Ÿ–ผ๏ธ bmp

BMP 2D-image input/output support. she reads and writes binary images and 8-bit gray scale images, and she'll do read-only for 4-bit gray scale images. the color table? 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. that's it, that's the whole vibe.

  • Recognized file extensions: .@

๐Ÿฉป dicom

2D image io for DICOM. medical girlies rise ๐Ÿซถ

  • Recognized file extensions: .DCM, .dcm
  • Supported element types:
    • signed 16 bit
    • unsigned 16 bit

โœจ exr

a 2dimage io plugin for OpenEXR images. fancy rendering energy, no cap.

  • 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 said what she said.

  • Recognized file extensions: .JPEG, .JPG, .jpeg, .jpg
  • Supported element types:
    • unsigned 8 bit

๐Ÿฆ‹ png

a 2dimage io plugin for png images. the internet's favorite, honestly iconic.

  • Recognized file extensions: .PNG, .png
  • Supported element types:
    • binary data
    • unsigned 8 bit
    • unsigned 16 bit

๐Ÿงฑ raw

RAW 2D-image output support. note the word output, bestie โ€” read the room, it's giving write-only.

  • 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

like, every single element type? she ate that fr fr ๐Ÿ”ฅ


๐ŸŽž๏ธ tif

TIFF 2D-image input/output support. the workhorse. the main character.

  • 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. yes, her file extension is literally .v and also .V. yes that's chaotic. no we're not discussing it ๐Ÿ’€

  • 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 handle a mask โ€” like, they respect the covered/uncovered pixels, which is very demure, very mindful of them. 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. so the actual window is like, twice this plus one. don't @ me, that's just how it is.

๐Ÿ”ฎ 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 bye weirdo pixels โœ‚๏ธ
  • 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 histogram. for supported plug-ins see PLUGINS:1d/splinekernel.
  • rbins = 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 histogram. for supported plug-ins see PLUGINS:1d/splinekernel.
ngl the default mkernel is [bspline:d=3] and the default rkernel is [bspline:d=0]. they are NOT the same. don't mix them up, bestie, i'm begging ๐Ÿ™ˆ

๐Ÿ“ ncc

normalized cross correlation with masking support.

  • (no parameters)

she's low maintenance. no knobs, no dials, just vibes โœจ


๐Ÿ“‰ ssd

Sum of squared differences with masking.

  • (no parameters)

also zero parameters. also zero drama. ๐Ÿซถ


๐Ÿงš PLUGINS: fastica/implementation ๐Ÿงš

these are the implementations of the FastICA algorithm โ€” like, two different engines, same iconic algorithm. pick your fighter:

๐Ÿ  internal

This is the MIA implementation of the FastICA algorithm.

  • (no parameters)

homegrown, handcrafted, locally sourced ๐Ÿ’…


๐Ÿ“ฆ itpp

This is the IT++ implementation of the FastICA algorithm.

  • (no parameters)

the other one. equally parameterless. equally valid. we love options.

๐Ÿง  PLUGINS: minimizer/singlecost ๐Ÿง 

Bestie, this is where the magic actually happens โ€” the thing that nudges your parameters around until the cost stops screaming. Four minimizers live here, each with its own lil personality and its own dials. Let's get into it ๐Ÿ’…


๐ŸŒˆ gdas โ€” gradient descent w/ automatic step size correction

Old reliable. It goes downhill and fixes its own step size as it goes.

  • ftolr = 0 โ€” double in [0, inf) โ€” Stop if the relative change of the criterion is below.
  • max-step = 2 โ€” double in (0, inf) โ€” 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) โ€” 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 w/ quadratic step estimation

Same vibe as gdas but it estimates the step quadratically instead of just correcting it. Fancier, lowkey.

  • 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 โ€” GNU Scientific Library multimin optimizers

This one's a glow-up: it's a plugin built on top of the multimin optimizers from the GNU Scientific Library (GSL), over at https://www.gnu.org/software/gsl/. Iconic library, no cap.

  • 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 Mead
    • cg-fr โ€” Flecher-Reeves conjugate gradient algorithm
    • cg-pr โ€” Polak-Ribiere conjugate gradient algorithm
    • bfgs โ€” Broyden-Fletcher-Goldfarb-Shann
    • bfgs2 โ€” 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 โ€” minimizers via the NLOPT library

The whole squad of algorithms, fr fr. For a full description of every optimizer go read http://ab-initio.mit.edu/wiki/index.php/NLopt_Algorithms โ€” it's giving encyclopedia, but it's the real tea.

  • 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 Rectangles
    • gn-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 โ€” None
    • ld-lbfgs โ€” Low-storage BFGS
    • ln-praxis โ€” Gradient-free Local Optimization via the Principal-Axis Method
    • ld-var1 โ€” Shifted Limited-Memory Variable-Metric, Rank 1
    • ld-var2 โ€” Shifted Limited-Memory Variable-Metric, Rank 2
    • ld-tnewton โ€” Truncated Newton
    • ld-tnewton-restart โ€” Truncated Newton with steepest-descent restarting
    • ld-tnewton-precond โ€” Preconditioned Truncated Newton
    • ld-tnewton-precond-restart โ€” Preconditioned Truncated Newton with steepest-descent restarting
    • gn-crs2-lm โ€” Controlled Random Search with Local Mutation
    • ld-mma โ€” Method of Moving Asymptotes
    • ln-cobyla โ€” Constrained Optimization BY Linear Approximation
    • ln-newuoa โ€” Derivative-free Unconstrained Optimization by Iteratively Constructed Quadratic Approximation
    • ln-newuoa-bound โ€” Derivative-free Bound-constrained Optimization by Iteratively Constructed Quadratic Approximation
    • ln-neldermead โ€” Nelder-Mead simplex algorithm
    • ln-sbplx โ€” Subplex variant of Nelder-Mead
    • ln-bobyqa โ€” Derivative-free Bound-constrained Optimization
    • gn-isres โ€” Improved Stochastic Ranking Evolution Strategy
    • none โ€” 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 Rectangles
    • gn-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 โ€” None
    • ld-lbfgs โ€” Low-storage BFGS
    • ln-praxis โ€” Gradient-free Local Optimization via the Principal-Axis Method
    • ld-var1 โ€” Shifted Limited-Memory Variable-Metric, Rank 1
    • ld-var2 โ€” Shifted Limited-Memory Variable-Metric, Rank 2
    • ld-tnewton โ€” Truncated Newton
    • ld-tnewton-restart โ€” Truncated Newton with steepest-descent restarting
    • ld-tnewton-precond โ€” Preconditioned Truncated Newton
    • ld-tnewton-precond-restart โ€” Preconditioned Truncated Newton with steepest-descent restarting
    • gn-crs2-lm โ€” Controlled Random Search with Local Mutation
    • ld-mma โ€” Method of Moving Asymptotes
    • ln-cobyla โ€” Constrained Optimization BY Linear Approximation
    • ln-newuoa โ€” Derivative-free Unconstrained Optimization by Iteratively Constructed Quadratic Approximation
    • ln-newuoa-bound โ€” Derivative-free Bound-constrained Optimization by Iteratively Constructed Quadratic Approximation
    • ln-neldermead โ€” Nelder-Mead simplex algorithm
    • ln-sbplx โ€” Subplex variant of Nelder-Mead
    • ln-bobyqa โ€” Derivative-free Bound-constrained Optimization
    • gn-isres โ€” Improved Stochastic Ranking Evolution Strategy
    • auglag โ€” Augmented Lagrangian algorithm
    • auglag-eq โ€” Augmented Lagrangian algorithm with equality constraints only
    • g-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.
๐Ÿซถ friendly reminder that local-opt only matters for the algorithms that need a local optimizer โ€” the g-mlsl and g-mlsl-lds entries literally say so in their own descriptions, iykyk.

โœจ EXAMPLE โœจ

Okay so here's the moment. Register the perfusion series given in segment.set by using automatic ICA estimation. Skip two images at the beginning and otherwiese use the default parameters. Store the result in registered.set.

mia-2dmyoica-nonrigid   -i segment.set -o registered.set -k 2
๐Ÿ’€ note that the manpage really does spell it "otherwiese". I am simply the messenger, bestie, and I refuse to be the one who breaks a legend.

๐Ÿ’œ AUTHOR(s) ๐Ÿ’œ

Gert Wollny


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!! ๐ŸŒธ You just read the whole mia-2dmyoica-nonrigid(1) page, part 3 of 3, and honestly? Slay. It comes from the USER COMMANDS manual section, version v2.4.7, and the page is filed under mia-2dmyoica-nonrigid(1) โ€” no date on the footer, so don't come for me about it ๐Ÿ™ˆ. Go register some hearts, king ๐Ÿ‘‘๐Ÿ’–

๐Ÿ“ฆ where this page comes from