mia-2dseri...oothgradMAD(1)
โจ mia-2dseriessmoothgradMAD(1) โจ
General Commands Manual โ yes bestie, that's the whole name, we don't abbreviate around here ๐
okay so. sit down, grab a strawberry, because this page is A LOT and I am going to walk you through every single crumb of it. no cap. ๐ธ
๐ NAME ๐
mia-2dseriessmoothgradMAD โ evaluate the pixel-wise time-intensity gradient of a 2D image series. that's the vibe. that's the whole job. ๐ซถ
๐ฆ SYNOPSIS ๐ฆ
mia-2dseriessmoothgradMAD -i <in-file> -o <out-file> [options]
<PLUGINS:2dimage/filter>
๐ DESCRIPTION ๐
so like, picture this: you hand it a bunch of images that are a temporal succession โ a lil movie, a series, a glow-up over time ๐ฌ โ and it goes and evaluates the temporal pixel-wise gaussian on them, and then evaluates pixel-wise its MAD.
and oh? you want more control? a spacial pre-filtering may be applied by specifying additional plugins (filter/2dimage). iconic. literally doing the most for you.
๐ OPTIONS ๐
-i,--in-file(input, required); stringโ the input segmentation set. yes bestie, it's required, don't come to the function without it ๐-o,--out-file(output, required); ioโ output file name. for supported file types seePLUGINS:2dimage/io. also required, also mandatory, also no skipping โจ-k,--skip=0โ skip files at the beginning. just, like, walk past them ๐-e,--enlarge-boundary=5โ enlarge the cropbox by this number of pixels.-c,--cropโ crop the image before running statistics. tidy.-g,--gauss=1โ gauss filter width for smoothing the gradient.
๐ 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. bye bestie ๐
๐ง 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). let it cook. ๐ฅ
ngl the spelling "Maxiumum" is in the original and I am not touching it. it's canon now. ๐
๐ฅ 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/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/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: 2dimage/filter ๐ (the big one, bestie)
adaptmedโ 2D image adaptive median filter, supported parameters are:w = 2; int in [1, inf)โ half filter width.
admeanโ an adaptive mean filter that works like a normal mean filter, if the intensity variation within the filter mask is lower then the intensity variation in the whole image, that the uses a special formula if the local variation is higher then the image intensity variation., supported parameters are:w = 1; int in [1, inf)โ half filter width.
anisoโ 2D Anisotropic image filter, supported parameters are:epsilon = 1; float in (0, inf)โ iteration change threshold.iter = 100; int in [1, 10000]โ number of iterations.k = -1; float in [0, 100]โ k the noise threshold (<=0-> adaptive).n = 8; setโ neighbourhood. Supported values are:( 4, 8, )psi = tuckey; dictโ edge stopping function. Supported values are:tuckeyโ tukey stopping functionpm1โ stopping function 1guessโ test stopping functionpm2โ stopping function 2
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; setโ a hint at the main image content. Supported values are:( black, white, )shape = [sphere:r=2]; factoryโ structuring element. For supported plug-ins seePLUGINS:2dimage/shape
combinerโ combine two images with the given combiner operator. if 'reverse' is set to false, the first operator is the image passed through the filter pipeline, and the second image is loaded from the file given with the 'image' parameter the moment the filter is run., supported parameters are:image=(input, required, io)โ second image that is needed in the combiner. For supported file types seePLUGINS:2dimage/ioop=(required, factory)โ Image combiner to be applied to the images. For supported plug-ins seePLUGINS:2dimage/combinerreverse = 0; boolโ reverse the order in which the images passed to the combiner.
convertโ image pixel format conversion filter, supported parameters are:a = 1; floatโ linear conversion parameter a.b = 0; floatโ linear conversion parameter b.map = opt; dictโ conversion mapping. Supported values are:copyโ copy data when convertinglinearโ apply linear transformationx -> a*x+brangeโ apply linear transformation that maps the input data type range to the output data type rangeoptโ apply a linear transformation that maps the real input range to the full output rangeoptstatโ apply a linear transform that maps based on input mean and variation to the full output range
repn = ubyte; dictโ output pixel type. Supported values are:bitโ binary datasbyteโ signed 8 bitubyteโ unsigned 8 bitsshortโ signed 16 bitushortโ unsigned 16 bitsintโ signed 32 bituintโ unsigned 32 bitslongโ signed 64 bitulongโ unsigned 64 bitfloatโ floating point 32 bitdoubleโ floating point 64 bitnoneโ no pixel type defined
cropโ Crop a region of an image, the region is always clamped to the original image size., supported parameters are:end = [[-1,-1]]; streamableโ end of crop region.start = [[0,0]]; streamableโ start of crop region.
dilateโ 2d image stack dilate filter, supported parameters are:hint = black; setโ a hint at the main image content. Supported values are:( black, white, )shape = [sphere:r=2]; factoryโ structuring element. For supported plug-ins seePLUGINS:2dimage/shape
distanceโ 2D image distance filter, evaluates the distance map for a binary mask.- (no parameters)
downscaleโ Downscale the input image by using a given block size to define the downscale factor. Prior to scaling the image is filtered by a smoothing filter to eliminate high frequency data and avoid aliasing artifacts., supported parameters are:b = [[1,1]]; 2dboundsโ blocksize.bx = 1; uint in [1, inf)โ blocksize in x direction.by = 1; uint in [1, inf)โ blocksize in y 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 seePLUGINS:1d/spacialkernel
erodeโ 2d image stack erode filter, supported parameters are:hint = black; setโ a hint at the main image content. Supported values are:( black, white, )shape = [sphere:r=2]; factoryโ structuring element. For supported plug-ins seePLUGINS:2dimage/shape
gaussโ isotropic 2D gauss filter, supported parameters are:w = 1; int in [0, inf)โ filter width parameter.
gradnormโ 2D image to gradient norm filter, supported parameters are:normalize = 0; boolโ Normalize the gradient norms to range[0,1]..
invertโ intensity invert filter- (no parameters)
kmeansโ 2D 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., supported parameters are:c = 3; int in [2, inf)โ number of classes.
labelโ Label connected components in a binary 2D image., supported parameters are:n = 4n; factoryโ Neighborhood mask to describe connectivity.. For supported plug-ins seePLUGINS:2dimage/shape
๐ labelmap ๐
Image filter that remaps label id's โ so basically a glow-up for your labels โจ but heads up bestie, it only works on images with integer valued intensities/labels. Supported parameters are:
map =(input, required, string)โ the label mapping file, periodt.
๐ธ labelscale ๐ธ
A filter that only creates output voxels that already exist in the input image. The scaling is done via a voting algorithm โ it picks the target pixel value based on the highest pixel count of a certain label in the corresponding source region. And if the region has two labels with the same count?? ๐ญ bestie the one with the lower number wins. Supported parameters are:
out-size =(required, 2dbounds)โ target size, given as two comma separated values.
๐ฆ load ๐ฆ
Loads the input image from a file and uses it to replace the current image in the pipeline, iykyk. Supported parameters are:
file =(input, required, io)โ name of the input file to load from. For supported file types see PLUGINS:2dimage/io.
๐ mask ๐
2D masking, and no cap: one of the two input images must be of type bit. Supported parameters are:
fill = min; dictโ fill style for pixels outside of the mask. Supported values are:minโ set values outside the mask to the minimum value found in the image.zeroโ set the values outside the mask to zero.maxโ set the values outside the mask to the maximum value found in the image.
input =(input, required, io)โ second input image file name. For supported file types see PLUGINS:2dimage/io.inverse = 0; boolโ set totrueto use the inverse of the mask for masking.
โญ maxflow โญ
This filter implements the... uses the max-flow min-cut algorithm for image segmentation. Supported parameters are:
sink-flow =(input, required, io)โ image offloattype to define the per-pixel flow to the sink. For supported file types see PLUGINS:2dimage/io.source-flow =(input, required, io)โ image offloattype to define the per-pixel flow to the source. For supported file types see PLUGINS:2dimage/io.
๐ mean ๐
2D image mean filter, so cozy fr. Supported parameters are:
w = 1; int in [1, inf)โ half filter width.
๐ฅ meanvar ๐ฅ
Filter that evaluates simultaneously the pixel wise mean and the variance of an image in a given window. Pixel intensities below the given threshold get ignored, and at their locations the output mean and variation are set to zero. The mean intensity image is passed directly as a float image to the pipeline, and the variation image is saved to a file given with the varfile parameter. Supported parameters are:
thresh = 0; double in [0, inf)โ intensity thresholding parameter: pixels with intensities below this threshold get set to zero, and also aren't used when evaluating mean and variation.varfile =(output, required, io)โ name of the output file to save the variation image to. For supported file types see PLUGINS:2dimage/io.w = 1; uint in [1, inf)โ filter width parameter.
๐ median ๐
2D image median filter, the icon it is. Supported parameters are:
w = 1; int in [1, inf)โ half filter width.
๐ medianmad ๐
Filter that evaluates simultaneously the pixel wise median and the median absolute deviation (MAD) of an image in a given window. Pixel intensities below the given threshold get ignored, and at their locations the output median and MAD get set to zero. The median intensity image is passed directly to the pipeline, and the variation image is saved to a file given with the varfile parameter. Both output images have the same pixel type as the input image. Supported parameters are:
madfile =(output, required, io)โ name of the output file to save the median absolute deviation image to. For supported file types see PLUGINS:2dimage/io.thresh = 0; double in [0, inf)โ intensity thresholding parameter: pixels with intensities below this threshold get set to zero, and also aren't used when evaluating mean and variation.w = 1; uint in [1, inf)โ filter width parameter.
๐ง mlv ๐ง
Mean of Least Variance 2D image filter. Supported parameters are:
w = 1; int in [1, inf)โ filter width parameter.
โจ ngfnorm โจ
2D image to normalized-gradient-field-norm filter. Like, that's the whole vibe:
(no parameters)
๐ noise ๐
2D image noise filter: adds additive or modulated noise to an image. Supported parameters are:
g = [gauss:mu=0,sigma=10]; factoryโ noise generator. For supported plug-ins see PLUGINS:generator/noise.mod = 0; boolโ additive or modulated noise.
๐ซถ open ๐ซถ
Morphological open, slay. Supported parameters are:
hint = black; setโ a hint at the main image content. Supported values are: (black,white, ).shape = [sphere:r=2]; factoryโ structuring element. For supported plug-ins see PLUGINS:2dimage/shape.
๐
pruning ๐
Morphological pruning. Heads up: pruning until convergence will erase all pixels but closed loops. Supported parameters are:
iter = 0; int in [1, 1000000]โ number of iterations to run, with0meaning until convergence.
๐ธ regiongrow ๐ธ
Region growing, starting from a seed until... only along increasing gradients. Supported parameters are:
n = 8n; factoryโ neighborhood shape. For supported plug-ins see PLUGINS:2dimage/shape.seed =(input, required, io)โ seed image (bit valued). For supported file types see PLUGINS:2dimage/io.
๐ sandp ๐
salt and pepper 3d filter. Supported parameters are:
thresh = 100; float in (0, inf)โ thresh value.w = 1; int in [1, inf)โ filter width parameter.
๐ฆ scale ๐ฆ
2D image downscale filter. Supported parameters are:
interp = [bspline:d=3]; factoryโ interpolation method to be used. For supported plug-ins see PLUGINS:1d/splinekernel.s = [[0,0]]; 2dboundsโ target size as 2D vector.sx = 0; uint in [0, inf)โ target size in x direction, where0means use input size.sy = 0; uint in [0, inf)โ target size in y direction, where0means use input size.
โญ selectbig โญ
2D label select biggest component filter, no notes needed:
(no parameters)
๐ฅ sepconv ๐ฅ
2D image intensity separable convolution filter. 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.
๐ shmean ๐
2D image filter that evaluates the mean over a given neighborhood shape. Supported parameters are:
shape = 8n; factoryโ neighborhood shape to evaluate the mean. For supported plug-ins see PLUGINS:2dimage/shape.
๐ sobel ๐
The 2D Sobel filter for gradient evaluation. Important though bestie: the output pixel type of the filtered image is the same as the input pixel type, so converting the input beforehand to a floating point valued image is recommendable, fr fr. Supported parameters are:
dir = x; dictโ gradient direction. Supported values are:xโ gradient in x-direction.yโ gradient in y-direction.
๐ sort-label ๐
This plug-in sorts the labels of a gray-scale image so that the lowest label value corresponds to the label with the most pixels. The background (0) is not touched. That's it:
(no parameters)
๐ง sws ๐ง
seeded watershed. The algorithm extracts exactly as many regions as initial labels are given in the seed image. Supported parameters are:
grad = 0; boolโ interpret the input image as gradient.mark = 0; boolโ mark the segmented watersheds with a special gray scale value.n = [sphere:r=1]; factoryโ neighborhood for watershed region growing. For supported plug-ins see PLUGINS:2dimage/shape.seed =(input, required, string)โ seed input image containing the labels for the initial regions.
๐ tee ๐
Saves the input image to a file and also passes it through to the next filter. Supported parameters are:
file =(output, required, io)โ name of the output file to save the image to. For supported file types see PLUGINS:2dimage/io.
โจ thinning โจ
Morphological thinning. Thinning until convergence will result in a 8-connected skeleton. Supported parameters are:
iter = 0; int in [1, 1000000]โ number of iterations to run, with0meaning until convergence.
๐
thresh ๐
This filter sets all pixels of an image to zero that fall below a certain threshold, and whose neighbours in a given neighborhood shape also fall below this threshold. Supported parameters are:
shape = 4n; factoryโ neighborhood shape to take into account. For supported plug-ins see PLUGINS:2dimage/shape.thresh = 5; doubleโ the threshold value.tmeanโ a 2D image thresholded tmean filter ๐ okay so listen: the output pixel value is zero if the input pixel value is below the given threshold. Otherwise? The pixels in the evaluation windows only count if their input pixel intensity is above the threshold. It's giving picky, but in a good way โจ Here's what you can tweak:t = 0; floatโ the threshold, bestie. Pixels below it don't get taken into account. Periodt.w = 1; int in [1, inf)โ the half filter width ๐
transformโ transforms the input image with the transformation you hand it, no questions asked ๐ซ supported parameters are literally just this one:file =(input, required, io)โ the name of the file holding the transformation. For the file types that are actually supported, go peek at PLUGINS:2dtransform/io ๐ฆ
wsโ basic watershead segmentation ๐ (yes it's spelled like that, iykyk). Supported parameters:evalgrad = 0; boolโ set this to1if your input image does not represent a gradient norm image. Just saying.mark = 0; boolโ set to1and it marks the segmented watersheds with a special gray scale value ๐n = [sphere:r=1]; factoryโ the neighborhood used for watershead region growing. For the plug-ins that work here, see PLUGINS:2dimage/shape ๐ธthresh = 0; float in [0, 1)โ relative gradient norm threshold, okurrr. The actual threshold value isthresh * (max_grad - min_grad) + min_grad. Bassins separated by gradients with a lower norm will be joined. That's just facts ๐
๐ PLUGINS: 2dimage/io ๐
All the ways to read and write your 2D images, bestie. Choose your fighter:
bmpโ BMP 2D-image input/output support ๐ This plug-in reads and writes binary images and 8-bit gray scale images. Read-only support is provided for 4-bit gray scale images. The color table is ignored and the pixel values are taken as literal gray scale values. No cap.- Recognized file extensions:
.BMP,.bmp - Supported element types: binary data, unsigned 8 bit
- Recognized file extensions:
datapoolโ Virtual IO to and from the internal data pool ๐ซง- Recognized file extensions:
.@
- Recognized file extensions:
dicomโ 2D image io for DICOM ๐ฉป- Recognized file extensions:
.DCM,.dcm - Supported element types: signed 16 bit, unsigned 16 bit
- Recognized file extensions:
exrโ a 2dimage io plugin for OpenEXR images โจ- Recognized file extensions:
.EXR,.exr - Supported element types: unsigned 32 bit, floating point 32 bit
- Recognized file extensions:
jpgโ a 2dimage io plugin for jpeg gray scale images ๐ธ- Recognized file extensions:
.JPEG,.JPG,.jpeg,.jpg - Supported element types: unsigned 8 bit
- Recognized file extensions:
pngโ a 2dimage io plugin for png images ๐- Recognized file extensions:
.PNG,.png - Supported element types: binary data, unsigned 8 bit, unsigned 16 bit
- Recognized file extensions:
rawโ RAW 2D-image output support ๐- 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
- Recognized file extensions:
tifโ TIFF 2D-image input/output support ๐ธ- Recognized file extensions:
.TIF,.TIFF,.tif,.tiff - Supported element types: binary data, unsigned 8 bit, unsigned 16 bit, unsigned 32 bit
- Recognized file extensions:
vistaโ a 2dimage io plugin for vista images ๐ฆ- 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
- Recognized file extensions:
๐ง PLUGINS: 2dimage/shape ๐ง
Shapes for your kernels and neighborhoods, because a girl needs options:
1nโ a shape that only contains the central point ๐ฏ- (no parameters) โ yeah, nothing to configure, it's minimalism
4nโ 4n neighborhood 2D shape ๐- (no parameters)
8nโ 8n neighborhood 2D shape โญ- (no parameters)
rectangleโ rectangle shape mask creator, supported parameters are:fill = 1; boolโ create a filled shape ๐height = 2; int in [1, inf)โ height of rectangle ๐width = 2; int in [1, inf)โ width of rectangle ๐
sphereโ closed spherical neighborhood shape of radiusr. Supported parameters are:r = 2; float in (0, inf)โ sphere radius ๐ฎ
squareโ square shape mask creator, supported parameters are:fill = 1; boolโ create a filled shape โwidth = 2; int in [1, inf)โ width of rectangle ๐ (yes, it says rectangle, we don't make the rules)
๐ PLUGINS: 2dtransform/io ๐
Ways to save and load your 2D transformations:
bbsโ Binary (non-portable) serialized IO of 2D transformations โ ๏ธ non-portable, so don't go shipping these files around like they're universal, bestie.- Recognized file extensions:
.bbs
- Recognized file extensions:
datapoolโ Virtual IO to and from the internal data pool ๐ซง- Recognized file extensions:
.@
- Recognized file extensions:
vistaโ Vista storage of 2D transformations ๐ฆ- Recognized file extensions:
.v2dt
- Recognized file extensions:
xmlโ XML serialized IO of 2D transformations ๐ท๏ธ- Recognized file extensions:
.x2dt
- Recognized file extensions:
๐ฅ PLUGINS: generator/noise ๐ฅ
Randomness, but make it fashion:
gaussโ this noise generator creates random values that are distributed according to a Gaussien distribution by using the Box-Muller transformation ๐ง โจ supported parameters are:mu = 0; floatโ mean of distribution.seed = 0; uint in [0, inf)โ set random seed (0= init based on system time) โฐsigma = 1; float in (0, inf)โ standard derivation of distribution.
uniformโ uniform noise generator using C stdlibrand()๐ฒ supported parameters are:a = 0; floatโ lower bound if noise range.b = 1; floatโ higher bound if noise range.seed = 0; uint in [0, inf)โ set random seed (0= init based on system time) โฐ
โจ EXAMPLE โจ
Okay so this is the moment. We wanna evaluate the MAD-image of the bounding box surrounding the segmentation from a series segment.set after applying a temporal Gaussian filter of width 5 ๐ No spacial filtering will be applied, okay? The bounding box will be enlarged by 3 pixels in all directions. And we store the image in OpenEXR format ๐
mia-2dseriessmoothgradMAD -i segment.set -o mad.exr -g 2 -c -e 3
๐ AUTHOR(s) ๐
Gert Wollny ๐ the icon, the moment, the legend.
๐ 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 on this one, bestie ๐ซถ it's USER COMMANDS, version v2.4.7, and the page date is mia-2dseri...oothgradMAD(1) โ go read it again if you need to, mwah ๐
๐ฆ where this page comes from
- ubuntu resolute: mia-tools 2.4.7-18 ยท GPL-3.0-or-later
- ubuntu stonking: mia-tools 2.4.7-19build1 ยท GPL-3.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms