mia-3dimagefilterstack(1)
π mia-3dimagefilterstack β General Commands Manual, section 1 π
okay so bestie, you know how the whole manual is just mia-3dimagefilterstack(1)? yeah. that's this. it lives in section 1 of the General Commands Manual and it is exactly as extra as the name makes it sound. π
β¨ NAME β¨
mia-3dimagefilterstack β Filter a series of 3D images.
π¦ SYNOPSIS π¦
mia-3dimagefilterstack -i <in-file> -o <out-file> -t <type> [options]
<PLUGINS:3dimage/filter>
πΈ DESCRIPTION πΈ
okay so here's the vibe: mia-3dimagefilterstack is the program you reach for when you've got a whole consecutive numbered series of gray scale images and you need to filter and convert them. that's it, that's the job. π
but there's a catch, and it's a naming catch, so listen up: your file names have to follow the pattern dataXXXX.v, where the X characters are digits. meaning the numbering has to come right before the dot. iykyk. no cap. β¨
π OPTIONS π
-i --in-file=(input, required); ioβ the input image(s) that are gonna get filtered. yep it's required, bestie, you don't get to skip it. and for supported file types seePLUGINS:3dimage/ioπ«Ά-o --out-file=(output, required); ioβ this one is the output file name base. like, the stem. numbers get added to it according to the input file pattern, and then the file extension gets added according to thetypeoption. also required, also not optional, sorry. for supported file types seePLUGINS:3dimage/ioπ-t --type=(required); setβ the output file type. required, literally. the supported values are:
analyze, datapool, dicom, hdf5, inria, mhd, nifti, vff, vista, vti, vtk,
π Help & Info π
-V --verbose=warningβ how chatty the output is. it 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β print copyright information π-h --helpβ print this help π«Ά-? --usageβ print a short help--versionβ print the version number and exit β
π§ Processing π§
--threads=-1β the 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. and-1means automatic estimation. let it cook. π₯
π₯ PLUGINS: 1d/spacialkernel π₯
cdiff
Central difference filter kernel, mirror boundary conditions are used.
(no parameters) β nope, nothing to configure. iconic.
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) β again, zero knobs. immaculate.
π¦ 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)
bestie the consistency here?? three of them, all (no parameters). ate. π
π 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.
okay so aboutomoms: that range is[3, 3]. yes, like, only 3. it's not a typo, that's just what it is, don't come for me. π
π PLUGINS: 3dimage/combiner π
five little operators, all of them (no parameters), all of them living their best life:
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/filter β¨
this is the main character section fr. buckle up. π«Ά
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 seePLUGINS: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 seePLUGINS:3dimage/ioop =(required, factory)β Image combiner to be applied to the images. for supported plug-ins seePLUGINS:3dimage/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 parametera.b = 0; floatβ linear conversion parameterb.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, 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 seePLUGINS: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
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,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 seePLUGINS:1d/spacialkernel
erode
3d image stack erode 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 seePLUGINS:3dimage/shape
gauss
isotropic 3D gauss filter, supported parameters are:
w = 1; int in [0, inf)β filter width parameter. πΈ
gradnorm
3D image to gradient norm filter
(no parameters)
growmask
Use an input binary mask and a reference gray scale image to do region growing by adding the neighborhood pixels of an already added pixel if the have a lower intensity that is above the given threshold. 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 seePLUGINS:3dimage/ioshape = 6n; factoryβ neighborhood mask. for supported plug-ins seePLUGINS:3dimage/shape
invert
intensity invert filter
(no parameters)
isovoxel
This filter scales an image to make the voxel size isometric and its size to correspond to the given value, supported parameters are:
interp = [bspline:d=3]; factoryβ interpolation kernel to be used . for supported plug-ins seePLUGINS:1d/splinekernelsize = 1; float in (0, inf)β isometric target voxel size.
π«Ά kmeans β the 3D image k-means filter
okay so this one is a whole clustering vibe: it takes your image and does k-means on it π. In the output image the pixel value represents the class membership, and the class centers get stashed as an attribute on the image (not just floating around, they're attached, periodt).
Params, bestie:
c = 3; int in [2, inf)β number of classes. Defaults to3, and you literally cannot go below2(clustering yourself into one class is not the move π).
πΈ label β connected components, but make it legible
A filter that labels the connected components of a binary image. That's it, that's the job β¨.
n = 6n; factoryβ the neighborhood mask. For supported plug-ins seePLUGINS:3dimage/shape.
π labelmap β remap those label ids
An image filter that remaps label id's. Heads up: it's only applicable to images with integer valued intensities/labels, so if your image is all floaty and fancy, this is not your filter π.
map =(input, required, string)β the label mapping file. It's an input, it's required, and it's a string. Three whole boxes ticked.
π labelscale β vote for your fave label
A filter that only creates output voxels that are already created in the input image β no new labels invented out of thin air, that's the rule. The scaling is done with a voting algorithm that 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 tied with the same count? The one with the lower number wins π (tiebreak rules, iconic).
out-size =(required, 3dbounds)β target size, given as two comma-separated values.
π¦ load β just. load the file.
Loads the input image from a file and uses it to replace the current image in the pipeline. Pipeline refresh, main character energy.
file =(input, required, io)β name of the input file to load from. For supported file types seePLUGINS:3dimage/io.
π
lvdownscale β label voting downscale
This is a label voting downscale filter. It downscales a 3D image by blocks, and for each block the (non-zero) label that shows up the most times in the block gets issued as the output pixel in the target image. If two labels appear the same number of times, the one with the lower absolute value wins. Non-zero only β zero is not invited to the vote π.
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
Masking time. One image comes from the parameters list, and the other comes from the normal filter input. Both images must be the same dimensions, and one of them must be binary (no cap, those are the requirements). 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 β so the non-binary one is the vibe-setter.
input =(input, required, io)β second input image file name. For supported file types seePLUGINS:3dimage/io.
β mean β 3D image mean filter
Smoothing, but the classic. That's the whole thing π«Ά.
w = 1; int in [1, inf)β half filter width.
π median β median 3d filter
The median one. Salt-and-pepper's nemesis, lowkey.
w = 1; int in [1, inf)β filter width parameter.
π§ mlv β Mean of Least Variance
Mean of Least Variance 3D image filter, aka MLV if you're in a hurry β¨.
w = 1; int in [1, inf)β filter width parameter.
π msnormalizer β mean-sigma normalizing
3D image mean-sigma normalizing filter. Normalize the mean, normalize the sigma, normalize your whole day π .
w = 1; int in [1, inf)β half filter width.
π open β morphological open
Morphological open, exactly what it says on the tin.
hint = black; stringβ a hint at the main image content (black|white). Give it a lil heads up about what it's looking at.shape = [sphere:r=2]; factoryβ structuring element. For supported plug-ins seePLUGINS:3dimage/shape.
π₯ reorient β rotate, flip, permutate, slay
3D image reorientation filter. This one has a whole menu of orientations and I am obsessed π.
map = xyz; dictβ orientation mapping to be applied. Supported values are:xyzβ keep orientationp-yzxβ permutate x->z->y->xp-zxyβ permutate x->y->z->xf-yzβ flip y-zf-xyβ flip x-yf-xzβ flip x-zr-x90β rotate around x-axis clockwise 90 degreer-x180β rotate around x-axis clockwise 180 degreer-x270β rotate around x-axis clockwise 270 degreer-y90β rotate around y-axis clockwise 90 degreer-y180β rotate around y-axis clockwise 180 degreer-y270β rotate around y-axis clockwise 270 degreer-z90β rotate around z-axis clockwise 90 degreer-z180β rotate around z-axis clockwise 180 degreer-z270β rotate around z-axis clockwise 270 degree
πΈ resize β resize an image
Resize an image. The original data is centered within the new sized image β no corner-hiding, it goes right in the middle, main character positioning π.
size = [[0,0,0]]; streamableβ new size of the image; a size0indicates to keep the size for the corresponding dimension. So yes, you can leave some zeroes and it'll just vibe with the original size there.
π sandp β salt and pepper 3d filter
Salt and pepper noise removal, the 3D edition. Cleaning up the noise like it's my room before guests arrive π.
thresh = 100; float in [0, inf)β thresh value.w = 1; int in [1, inf)β filter width parameter.
β¨ scale β scale to a target size
3D image filter that scales to a given target size. Interpolation girlies, this one's for you π.
interp = [bspline:d=3]; factoryβ interpolation kernel to be used. For supported plug-ins seePLUGINS:1d/splinekernel.s = [[0,0,0]]; 3dboundsβ target size to set all components at once (component0: 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).
bestie I need you to know the page literally says "y direction" for sz too π. I'm just the messenger, I'm not touching it. That's what it says, character for character.
π scharr β the 3D Scharr filter
The 3D Scharr filter for gradient evaluation π. And now for the important technical tea: 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. Do that. Fr fr.
dir = x; dictβ Gradient direction. Supported values are:xβ gradient in x-directionyβ gradient in y-directionzβ gradient in z-direction
π¦ selectbig β biggest intensity, winner winner
A filter that creates a binary mask representing the intensity with the highest pixel count π. The pixel value 0 will be ignored (zero is not competing, she's not in the race). And if two intensities have the same pixel count, then the result is undefined β say it with me, no promises are being made there π. Also: the input pixel must have an integral pixel type.
- (no parameters)
That's literally it, no knobs, no dials, just vibes and a required integer type.
π sepconv β separable convolution
3D image intensity separaple convolution filter. Three kernels, one for each axis, all doing their lil part separately β¨.
kx = [gauss:w=1]; factoryβ filter kernel in x-direction. For supported plug-ins seePLUGINS:1d/spacialkernel.ky = [gauss:w=1]; factoryβ filter kernel in y-direction. For supported plug-ins seePLUGINS:1d/spacialkernel.kz = [gauss:w=1]; factoryβ filter kernel in z-direction. For supported plug-ins seePLUGINS:1d/spacialkernel.
π sobel β the 2D Sobel filter
The 2D Sobel filter for gradient evaluation. (Yes, the page says 2D. In a page full of 3D. I'm just reporting what it says, bestie, I do not make the rules π.) Same big caveat as before: 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.
dir = x; dictβ Gradient direction. Supported values are:xβ gradient in x-directionyβ gradient in y-directionzβ gradient in z-direction
πΈ sws β seeded watershed
Seeded watershed π§. The algorithm extracts exactly as many regions as initial labels are given in the seed image. So how many seeds you hand over is how many regions come back. Exact. No extras.
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 seePLUGINS:3dimage/shape.seed =(input, required, string)β seed input image containing the labels for the initial regions.
π
tee β save it AND pass it through
Saves the input image to a file and also passes it through to the next filter. Two things at once, she's multitasking, she's that girl π«Ά.
file =(output, required, io)β name of the output file to save the image to. For supported file types seePLUGINS:3dimage/io.
π§ thinning β 3D morphological 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. Citation coming through as written, no edits. This implementation only supports the 26 neighbourhood, so don't come asking for the other ones, they're not here.
- (no parameters)
π₯ transform β transform the input image
Transforms the input image with the given transformation π. You hand it a transformation, it transforms. Beautiful relationship, honestly.
file =(input, required, io)β Name of the file containing the transformation. For supported file types seePLUGINS:3dtransform/io.imgboundary = ; factoryβ override image interpolation boundary conditions. For supported plug-ins seePLUGINS:1d/splinebc.imgkernel = ; factoryβ override image interpolator kernel. For supported plug-ins seePLUGINS:1d/splinekernel.
π variance β 3D image variance filter
Variance. 3D. Filter. That's the sentence π .
w = 1; int in [1, inf)β half filter width.
β ws β basic watershed segmentation
basic watershed segmentation π§. Not the seeded one, the basic one. Different girl, similar energy.
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 watershed region growing. For supported plug-ins seePLUGINS:3dimage/shape.thresh = 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: 3dimage/io π¦
analyze β Analyze 7.5 image
- 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
- Recognized file extensions:
.@
dicom β Dicom image series as 3D
- 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
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 using the VTK implementation (experimental).
- 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. The orientation is transformed in the same way like it is done with 'dicomtonifti --no-reorder' from the vtk-dicom package.
- 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 (experimental).
- 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 (experimental).
- 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
πΈ 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: 3dtransform/io β¨
bbs β Binary (non-portable) serialized IO of 3D transformations
- 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
π EXAMPLE π
Run a mean-least-varaiance filter on a series of images that follow the numbering pattern imageXXXX.hdr and store the output in images filteredXXXX.hdr
mia-3dimagefilterstack -i image0000.hdr -o filtered -t hdr mlv:w=2
π AUTHOR(s) π
Gert Wollny
π COPYRIGHT π
This software is Copyright (c) 1999β2015 Leipzig, Germany and Madrid, Spain. It comes with ABSOLUTELY NO WARRANTY and you may redistribute it under the terms of the GNU GENERAL PUBLIC LICENSE Version 3 (or later). For more information run the program with the option --copyright.
Ok bestie, thatβs the whole chaotic beautiful page π
shoutout to the footer energy: USER COMMANDS, v2.4.7, mia-3dimagefilterstack(1) β no date line in sight, but she still ate πβ¨
π¦ 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