mia-2dimagefilter(1)
๐ mia-2dimagefilter(1) ๐
okay bestie, welcome to the manual page for mia-2dimagefilter(1) โ it's giving โrun filters on a 2D imageโ main character energy. This is part 1, and we are keeping every single flag, plugin, default, and weird little typo exactly where it lives. No cap. ๐ซถ
โจ NAME โจ
mia-2dimagefilter โ Run filters on a 2D image.
๐ธ SYNOPSIS ๐ธ
mia-2dimagefilter -i <in-file> -o <out-file> [options]
<PLUGINS:2dimage/filter>
๐ฆ DESCRIPTION ๐ฆ
mia-2dimagefilter โ this program runs a series filters on a given input image. The filters are given as extra parameters on the command line and Ware run in the order in which they are given. (Yes, the original says โWareโ. We respect the typo. ๐
) To obtain a list of available filters you may run 'mia-plugin-help filter/2dimage' from the command line.
๐ OPTIONS ๐
-i,--in-file=(required, input); ioโ input image(s) to be filtered. For supported file types seePLUGINS:2dimage/io.-o,--out-file=(required, output); ioโ output image(s) that have been filtered. For supported file types seePLUGINS:2dimage/io.
๐ 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
โ๏ธ 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).
๐ง PLUGINS: 1d/spacialkernel ๐ง
okay so these are the 1D spacial kernel besties. Yes, โspacialโ. We donโt correct the source. ๐
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 ๐
spline girlies, assemble. ๐ฆ
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 ๐
combiner operators, letโs go. These all have (no parameters) and theyโre just here to do math on two images, fr fr.
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 main character section. This is where the actual 2D image filters live, and there are a lot of them. Vibe check: every parameter, default, and supported value is below. No skipping. ๐
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:pm1โ stopping function 1pm2โ stopping function 2tuckeyโ tukey stopping functionguessโ test stopping function
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 =(required, input, 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 to remap label id's. Only applicable to images with integer valued intensities/labels., supported parameters are:
map =(required, input, string)โ Label mapping file.
๐ธ labelscale
okay so this one is giving "vote for your fave pixel" energy. It only creates output voxels that are already created in the input image โ no inventing new ones out of thin air, bestie. The scaling runs 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. tiebreaker rules, we love to see it.
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. simple as that, no notes.
file =(required, input, io)โ name of the input file to load from. For supported file types seePLUGINS:2dimage/io.
๐ญ mask
2D masking โ and heads up, one of the two input images must be of type bit. non-negotiable.
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 =(required, input, io)โ second input image file name. For supported file types seePLUGINS:2dimage/io.inverse = 0; boolโ set totrueto use the inverse of the mask for masking.
๐ maxflow
This filter implements the max-flow min-cut algorithm for image segmentation. very graph-theory of it.
sink-flow =(required, input, io)โ image offloattype to define the per-pixel flow to the sink. For supported file types seePLUGINS:2dimage/io.source-flow =(required, input, io)โ image offloattype to define the per-pixel flow to the source. For supported file types seePLUGINS:2dimage/io.
โจ mean
2D image mean filter. it averages, it serves.
w = 1; int in [1, inf)โ half filter width.
๐งฎ meanvar
This filter simultaneously evaluates 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.
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 =(required, output, io)โ name of the output file to save the variation image to. For supported file types seePLUGINS:2dimage/io.w = 1; uint in [1, inf)โ filter width parameter.
๐ฏ median
2D image median filter. the classic.
w = 1; int in [1, inf)โ half filter width.
๐ medianmad
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 are ignored and at their locations the output median and MAD are set to zero. The median intensity image is passed directly to the pipeline, 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. iconic consistency.
madfile =(required, output, io)โ name of the output file to save the median absolute deviation image to. For supported file types seePLUGINS:2dimage/io.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.w = 1; uint in [1, inf)โ filter width parameter.
๐ซง mlv
Mean of Least Variance 2D image filter. sounds fancy bc it is.
w = 1; int in [1, inf)โ filter width parameter.
๐ง ngfnorm
2D image to normalized-gradient-field-norm filter.
- (no parameters) โ yeah, she's low maintenance.
๐ฒ noise
2D image noise filter: adds additive or modulated noise to an image.
g = [gauss:mu=0,sigma=10]; factoryโ noise generator. For supported plug-ins seePLUGINS:generator/noise.mod = 0; boolโ additive or modulated noise.
๐ช open
Morphological open.
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.
iter = 0; int in [1, 1000000]โ number of iterations to run,0=until convergence.
๐ฑ regiongrow
Region growing starting from a seed, until only along increasing gradients.
n = 8n; factoryโ neighborhood shape. For supported plug-ins seePLUGINS:2dimage/shape.seed =(required, input, io)โ seed image (bit valued). For supported file types seePLUGINS:2dimage/io.
๐ง sandp
Salt and pepper 3d filter. seasoning, but make it pixels.
thresh = 100; float in (0, inf)โ thresh value.w = 1; int in [1, inf)โ filter width parameter.
๐ scale
2D image downscale filter.
interp = [bspline:d=3]; factoryโ interpolation method to be used. For supported plug-ins seePLUGINS:1d/splinekernel.s = [[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) โ she picks the winner and dips.
๐ช sepconv
2D image intensity separable convolution filter.
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.
๐ shmean
2D image filter that evaluates the mean over a given neighborhood shape.
shape = 8n; factoryโ neighborhood shape to evaluate the mean. For supported plug-ins seePLUGINS:2dimage/shape.
๐ sobel
The 2D Sobel filter for gradient evaluation. Big note: 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, do the conversion.
dir = x; dictโ gradient direction. Supported values are:xโ gradient in x-directionyโ 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.
- (no parameters) โ no knobs, just vibes.
๐ง sws
Seeded watershed. The algorithm extracts exactly as many regions as initial labels are given in the seed image.
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:2dimage/shape.seed =(required, input, 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. having it both ways, as a treat.
file =(required, output, io)โ name of the output file to save the image to. For supported file types seePLUGINS:2dimage/io.
๐ thinning
Morphological thinning. Thinning until convergence will result in an 8-connected skeleton.
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 this threshold.
shape = 4n; factoryโ neighborhood shape to take into account. For supported plug-ins seePLUGINS:2dimage/shape.thresh = 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.
t = 0; floatโ threshold for pixels not to take into account.w = 1; int in [1, inf)โ half filter width.transformโ slaps a whole transformation onto your input image, no biggie. Here's the tea on its parameters:file=(required, input, io)โ the name of the file holding the transformation. Wanna know which file types are even allowed? Go peek atPLUGINS:2dtransform/io๐ฆ
wsโ basic watershed segmentation, periodt. Its parameters:evalgrad=0; bool โ flip this to1if your input image is not a gradient norm image already.mark=0; bool โ set it and the segmented watersheds get marked with a special gray scale value. cute, right?n=[sphere:r=1]; factory โ the neighborhood used for watershed region growing. Supported plug-ins live atPLUGINS:2dimage/shapeโจthresh=0; float in[0, 1)โ relative gradient norm threshold. The actual threshold value isthresh * (max_grad - min_grad) + min_grad. Basins separated by gradients with a lower norm get joined. it's giving "merge the vibes" ๐
โจ PLUGINS: 2dimage/io โจ
bmpโ BMP 2D-image input/output support, bestie. This one reads and writes binary images and 8-bit gray scale images, and it's read-only for 4-bit gray scale images. The color table? Ignored, not even looked at. 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. it's the ~internal~ one ๐ซถ- Recognized file extensions:
.@
- Recognized file extensions:
dicomโ 2D image io for DICOM, the medical girlies know ๐ฉบ- 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. iconic, obviously ๐- 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. raw and unfiltered, just like my opinions ๐- 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 โจ
1nโ a shape that only contains the central point. literally one (1) pixel, main character energy ๐- (no parameters)
4nโ 4n neighborhood 2D shape- (no parameters)
8nโ 8n neighborhood 2D shape- (no parameters)
rectangleโ rectangle shape mask creator, and yes it has parameters:fill=1; bool โ create a filled shape.height=2; int in[1, inf)โ height of the rectangle.width=2; int in[1, inf)โ width of the rectangle.
sphereโ closed spherical neighborhood shape of radiusr, obsessed. Parameters:r=2; float in(0, inf)โ the sphere radius.
squareโ square shape mask creator, parameters incoming:fill=1; bool โ create a filled shape.width=2; int in[1, inf)โ width of the rectangle.
ngl, thesquareplug-in calls its size parameterwidthand describes it as "width of rectangle" โ that's straight from the source, I'm not editing the lore ๐
โจ PLUGINS: 2dtransform/io โจ
bbsโ binary (non-portable) serialized IO of 2D transformations. non-portable, so don't go mailing these around, 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. readable, unlike some people ๐ญ- Recognized file extensions:
.x2dt
- Recognized file extensions:
โจ PLUGINS: generator/noise โจ
gaussโ this noise generator creates random values that are distributed according to a Gaussian distribution, and it does it by using the Box-Muller transformation. slay. Parameters:mu=0; float โ mean of the distribution.seed=0; uint in[0, inf)โ set the random seed (0= init based on system time).sigma=1; float in(0, inf)โ standard derivation of the distribution.
uniformโ uniform noise generator using C stdlibrand(). Parameters:a=0; float โ lower bound if noise range.b=1; float โ higher bound if noise range.seed=0; uint in[0, inf)โ set the random seed (0= init based on system time).
โจ EXAMPLE โจ
okay so picture this: you wanna run a kmeans classification of 5 classes on input.png, then binarize the 4th class, and store the result in result.png. here's the whole serve:
mia-2dimagefilter -i input.png -o result.png kmeans:c=5 binarize:min=4,max=4
ate and left no crumbs ๐
โจ 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.
fr fr, that "ABSOLUTELY NO WARRANTY" is in all caps for a reason โ no take-backs, no promises, you're on your own if it goes sideways ๐
and that's the whole page, bestie ๐ซถ this iconic lil doc lives under the USER COMMANDS corner of the manual, version v2.4.7, filed away as mia-2dimagefilter(1). go forth and filter some images, you've got this ๐
โจ๐
๐ฆ where this page comes from
- debian bookworm: mia-tools 2.4.7-11+b1 ยท GPL-3.0-or-later
- ubuntu jammy: mia-tools 2.4.7-8ubuntu1 ยท 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