mia-2dstackfilter(1)
π mia-2dstackfilter π
okay so bestie, welcome to mia-2dstackfilter, straight out of the General Commands Manual (section 1, she's legit π
). This is the tool you call when you've got a big ol' pile of 2D images and you want them treated like one 3D volume, no cap. Buckle up, we're going in πΈ
β¨ NAME β¨
mia-2dstackfilter β filter a whole series of 2D images in a 3D fashion π¦
β¨ SYNOPSIS β¨
mia-2dstackfilter -i <in-file> -o <out-file> -t <type> [options]
<PLUGINS:2dstack/filter>
β¨ DESCRIPTION β¨
So mia-2dstackfilter is literally built to filter and convert a whole series of 2D gray scale images in a 3D fashion π β the way it does that is by running filters (filter/2dimage) that you hand it right there on the command line. You say which filter, she runs it across the stack, periodt.
β¨ OPTIONS β¨
-i,--in-file=(input, required); io β the input image(s) that are gonna get filtered. Want the tea on which file types play nice? SeePLUGINS:2dimage/ioπ«Ά-o,--out-file=(output, required); io β the output file name base. Fr fr, the actual names get built by slapping the file number on there (based on output order) plus the extension (based on thetypeparameter). File types again βPLUGINS:2dimage/io-t,--type=(required); set β the output file type. The supported values are giving very much range:-,@,BMP,DCM,EXR,JPEG,JPG,PNG,RAW,TIF,TIFF,V,VISTA,bmp,dcm,exr,jpeg,jpg,png,raw,tif,tiff,v,vistaβ¨
π Help & Info π
-V,--verbose=warningβ how chatty do you want her to be? She prints messages of the given level and higher priorities. The supported priorities, starting at the lowest level, are:traceβ Function call tracedebugβ Debug outputinfoβ Low level messagesmessageβ Normal messageswarningβ Warningsfailβ Report test failureserrorβ Report errorsfatalβ Report only fatal errors
--copyrightβ prints the copyright info π-h,--helpβ prints this help-?,--usageβ prints a short help--versionβ prints the version number and dips out, exit stage left π
π§ Processing π§
--threads=-1β the maximum number of threads to use for processing. This number should be lower or equal to the number of logical processor cores in your machine (-1means automatic estimation, she'll figure it out herself π ).
π PLUGINS: 1d/spacialkernel π
cdiffβ Central difference filter kernel, and mirror boundary conditions are used. She has:- (no parameters)
gaussβ spacial Gauss filter kernel, and the 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, and the supported parameters are:d = 3; int in [0, 5]β Spline degree.
omomsβ OMoms-spline kernel creation, and the 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 π
adaptmedβ 2D image adaptive median filter, and the 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 than the intensity variation in the whole image, but then she uses a special formula if the local variation is higher than the image intensity variation. The supported parameters are:w = 1; int in [1, inf)β half filter width.
anisoβ 2D Anisotropic image filter, and the 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. The supported values are: (4,8)psi = tuckey; dictβ edge stopping function. The supported values are:tuckeyβ tukey stopping functionpm1β stopping function 1guessβ test stopping functionpm2β stopping function 2
bandpassβ intensity bandpass filter, and the supported parameters are:max = 3.40282e+38; floatβ maximum of the band.min = 0; floatβ minimum of the band.
binarizeβ image binarize filter, and the supported parameters are:max = 3.40282e+38; floatβ maximum of accepted range.min = 0; floatβ minimum of accepted range.
closeβ morphological close, and the supported parameters are:hint = black; setβ a hint at the main image content. The 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. Ifreverseis set tofalse, the first operator is the image passed through the filter pipeline, and the second image is loaded from the file given with theimageparameter the moment the filter is run. The 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, and the supported parameters are:a = 1; floatβ linear conversion parameter a.b = 0; floatβ linear conversion parameter b.map = opt; dictβ conversion mapping. The 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. The 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, and the region is always clamped to the original image size, bestie, she will not go out of bounds π. The 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, and the supported parameters are:hint = black; setβ a hint at the main image content. The 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 gets filtered by a smoothing filter to eliminate high frequency data and dodge those aliasing artifacts β¨. The 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, and the size of the filter is estimated based on the blocksize. For supported plug-ins seePLUGINS:1d/spacialkernel
erodeβ 2d image stack erode filter, and the supported parameters are:hint = black; setβ a hint at the main image content. The supported values are: (black,white)shape = [sphere:r=2]; factoryβ structuring element. For supported plug-ins seePLUGINS:2dimage/shape
gaussβ isotropic 2D gauss filter, and the supported parameters are:w = 1; int in [0, inf)β filter width parameter.
gradnormβ 2D image to gradient norm filter, and the 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 an attribute in the image. The supported parameters are:c = 3; int in [2, inf)β number of classes.
labelβ label connected components in a binary 2D image. The supported parameters are:n = 4n; factoryβ Neighborhood mask to describe connectivity. For supported plug-ins seePLUGINS:2dimage/shape
π·οΈ labelmap
An image filter that remaps label id's, bestie. Only applicable to images with integer valued intensities/labels, so don't try this on your float pics, it's giving not for you π. 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 algorithms 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 β lowest number takes the crown π. Supported parameters are:
out-size =(required, 2dbounds)β 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. Supported parameters are:
file =(input, required, io)β name of the input file to load from. For supported file types seePLUGINS:2dimage/io
π mask
2D masking, one of the two input images must by 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 seePLUGINS:2dimage/ioinverse = 0; boolβ set to true to use the inverse of the mask for masking.
π maxflow
This filter implements the uses the max-flow min-cut algorithmfor image segmentation. Supported parameters are:
sink-flow =(input, required, io)β Image of float type to define the per-pixel flow to the sink. For supported file types seePLUGINS:2dimage/iosource-flow =(input, required, io)β Image of float type to define the per-pixel flow to the source. For supported file types seePLUGINS:2dimage/io
π«§ mean
2D image mean filter. Supported parameters are:
w = 1; int in [1, inf)β half filter width.
π’ meanvar
Filter that evaluates simultaniously the pixel wise mean and the variance of an image in a given window. Pixel intensities below the given threshold will be ignored and at their loctions the output mean and variation are set to zero. The mean intensity image is directly passed as float image to the pipeline, 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 will be set to zero, and also not used when evaluating mean and variation.varfile =(output, required, io)β name of the output file to save the variation image too. For supported file types seePLUGINS:2dimage/iow = 1; uint in [1, inf)β filter width parameter.
π― median
2D image median filter. Supported parameters are:
w = 1; int in [1, inf)β half filter width.
π« medianmad
Filter that evaluates simultaniously the pixel wise median and the median absolute deviation (MAD) of an image in a given window. Pixel intensities below the given threshold will be ignored and at their loctions the output median and MAD are set to zero. The median intensity image is directly passed to the pipeline, the variation image is saved to a file given with the varfile parameter. Both output images have the same pixel type like the input image. Supported parameters are:
madfile =(output, required, io)β name of the output file to save the median absolute deviation image too. For supported file types seePLUGINS:2dimage/iothresh = 0; double in [0, inf)β Intensity thresholding parameter: Pixels with intensities below this threshold will be set to zero, and also not 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-gradiend-field-norm filter.
- (no parameters)
Absolutely zero knobs to turn, it's self care π§
π» noise
2D image noise filter: add additive or modulated noise to an image. Supported parameters are:
g = [gauss:mu=0,sigma=10]; factoryβ noise generator. For supported plug-ins seePLUGINS:generator/noisemod = 0; boolβ additive or modulated noise.
πΈ open
morphological open. 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
βοΈ pruning
Morphological pruning. Pruning until convergence will erase all pixels but closed loops β yeah everything else gets deleted, no cap π. Supported parameters are:
iter = 0; int in [1, 1000000]β Number of iterations to run, 0=until convergence.
π± regiongrow
Region growing startin from a seed until only along increasing gradients. Supported parameters are:
n = 8n; factoryβ Neighborhood shape. For supported plug-ins seePLUGINS:2dimage/shapeseed =(input, required, io)β seed image (bit valued). For supported file types seePLUGINS: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 seePLUGINS:1d/splinekernels = [[0,0]]; 2dboundsβ target size as 2D vector.sx = 0; uint in [0, inf)β target size in x direction, 0: use input size.sy = 0; uint in [0, inf)β target size in y direction, 0: use input size.
π selectbig
2D label select biggest component filter.
- (no parameters)
π§΅ sepconv
2D image intensity separaple convolution filter. Supported parameters are:
kx = [gauss:w=1]; factoryβ filter kernel in x-direction. For supported plug-ins seePLUGINS:1d/spacialkernelky = [gauss:w=1]; factoryβ filter kernel in y-direction. For supported plug-ins seePLUGINS: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 seePLUGINS:2dimage/shape
π₯ 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. Supported parameters are:
dir = x; dictβ Gradient direction. Supported values are:xβ gradient in x-directionyβ gradient in y-direction
Heads up bestie: the output pixel type matches the input pixel type, so if you want nice float gradients, convert your input to a floating point valued image beforehand π
π€ sort-label
This plug-in sorts the labels of a gray-scale image so that the lowest label value corresponts to the label with themost pixels. The background (0) is not touched.
- (no parameters)
The 0 stays exactly where it is, hands off π
ββοΈ
ππ sws
seeded watershead. The algorithm extracts exactly so many reagions 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 watershead region growing. For supported plug-ins seePLUGINS:2dimage/shapeseed =(input, required, string)β seed input image containing the labels for the initial regions.
π« tee
Save the input image to a file and also pass it through to the next filter β bestie really said "and I'll keep it too" π. Supported parameters are:
file =(output, required, io)β name of the output file to save the image too. For supported file types seePLUGINS: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, 0=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 a this threshold. Supported parameters are:
shape = 4n; factoryβ neighborhood shape to take into account. For supported plug-ins seePLUGINS:2dimage/shapethresh = 5; doubleβ The threshold value.
tmean
2D image thresholded tmean filter. The output pixel value is zero if the input pixel value is below the given threshold; otherwise, the pixels in the evaluation windows are only considered if the input pixel intensity is above the threshold. Supported parameters are:
t = 0; floatβ threshold for pixels not to take into account.w = 1; int in [1, inf)β half filter width.
transform
Transform the input image with the given transformation. Supported parameters are:
file =(input, required, io)β name of the file containing the transformation. For supported file types seePLUGINS:2dtransform/io
ws
Basic watershead segmentation. Supported parameters are:
evalgrad = 0; boolβ set to1if the input image does not represent a gradient norm image.mark = 0; boolβ mark the segmented watersheds with a special gray scale value.n = [sphere:r=1]; factoryβ neighborhood for watershead region growing. For supported plug-ins seePLUGINS:2dimage/shapethresh = 0; float in [0, 1)β relative gradient norm threshold. The actual value threshold value isthresh * (max_grad - min_grad) + min_grad. Bassins separated by gradients with a lower norm will be joined.
π PLUGINS: 2dimage/io π
bmp
BMP 2D-image input/output support. The plug-in supports reading and writing of 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. (she does what she wants with the color table, honestly)
- Recognized file extensions:
.BMP,.bmp - Supported element types:
binary data,unsigned 8 bit
datapool
Virtual IO to and from the internal data pool.
- Recognized file extensions:
.@
dicom
2D image io for DICOM.
- Recognized file extensions:
.DCM,.dcm - Supported element types:
signed 16 bit,unsigned 16 bit
exr
a 2dimage io plugin for OpenEXR images.
- 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.
- Recognized file extensions:
.JPEG,.JPG,.jpeg,.jpg - Supported element types:
unsigned 8 bit
png
a 2dimage io plugin for png images.
- Recognized file extensions:
.PNG,.png - Supported element types:
binary data,unsigned 8 bit,unsigned 16 bit
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
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
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
π¦ PLUGINS: 2dimage/shape π¦
1n
A shape that only contains the central point.
(no parameters) β it's just the one pixel, bestie, and honestly? she's enough.
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 radius r. 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.
π PLUGINS: 2dstack/filter π
byslice
Runs a filter on a per slice basis. In essence, this is a wrapper that makes it possible to add pure 2D filters to the stack filter pipeline without ducplicating the implementation. Supported parameters are:
filter =(required, factory)β 2D filter to be applied. For supported plug-ins seePLUGINS:2dimage/filter
close
2D Stack morphological filter 'close'. Supported parameters are:
shape = 6n; factoryβ structuring element. For supported plug-ins seePLUGINS:3dimage/shape
dilate
2D Stack morphological filter 'dilate'. Supported parameters are:
shape = 6n; factoryβ structuring element. For supported plug-ins seePLUGINS:3dimage/shape
erode
2D Stack morphological filter 'erode'. Supported parameters are:
shape = 6n; factoryβ structuring element. For supported plug-ins seePLUGINS:3dimage/shape
gauss
Gauss 2D fifo filter. Supported parameters are:
w = 1; int in [1, inf)β filter width parameter (2*w+1).
label
Stack Label filter. Supported parameters are:
map =(input, required, string)β Mapfile to save label numbers that are joined.n = 4n; factoryβ 2D neighbourhood shape to define connectedness. For supported plug-ins seePLUGINS:2dimage/shape
median
median 2D fifo filter. Supported parameters are:
w = 1; int in [1, inf)β filter width parameter.
mlv
Mean of Least Variance 2D stack image filter. Supported parameters are:
w = 1; int in [1, inf)β filter width parameter.
open
2D Stack morphological filter 'open'. Supported parameters are:
shape = 6n; factoryβ structuring element. For supported plug-ins seePLUGINS:3dimage/shape
regiongrow
Run a region-growing filter on a stack of images that comprise a 3D image. The region growing is based on class probabilities obtained from a c-means classification of the pixel intensities. One seed thresh is use to initiate a region, and another (lower) threshold is used to stop the region growing. By holding a number of 3D slices in the working memory to permit the region to grow "backwards " in the stack a Quasi-3D processing is achieved. However, with complex structures the region growing may not properly be segmented. Supported parameters are:
class = 2; int in [0, inf)β class to be segmented.depth = 10; int in [1, inf)β number of slices to keep during processing.low = 0.5; float in (0, 1]β low threshold for acceptance probability.map =(input, required, string)β seed class map.seed = 0.98; float in (0, 1]β threshold for seed probability.
π PLUGINS: 2dtransform/io π
bbs
Binary (non-portable) serialized IO of 2D transformations.
- Recognized file extensions:
.bbs
datapool
Virtual IO to and from the internal data pool.
- Recognized file extensions:
.@
vista
Vista storage of 2D transformations.
- Recognized file extensions:
.v2dt
xml
XML serialized IO of 2D transformations.
- Recognized file extensions:
.x2dt
πΈ PLUGINS: 3dimage/shape πΈ
18n
18n neighborhood 3D shape creator.
(no parameters)
26n
26n neighborhood 3D shape creator.
(no parameters)
6n
6n neighborhood 3D shape creator.
(no parameters)
sphere
Closed spherical shape neighborhood including the pixels within a given radius r. Supported parameters are:
r = 2; float in (0, inf)β sphere radius.
β¨ PLUGINS: generator/noise β¨
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 stdlib rand(). 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 π₯
Run a mean-least-varaiance filter on a series of images that follow the numbering pattern imageXXXX.exr and store the output in images filteredXXXX.exr
mia-2dstackfilter -i image0000.exr -o filtered -t exr mlv:w=2
π AUTHOR(s) π
Gert Wollny
yeah that's the whole person, just Gert, icon behaviour fr
π 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'.
bestie,<rainbow>no warranty</rainbow>is not a vibe, it's a legal statement, so likeβ¦ take it seriously π
okay that's genuinely the whole entire page, you made it to the end, I'm so proud of you π«Ά this gem came straight out of the USER COMMANDS manual section, it's version v2.4.7, and the page itself is mia-2dstackfilter(1) β go slay some 2D stacks, periodt π
β¨
π¦ 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