mia-3dserial-nonrigid(1)

πŸ“¦
version 2.4.7 Β· 3 versions
, in ubuntu jammy, ubuntu noble

okay so bestie 🫢 welcome to mia-3dserial-nonrigid, fresh out of section 1 (General Commands Manual), and it's giving ✨serial 3D image registration✨. no cap. let's get into it πŸ’…


πŸ’– NAME πŸ’–

mia-3dserial-nonrigid β€” Serial registration of 3D images. that's the whole name, that's the whole vibe πŸŽ€

✨ SYNOPSIS ✨

mia-3dserial-nonrigid -i <in-file> [options] <PLUGINS:3dimage/fullcost>

🌸 DESCRIPTION 🌸

so like, what does mia-3dserial-nonrigid actually do?? it runs the image registration of a consecutively numbered image series πŸ¦‹

and the way it does it is serial β€” meaning it only registers images that are next to each other in time (i.e. consecutive numbers, iykyk), and then all the transformations it gets are applied accumulated so you reach the full registration. one after another after another, no skipping, periodt πŸ’…


πŸ‘‘ OPTIONS πŸ‘‘

πŸ“ File-IO

  • -i, --in-file=(input, required); string β€” input perfusion data set. required, so like, you literally cannot skip it bestie πŸ™ˆ
  • -o, --out-file=(output); string β€” file name for registered fiels (yes, "fiels" β€” that's what the original says, we keep it fr fr, we don't fix it) 😭

πŸŽ€ Registration

  • -O, --optimizer=gsl:opt=gd,step=0.1 β€” the optimizer used for minimization. for supported plugins see PLUGINS:minimizer/singlecost
  • -l, --mg-levels=3 β€” multi-resolution levels ✨
  • -f, --transForm=spline β€” transformation type. for supported plugins see PLUGINS:3dimage/transform
  • -r, --ref=-1 β€” reference frame (-1 == use image in the middle) πŸ‘‘

🫢 Help & Info

  • -V, --verbose=warning β€” verbosity of output; prints messages of the given level and higher priorities. supported priorities, starting at the 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

βš™οΈ Processing

  • --threads=-1 β€” Maxiumum number of threads to use for processing (typo preserved, bestie, it's part of the lore) πŸ’€. 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 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. 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 difference
      • dot β€” scalar product kernel
      • cross β€” 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 see PLUGINS: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 see PLUGINS:3dimage/io
    • op =(required, factory) β€” Image combiner to be applied to the images. For supported plug-ins see PLUGINS:3dimage/combiner
    • reverse = 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 converting
      • linear β€” apply linear transformation x -> a*x+b
      • range β€” apply linear transformation that maps the input data type range to the output data type range
      • opt β€” apply a linear transformation that maps the real input range to the full output range
      • optstat β€” apply a linear transform that maps based on input mean and variation to the full output range
    • repn = ubyte; dict β€” output pixel type. Supported values are:
      • bit β€” binary data
      • sbyte β€” signed 8 bit
      • ubyte β€” unsigned 8 bit
      • sshort β€” signed 16 bit
      • ushort β€” unsigned 16 bit
      • sint β€” signed 32 bit
      • uint β€” unsigned 32 bit
      • slong β€” signed 64 bit
      • ulong β€” unsigned 64 bit
      • float β€” floating point 32 bit
      • double β€” floating point 64 bit
      • none β€” no pixel type defined
  • crop β€” Crop a region of an image, the region is always clamped to the original image size in the sense that the given range is kept., supported parameters are:
    • end = [[4294967295,4294967295,4294967295]]; streamable β€” end of cropping range, maximum = (-1,-1,-1).
    • start = [[0,0,0]]; streamable β€” begin of cropping range.
  • dilate β€” 3d image stack dilate filter, 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 see PLUGINS:3dimage/shape
  • distance β€” Evaluate the 3D distance transform of an image. If the image is a binary mask, then 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.
    • (no parameters)

downscale ✨

Okay so this one downscales your input image by using a given block size to define the downscale factor. Before it scales, it filters the image with a smoothing filter to kill high-frequency data and dodge aliasing artifacts. No crunchy edges, bestie.

Supported parameters are:

  • 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. The size of the filter is estimated based on the blocksize. For supported plug-ins see PLUGINS:1d/spacialkernel.

erode πŸͺ¨

3d image stack erode filter. It's giving morphological erosion, periodt.

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 see PLUGINS:3dimage/shape.

gauss 🌊

Isotropic 3D gauss filter. Smooth brain? No, smooth image. ✨

Supported parameters are:

  • w = 1; int in [0, inf) β€” filter width parameter.

gradnorm πŸ“

3D image to gradient norm filter.

  • (no parameters) β€” it just does the gradient norm thing, no cap.

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. Region grow, bestie.

Supported parameters are:

  • min = 1; float β€” lower threshold for mask growing.
  • ref =(input, required, io) β€” reference image for mask region growing. For supported file types see PLUGINS:3dimage/io.
  • shape = 6n; factory β€” neighborhood mask. For supported plug-ins see PLUGINS:3dimage/shape.

invert πŸ”ƒ

Intensity invert filter. Flip those values, iconically.

  • (no parameters) β€” no settings, just inversion energy.

isovoxel 🧊

This filter scales an image to make the voxel size isometric and its size to correspond to the given value. Isometric? We love a cube moment.

Supported parameters are:

  • interp = [bspline:d=3]; factory β€” interpolation kernel to be used. For supported plug-ins see PLUGINS: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. Cluster queen.

Supported parameters are:

  • c = 3; int in [2, inf) β€” number of classes.

label 🏷️

A filter to label the connected components of a binary image. Tagging everything like it's a group chat.

Supported parameters are:

  • n = 6n; factory β€” neighborhood mask. For supported plug-ins see PLUGINS:3dimage/shape.

labelmap 🌈

Image filter to remap label id's. Only applicable to images with integer valued intensities/labels. Remap slay.

Supported parameters are:

  • 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 algorithm 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. Voting, but make it labels.

Supported parameters are:

  • out-size =(required, 3dbounds) β€” target size given as two coma separated values.

load πŸ“‚

Load the input image from a file and use it to replace the current image in the pipeline. Hot-swap the image, bestie.

Supported parameters are:

  • file =(input, required, io) β€” name of the input file to load from. For supported file types see PLUGINS:3dimage/io.

lvdownscale πŸ“‰

This is a label voting downscale filter. It downscales 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. Majority vote, but for labels.

Supported parameters are:

  • 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. Mask on, mask off.

Supported parameters are:

  • input =(input, required, io) β€” second input image file name. For supported file types see PLUGINS:3dimage/io.

mean πŸ“Š

3D image mean filter. Average it out, bestie.

Supported parameters are:

  • w = 1; int in [1, inf) β€” half filter width.

median 🎚️

Median 3d filter. The middle child of filters, literally.

Supported parameters are:

  • w = 1; int in [1, inf) β€” filter width parameter.

mlv πŸ”

Mean of Least Variance 3D image filter. MLV said stay calm.

Supported parameters are:

  • w = 1; int in [1, inf) β€” filter width parameter.

msnormalizer βš–οΈ

3D image mean-sigma normalizing filter. Normalize the vibe, periodt.

Supported parameters are:

  • w = 1; int in [1, inf) β€” half filter width.

open πŸͺ·

Morphological open. Opening up the image like a bloom.

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 see PLUGINS:3dimage/shape.

reorient 🧭

3D image reorientation filter. Turn it, flip it, rotate it β€” main character energy.

Supported parameters are:

  • map = xyz; dict β€” orientation mapping to be applied. Supported values are:
    • xyz β€” keep orientation
    • p-yzx β€” permutate x->z->y->x
    • p-zxy β€” permutate x->y->z->x
    • f-yz β€” flip y-z
    • f-xy β€” flip x-y
    • f-xz β€” flip x-z
    • r-x90 β€” rotate around x-axis clockwise 90 degree
    • r-x180 β€” rotate around x-axis clockwise 180 degree
    • r-x270 β€” rotate around x-axis clockwise 270 degree
    • r-y90 β€” rotate around y-axis clockwise 90 degree
    • r-y180 β€” rotate around y-axis clockwise 180 degree
    • r-y270 β€” rotate around y-axis clockwise 270 degree
    • r-z90 β€” rotate around z-axis clockwise 90 degree
    • r-z180 β€” rotate around z-axis clockwise 180 degree
    • r-z270 β€” rotate around z-axis clockwise 270 degree

resize πŸ“

Resize an image. The original data is centered within the new sized image. Center it, bestie.

Supported parameters are:

  • 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. Seasoning the image, but make it noise.

Supported parameters are:

  • 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. Scale it up, scale it down.

Supported parameters are:

  • interp = [bspline:d=3]; factory β€” interpolation kernel to be used. For supported plug-ins see PLUGINS: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. Note that 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. Floating point first, bestie.

Supported parameters are:

  • dir = x; dict β€” Gradient direction. Supported values are:
    • x β€” gradient in x-direction
    • y β€” gradient in y-direction
    • z β€” gradient in z-direction

selectbig πŸ‘‘

A filter that creates a binary mask representing the intensity with the highest pixel count. The pixel value 0 will 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. Undefined? Spooky, but iconic.

  • (no parameters) β€” no settings, just the biggest intensity taking the crown.

sepconv 🧡

3D image intensity separable convolution filter. Separable? We love an efficient queen.

Supported parameters are:

  • kx = [gauss:w=1]; factory β€” filter kernel in x-direction. For supported plug-ins see PLUGINS:1d/spacialkernel.
  • ky = [gauss:w=1]; factory β€” filter kernel in y-direction. For supported plug-ins see PLUGINS:1d/spacialkernel.
  • kz = [gauss:w=1]; factory β€” filter kernel in z-direction. For supported plug-ins see PLUGINS:1d/spacialkernel.

sobel πŸ”Ά

The 2D Sobel filter for gradient evaluation. Note that 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. Same float warning, no cap.

Supported parameters are:

  • dir = x; dict β€” Gradient direction. Supported values are:
    • x β€” gradient in x-direction
    • y β€” gradient in y-direction
    • z β€” gradient in z-direction

sws

Seeded watershed, bestie πŸ’§. This algorithm pulls out exactly as many regions as there are initial labels given in the seed image. Parameters it accepts:

  • grad = 0; bool β€” treat the input image as a gradient.
  • mark = 0; bool β€” mark the segmented watersheds with a special grayscale value.
  • n = [sphere:r=1]; factory β€” neighborhood used for the watershed region growing. For the plug-ins that work here, see PLUGINS:3dimage/shape.
  • seed =(input, required, string) β€” the seed input image, which holds the labels for the initial regions.

tee

Saves your input image to a file and passes it straight through to the next filter. Like, it does both, no tradeoff 🫢. Parameters:

  • file =(output, required, io) β€” name of the output file to save the image to. For the file types that work here, see PLUGINS: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. Heads up though: this implementation only supports the 26 neighbourhood. That's it, that's the whole vibe.

  • (no parameters)

transform

Transforms the input image with whatever transformation you hand it ✨. Parameters:

  • file =(input, required, io) β€” name of the file that contains the transformation. For the file types that work here, see PLUGINS:3dtransform/io.
  • imgboundary = ; factory β€” overrides the image interpolation boundary conditions. For the plug-ins that work here, see PLUGINS:1d/splinebc.
  • imgkernel = ; factory β€” overrides the image interpolator kernel. For the plug-ins that work here, see PLUGINS:1d/splinekernel.

variance

3D image variance filter, periodt. Parameters:

  • w = 1; int in [1, inf) β€” half filter width.

ws

Basic watershed segmentation 🌊, no seed drama. Parameters:

  • evalgrad = 0; bool β€” set this to 1 if your input image is not a gradient norm image.
  • mark = 0; bool β€” mark the segmented watersheds with a special grayscale value.
  • n = [sphere:r=1]; factory β€” neighborhood for the watershed region growing. For the plug-ins that work here, see PLUGINS:3dimage/shape.
  • thresh = 0; float in [0, 1) β€” relative gradient norm threshold. The real threshold value is computed as thresh * (max_grad - min_grad) + min_grad. Basins that are separated by gradients with a lower norm get joined together, iykyk.

🌈 PLUGINS: 3dimage/fullcost 🌈

image

A generalized image similarity cost function that also handles multi-resolution processing πŸͺ„. The actual similarity measure you want gets handed in as an extra parameter. Parameters:

  • cost = ssd; factory β€” the cost function kernel. For the plug-ins that work here, see PLUGINS:3dimage/cost.
  • debug = 0; bool β€” save intermediate results for debugging.
  • ref =(input, io) β€” reference image. For the file types that work here, see PLUGINS:3dimage/io.
  • src =(input, io) β€” study image. For the file types that work here, see PLUGINS:3dimage/io.
  • weight = 1; float β€” weight of the cost function.

labelimage

A similarity cost function that maps labels between two images and handles label-preserving multi-resolution processing 🏷️. Parameters:

  • maxlabel = 256; int in [2, 32000] β€” maximum number of labels to consider.
  • ref =(input, io) β€” reference image. For the file types that work here, see PLUGINS:3dimage/io.
  • src =(input, io) β€” study image. For the file types that work here, see PLUGINS:3dimage/io.
  • weight = 1; float β€” weight of the cost function.

maskedimage

A generalized masked image similarity cost function that also handles multi-resolution processing 🎭. Okay so important: the masks you provide should be densely filled regions in multi-resolution processing, because otherwise the mask info can literally get lost when the image is downscaled. The mask may be pre-filtered β€” and after pre-filtering, the masks must be of bit-type. The reference mask and the transformed mask of the study image are combined with a binary AND. The actual similarity measure gets passed in as an extra parameter. Parameters:

  • cost = ssd; factory β€” cost function kernel. For the plug-ins that work here, see PLUGINS:3dimage/maskedcost.
  • ref =(input, io) β€” reference image. For the file types that work here, see PLUGINS:3dimage/io.
  • ref-mask =(input, io) β€” reference image mask (binary). For the file types that work here, see PLUGINS:3dimage/io.
  • ref-mask-filter = ; factory β€” filter to prepare the reference mask image; the output must be a binary image. For the plug-ins that work here, see PLUGINS:3dimage/filter.
  • src =(input, io) β€” study image. For the file types that work here, see PLUGINS:3dimage/io.
  • src-mask =(input, io) β€” study image mask (binary). For the file types that work here, see PLUGINS:3dimage/io.
  • src-mask-filter = ; factory β€” filter to prepare the study mask image; the output must be a binary image. For the plug-ins that work here, see PLUGINS:3dimage/filter.
  • weight = 1; float β€” weight of the cost function.

taggedssd

Evaluates the Sum of Squared Differences similarity measure using three tagged image pairs πŸ”₯. The cost function value gets evaluated based on all the image pairs, but the gradient is composed by composing its component based on the tag direction. Parameters:

  • refx =(input, io) β€” reference image X-tag. For the file types that work here, see PLUGINS:3dimage/io.
  • refy =(input, io) β€” reference image Y-tag. For the file types that work here, see PLUGINS:3dimage/io.
  • refz =(input, io) β€” reference image Z-tag. For the file types that work here, see PLUGINS:3dimage/io.
  • srcx =(input, io) β€” study image X-tag. For the file types that work here, see PLUGINS:3dimage/io.
  • srcy =(input, io) β€” study image Y-tag. For the file types that work here, see PLUGINS:3dimage/io.
  • srcz =(input, io) β€” study image Z-tag. For the file types that work here, see PLUGINS:3dimage/io.
  • weight = 1; float β€” weight of the cost function.

πŸ’Ύ 3dimage/io β€” the readers & writers bestie πŸ’…

okay so these are literally the plugins that get your images in and out of the program. every one of them has its own lil set of file extensions it vibes with, and its own list of element types it can handle. let's go πŸ¦‹


analyze β€” Analyze 7.5 image

the classic. reads/writes Analyze 7.5 format.

  • 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

no files, no drama β€” it's just IO to and from the internal data pool ✨

  • Recognized file extensions: .@

dicom β€” Dicom image series as 3D

takes a whole Dicom image series and treats it like one 3D image, iconic behavior fr πŸ“Έ

  • 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

like, it does everything. the range πŸ˜­πŸ’–


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

MetaIO 3D image IO using the VTK implementation (experimental).

πŸ§ͺ experimental bestie β€” tread lightly, it's still in its testing era.
  • 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

nifti β€” NIFTI-1 3D image IO

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.

that orientation detail? lowkey important, so don't skip it πŸŽ€

  • 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

vti β€” 3D image VTK-XML in- and output

3D image VTK-XML in- and output (experimental).

πŸ§ͺ experimental again β€” she's cute but she's in beta.
  • 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

vtk β€” 3D VTK image legacy in- and output

3D VTK image legacy in- and output (experimental).

πŸ§ͺ yes bestie, experimental too. the legacy one is serving experimental energy πŸ’€
  • 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

🎯 3dimage/maskedcost β€” cost functions, but with masking

same energy as the regular cost plugins, except these all understand masking 🫢

lncc β€” local normalized cross correlation with masking support.,

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.,

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/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 with masking support.

normalized cross correlation with masking support.

  • (no parameters)

ssd β€” Sum of squared differences with masking.

Sum of squared differences with masking.

  • (no parameters)

πŸ”· 3dimage/shape β€” neighborhoods, but make it geometry

these ones build little 3D shapes to define which pixels count as neighbors ✨

18n β€” 18n neighborhood 3D shape creator

18n neighborhood 3D shape creator

  • (no parameters)

26n β€” 26n neighborhood 3D shape creator

26n neighborhood 3D shape creator

  • (no parameters)

6n β€” 6n neighborhood 3D shape creator

6n neighborhood 3D shape creator

  • (no parameters)

sphere β€” Closed spherical shape neighborhood including the pixels within a given radius r.,

Closed spherical shape neighborhood including the pixels within a given radius r., supported parameters are:

  • r = 2; float in (0, inf) β€” sphere radius.

a whole ball of pixels, obsessed πŸŽ€

🌈 PLUGINS: 3dimage/transform 🌈

Bestie, this is the whole squad of transformation plug-ins β€” every way you can yeet your volume around in space. Each one is basically a different "how many degrees of freedom am I allowed to move" situation. Let's go one by one. πŸ’…


✨ affine ✨

Affine transformation, ok? That's 12 degrees of freedom β€” the full send, no restrictions. Here's what you can tune:

  • imgboundary = mirror; factory β€” the boundary conditions for image interpolation. Wanna know which plug-ins you can slot in here? Peep PLUGINS:1d/splinebc. πŸ‘€
  • imgkernel = [bspline:d=3]; factory β€” the image interpolator kernel, iykyk. Supported plug-ins live in PLUGINS:1d/splinekernel.

✨ axisrot ✨

Restricted rotation transformation, and it's giving 1 degree of freedom. The transformation is locked to rotation around the given axis, about the given rotation center. Params:

  • axis =(required, 3dfvector) β€” the rotation axis. Required, so don't skip it bestie.
  • imgboundary = mirror; factory β€” image interpolation boundary conditions. Supported plug-ins: see PLUGINS:1d/splinebc.
  • imgkernel = [bspline:d=3]; factory β€” the image interpolator kernel. Supported plug-ins: see PLUGINS:1d/splinekernel.
  • origin =(required, 3dfvector) β€” the center of the transformation. Also required!

✨ raffine ✨

Restricted affine transformation, 3 degrees of freedom. The transformation is restricted to rotation around the given axis plus shearing along the two axes perpendicular to that one. Slay, but contained. Params:

  • axis =(required, 3dfvector) β€” the rotation axis.
  • imgboundary = mirror; factory β€” image interpolation boundary conditions. Supported plug-ins: see PLUGINS:1d/splinebc.
  • imgkernel = [bspline:d=3]; factory β€” the image interpolator kernel. Supported plug-ins: see PLUGINS:1d/splinekernel.
  • origin =(required, 3dfvector) β€” the center of the transformation.

✨ rigid ✨

Rigid transformation β€” that's rotation plus translation, six degrees of freedom. No squishing, no stretching, just vibes. Params:

  • imgboundary = mirror; factory β€” image interpolation boundary conditions. Supported plug-ins: see PLUGINS:1d/splinebc.
  • imgkernel = [bspline:d=3]; factory β€” the image interpolator kernel. Supported plug-ins: see PLUGINS:1d/splinekernel.
  • origin = [[0,0,0]]; 3dfvector β€” the relative rotation center. So like, <0.5,0.5,0.5> corresponds to the center of the volume. 🎯

✨ rotation ✨

Rotation transformation, three degrees of freedom. Spinning, periodt. Params:

  • imgboundary = mirror; factory β€” image interpolation boundary conditions. Supported plug-ins: see PLUGINS:1d/splinebc.
  • imgkernel = [bspline:d=3]; factory β€” the image interpolator kernel. Supported plug-ins: see PLUGINS:1d/splinekernel.
  • origin = [[0,0,0]]; 3dfvector β€” the relative rotation center, i.e. <0.5,0.5,0.5> corresponds to the center of the volume. πŸŒ€

✨ rotbend ✨

Restricted transformation, 4 degrees of freedom. The transformation is restricted to rotation around the x and y axes plus a bending along the x axis, independent in each direction, with the bending increasing with the squared distance from the rotation axis. It's giving ✨gentle curve energy✨. Params:

  • imgboundary = mirror; factory β€” image interpolation boundary conditions. Supported plug-ins: see PLUGINS:1d/splinebc.
  • imgkernel = [bspline:d=3]; factory β€” the image interpolator kernel. Supported plug-ins: see PLUGINS:1d/splinekernel.
  • norot = 0; bool β€” set it so we don't optimize the rotation.
  • origin =(required, 3dfvector) β€” the center of the transformation.

✨ spline ✨

Free-form transformation that can be described by a set of B-spline coefficients and an underlying B-spline kernel. This is the main character of transformations ngl. Params:

  • anisorate = [[0,0,0]]; 3dfvector β€” anisotropic coefficient rate in pixels. Heads up: nonpositive values will be overwritten by the rate value. πŸ™ˆ
  • debug = 0; bool β€” enable additional debugging output.
  • imgboundary = mirror; factory β€” image interpolation boundary conditions. Supported plug-ins: see PLUGINS:1d/splinebc.
  • imgkernel = [bspline:d=3]; factory β€” the image interpolator kernel. Supported plug-ins: see PLUGINS:1d/splinekernel.
  • kernel = [bspline:d=3]; factory β€” the transformation spline kernel. Supported plug-ins: see PLUGINS:1d/splinekernel.
  • penalty = ; factory β€” the transformation penalty energy term. Supported plug-ins: see PLUGINS:3dtransform/splinepenalty.
  • rate = 10; float in [1, inf) β€” isotropic coefficient rate in pixels.

✨ translate ✨

Translation, three degrees of freedom. Just moving, no rotating, no nothing. Params:

  • imgboundary = mirror; factory β€” image interpolation boundary conditions. Supported plug-ins: see PLUGINS:1d/splinebc.
  • imgkernel = [bspline:d=3]; factory β€” the image interpolator kernel. 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 bestie, a whole translation field. πŸ’« Params:

  • imgboundary = mirror; factory β€” image interpolation boundary conditions. Supported plug-ins: see PLUGINS:1d/splinebc.
  • imgkernel = [bspline:d=3]; factory β€” the image interpolator kernel. Supported plug-ins: see PLUGINS:1d/splinekernel.

πŸ¦‹ PLUGINS: 3dtransform/io πŸ¦‹

The plug-ins that handle reading and writing your 3D transformations. Pick your format, bestie. πŸ“

✨ bbs ✨

Binary (non-portable) serialized IO of 3D transformations.

Non-portable, so don't expect this file to travel cute between machines. πŸ’€

Recognized file extensions: .bbs

✨ datapool ✨

Virtual IO to and from the internal data pool.

Recognized file extensions: .@

✨ vista ✨

Vista storage of 3D transformations.

Recognized file extensions: .v, .v3dt

✨ xml ✨

XML serialized IO of 3D transformations.

Recognized file extensions: .x3dt


πŸŽ€ PLUGINS: 3dtransform/splinepenalty πŸŽ€

Penalty terms for your transformations β€” basically the "chill out, don't be too chaotic" energy. 🧚

✨ divcurl ✨

divcurl penalty on the transformation. Params, bestie:

  • curl = 1; float in [0, inf) β€” penalty weight on curl.
  • div = 1; float in [0, inf) β€” penalty weight on divergence.
  • norm = 0; bool β€” set it to 1 if the penalty should be normalized with respect to the image size.
  • weight = 1; float in (0, inf) β€” weight of penalty energy.

✨ PLUGINS: minimizer/singlecost ✨

okay bestie, this is the minimizer corner of the plugin world β€” the lil algorithms that actually go hunting for the minimum of your cost function. four of them, all with their own vibe πŸ’…


🌸 gdas

Gradient descent with automatic step size correction. it just… walks downhill and fixes its own step as it goes. parameters:

  • ftolr = 0; double in [0, inf) β€” stop if the relative change of the criterion is below.. (yes, with the double period, that's just how she talks πŸ’–)
  • 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 with quadratic step estimation. she's doing math to guess the step instead of vibing it. parameters:

  • 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/. certified classic, no cap. parameters:

  • 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

Minimizer algorithms using the NLOPT library. for a description of the optimizers please see 'http://ab-initio.mit.edu/wiki/index.php/NLopt_Algorithms'. yes that URL is http and yes it's long, we don't make the rules. parameters:

  • 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.

🌈 EXAMPLE 🌈

Run a serial registration of images inputXXXX.v (X digit) to reference image 20 and store the result in regXXXX.v. Optimize the sum of squared differences and spline transformations with coefficient rate 10.

mia-3dserial-nonrigid -i input0000.v -o 'reg%04d.v' -f spline:rate=10 -r
       20 ssd

πŸ‘‘ 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 the whole page bestie, you made it to the end πŸŽ€πŸ’– the version on this one is v2.4.7 and the manpage date/attribution lives under USER COMMANDS for mia-3dserial-nonrigid(1) β€” go register something iconic, you ate fr fr πŸ’…βœ¨

πŸ“¦ where this page comes from