mia-2dimagefilterstack(1)

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

✨ mia-2dimagefilterstack ✨

okay bestie, this is a page from the General Commands Manual β€” the manual name is mia-2dimagefilterstack and it lives in section 1. Buckle up, she's a long one πŸ’…


NAME

mia-2dimagefilterstack β€” Run filters on a series of 2D images.


SYNOPSIS

mia-2dimagefilterstack -i <in-file> -o <out-file> [options]
<PLUGINS:2dimage/filter>

DESCRIPTION

mia-2dimagefilterstack runs a whole series of filters on a series of consecutive numbered input images. fr fr, that's the whole vibe.

The filters get passed in as extra parameters on the command line, and here's the tea: they run in the exact order you gave them. First one listed = first one applied. no cap 🫢


OPTIONS

File IO

  • -i --in-file=(input, required); io β€” the input image(s) that are gonna get filtered. For supported file types see PLUGINS:2dimage/io πŸ“‚
  • -o --out-file=(output, required); io β€” output file name base, and the file type gets set according to the 'type' option. For supported file types see PLUGINS:2dimage/io πŸ’Ύ
  • -t --type= β€” output file type, and if you don't give one, the input type is used, periodt.

Supported values are: -, @, 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 β€” verbosity of output: it prints messages of the given level and higher priorities. The supported priorities, starting at the lowest level, are:
    • trace ‐ Function call trace
    • debug ‐ Debug output
    • info ‐ Low level messages
    • message ‐ Normal messages
    • warning ‐ Warnings
    • fail ‐ Report test failures
    • error ‐ Report errors
    • fatal ‐ Report only fatal errors
  • --copyright β€” print copyright information πŸ“œ
  • -h --help β€” print this help 🫢
  • -? --usage β€” print a short help
  • --version β€” print the version number and exit ✨

Processing

  • --threads=-1 β€” Maxiumum number of threads to use for processing. This number should be lower or equal to the number of logical processor cores in the machine. (-1: automatic estimation). she multitasks πŸ’…

Processing1

  • -s --start=0 β€” first possible number of file number range to be filtered πŸ”’
  • -e --end=2147483647 β€” last possible number of file number range to be filtered πŸ”’

🧚 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

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 1
    • pm2 ‐ stopping function 2
    • tuckey ‐ tukey stopping function
    • guess ‐ 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 see PLUGINS: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 see PLUGINS:2dimage/io
  • op =(required, factory) β€” Image combiner to be applied to the images. For supported plug-ins see PLUGINS:2dimage/combiner
  • reverse = 0; bool β€” reverse the order in which the images passed to the combiner.

convert

image pixel format conversion filter, supported parameters are:

  • a = 1; float β€” linear conversion parameter a.
  • b = 0; float β€” linear conversion parameter b.
  • map = opt; dict β€” conversion mapping. Supported values are:
    • copy ‐ copy data when converting
    • linear ‐ apply linear transformation x -> a*x+b
    • range ‐ apply linear transformation that maps the input data type range to the output data type range
    • opt ‐ apply a linear transformation that maps the real input range to the full output range
    • optstat ‐ apply a linear transform that maps based on input mean and variation to the full output range
  • repn = ubyte; dict β€” output pixel type. Supported values are:
    • bit ‐ binary data
    • sbyte ‐ signed 8 bit
    • ubyte ‐ unsigned 8 bit
    • sshort ‐ signed 16 bit
    • ushort ‐ unsigned 16 bit
    • sint ‐ signed 32 bit
    • uint ‐ unsigned 32 bit
    • slong ‐ signed 64 bit
    • ulong ‐ unsigned 64 bit
    • float ‐ floating point 32 bit
    • double ‐ floating point 64 bit
    • none ‐ no pixel type defined

crop

Crop a region of an image, the region is always clamped to the original image size. 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 see PLUGINS: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 see PLUGINS: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 see PLUGINS: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 β€” the neighborhood mask that says who's connected to whom πŸ’«. For supported plug-ins see PLUGINS:2dimage/shape

🏷️ labelmap

An image filter that remaps label id's, bestie β€” and heads up, it only works on images with integer valued intensities/labels, no exceptions fr. Supported parameters are:

  • map =(input, required, string) β€” the label mapping file πŸ“„.

πŸ“ labelscale

okay so the whole point of this one: it only creates output voxels that are already created in the input image. Nothing new gets invented, periodt. 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 that region has two labels tied with the same count? The one with the lower number wins. Sorry to the bigger label, you lost the tiebreak 😭. Supported parameters are:

  • out-size =(required, 2dbounds) β€” the 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 β€” like a glow-up swap in the middle of the flow ✨. Supported parameters are:

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

🎭 mask

2D masking, and ngl one of the two input images must be of type bit. Supported parameters are:

  • fill = min; dict β€” the 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 values outside the mask to the maximum value found in the image.
  • input =(input, required, io) β€” the second input image file name. For supported file types see PLUGINS:2dimage/io
  • inverse = 0; bool β€” set to true to use the inverse of the mask for masking. Flip the vibe πŸ¦‹

🌊 maxflow

This filter implements the max-flow min-cut algorithm for image segmentation β€” it's giving graph theory main character energy, fr. Supported parameters are:

  • sink-flow =(input, required, io) β€” an image of float type that defines the per-pixel flow to the sink. For supported file types see PLUGINS:2dimage/io
  • source-flow =(input, required, io) β€” an image of float type that defines the per-pixel flow to the source. For supported file types see PLUGINS:2dimage/io

🫧 mean

Your classic 2D image mean filter. Supported parameters are:

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

πŸ“Š meanvar

A filter that evaluates the pixel wise mean and the variance of an image at the same time in a given window β€” multitasking queen πŸ‘‘. Pixel intensities below the given threshold get ignored, and at those locations the output mean and variation are set to zero. The mean intensity image is passed directly as a float image to the pipeline; the variation image gets saved to a file given with the varfile parameter. Supported parameters are:

  • thresh = 0; double in [0, inf) β€” the intensity thresholding parameter. Pixels with intensities below this threshold get set to zero, and they're also not used when evaluating mean and variation.
  • varfile =(output, required, io) β€” the 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) β€” the filter width parameter.

🎯 median

2D image median filter. Supported parameters are:

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

πŸ“ˆ medianmad

Evaluates the pixel wise median and the median absolute deviation (MAD) of an image at the same time in a given window β€” two for the price of one, we love to see it πŸ’…. 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 goes straight to the pipeline; the variation image gets saved to a file given with the varfile parameter. And both output images have the same pixel type as the input image. Supported parameters are:

  • madfile =(output, required, io) β€” the 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) β€” the intensity thresholding parameter. Pixels with intensities below this threshold get set to zero, and they're also not used when evaluating mean and variation.
  • w = 1; uint in [1, inf) β€” the filter width parameter.

🌟 mlv

Mean of Least Variance 2D image filter. Supported parameters are:

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

🧭 ngfnorm

2D image to normalized-gradiend-field-norm filter.

  • (no parameters)

🎲 noise

2D image noise filter β€” it adds additive or modulated noise to an image, your choice bestie. Supported parameters are:

  • g = [gauss:mu=0,sigma=10]; factory β€” the noise generator. For supported plug-ins see PLUGINS:generator/noise
  • mod = 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 β€” the structuring element. For supported plug-ins see PLUGINS:2dimage/shape

βœ‚οΈ pruning

Morphological pruning. And listen β€” pruning until convergence will erase all pixels except closed loops, so be so serious about what you're doing here πŸ’€. Supported parameters are:

  • iter = 0; int in [1, 1000000] β€” the number of iterations to run, 0 = until convergence.

🌱 regiongrow

Region growing, starting from a seed and going until it's only along increasing gradients. Supported parameters are:

  • n = 8n; factory β€” the neighborhood shape. For supported plug-ins see PLUGINS:2dimage/shape
  • seed =(input, required, io) β€” the 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) β€” the thresh value.
  • w = 1; int in [1, inf) β€” the filter width parameter.

πŸ” scale

2D image downscale filter. Supported parameters are:

  • interp = [bspline:d=3]; factory β€” the interpolation method to be used. For supported plug-ins see PLUGINS:1d/splinekernel
  • s = [[0,0]]; 2dbounds β€” the target size as a 2D vector.
  • sx = 0; uint in [0, inf) β€” the target size in x direction, 0: use input size.
  • sy = 0; uint in [0, inf) β€” the target size in y direction, 0: use input size.

πŸ† selectbig

2D label select biggest component filter β€” only the main character survives, literally.

  • (no parameters)

🧡 sepconv

2D image intensity separaple convolution filter. Supported parameters are:

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

🫢 shmean

A 2D image filter that evaluates the mean over a given neighborhood shape. Supported parameters are:

  • shape = 8n; factory β€” the neighborhood shape to evaluate the mean over. For supported plug-ins see PLUGINS:2dimage/shape

🌈 sobel

The 2D Sobel filter for gradient evaluation. Heads up though: the output pixel type of the filtered image is the same as the input pixel type, so converting the input to a floating point valued image beforehand is recommendable β€” do your prep work first bestie πŸ™ˆ. Supported parameters are:

  • dir = x; dict β€” the 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. And just so you know β€” the background (0) is not touched 🚫.

  • (no parameters)

🌊 sws

Seeded watershead. The algorithm extracts exactly as many regions as initial labels are given in the seed image β€” no more, no less, that's the assignment πŸ“‹. 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 β€” the neighborhood for watershead region growing. For supported plug-ins see PLUGINS:2dimage/shape
  • seed =(input, required, string) β€” the seed input image containing the lables for the initial regions.

πŸ«– tee

Saves the input image to a file and also passes it through to the next filter β€” why not both, iconic behavior ✨. Supported parameters are:

  • file =(output, required, io) β€” the name of the output file to save the image to. For supported file types see PLUGINS:2dimage/io

🦴 thinning

Morphological thinning. And lowkey this is the slay one: thinning until convergence results in an 8-connected skeleton πŸ’€βœ¨. Supported parameters are:

  • iter = 0; int in [1, 1000000] β€” the 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 β€” it's a whole clique getting zeroed, fr. Supported parameters are:

  • shape = 4n; factory β€” the neighborhood shape to take into account. For supported plug-ins see PLUGINS:2dimage/shape
  • thresh = 5; double β€” the threshold value.

tmean

A 2D thresholded tmean filter, and the tea is: your output pixel is zero whenever the input pixel sits below the threshold you gave. Otherwise, the pixels inside the evaluation window only get counted if their input intensity is above that threshold. So it's a mean, but picky ✨

Parameters, bestie:

  • t = 0; float β€” the threshold for pixels you do not want taken into account.
  • w = 1; int in [1, inf) β€” half filter width.

transform

Glow-up time β€” this one transforms your input image with whatever transformation you hand it. πŸ”₯

Parameters:

  • file =(input, required, io) β€” name of the file holding the transformation. Wanna know which file types are even allowed? Go peek at PLUGINS:2dtransform/io.

ws

Basic watershed segmentation. Yes, the classic. πŸ’§

Parameters:

  • evalgrad = 0; bool β€” set this to 1 if your input image is not a gradient norm image.
  • mark = 0; bool β€” marks the segmented watersheds with a special gray scale value.
  • n = [sphere:r=1]; factory β€” the neighborhood used for watershed region growing. Supported plug-ins live over in PLUGINS:2dimage/shape.
  • thresh = 0; float in [0, 1) β€” relative gradient norm threshold. The actual threshold value is thresh * (max_grad - min_grad) + min_grad. Basins that are separated by gradients with a lower norm get joined together.

✨ PLUGINS: 2dimage/io ✨

bmp

BMP 2D-image input/output support, and it's giving versatile. πŸŽ€ It can read and write binary images and 8-bit gray scale images, and it gives you read-only support for 4-bit gray scale images. The color table? Ignored, bestie. The pixel values are taken as literal gray scale values.

  • Recognized file extensions: .BMP, .bmp
  • Supported element types:
    • binary data, unsigned 8 bit

datapool

Virtual IO to and from the internal data pool. It's the little backstage pass 🫢

  • Recognized file extensions: .@

dicom

2D image io for DICOM β€” medical girlies, this one's for you 🩺

  • Recognized file extensions: .DCM, .dcm
  • Supported element types:
    • signed 16 bit, unsigned 16 bit

exr

A 2dimage io plugin for OpenEXR images. HDR main character energy 🌈

  • 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. The people's champion πŸ’–

  • Recognized file extensions: .PNG, .png
  • Supported element types:
    • binary data, unsigned 8 bit, unsigned 16 bit

raw

RAW 2D-image output support. No frills, just pixels πŸ“

  • 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. The reliable bestie ✨

  • 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. Tiny. Minimal. Iconic. πŸ’…

  • (no parameters)

4n

4n neighborhood 2D shape.

  • (no parameters)

8n

8n neighborhood 2D shape.

  • (no parameters)

rectangle

Rectangle shape mask creator, and it serves geometry 😌

  • 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. Round and unbothered πŸ¦‹

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

square

Square shape mask creator. Yes queen, right angles πŸŽ€

  • fill = 1; bool β€” create a filled shape.
  • width = 2; int in [1, inf) β€” width of rectangle.

πŸ’œ PLUGINS: 2dtransform/io πŸ’œ

bbs

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

Careful bestie β€” that's non-portable. Do not expect these to travel well. πŸ™ˆ
  • 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: generator/noise 🧚

gauss

This noise generator creates random values distributed according to a Gaussian distribution, using the Box-Muller transformation. Math ate, no cap. πŸ“βœ¨

  • 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(). Old school and proud πŸ’«

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

So like, run a kmeans classification of 5 classes on images inputXXXX.png (the X's being digits), then binarize the 4th class, and stash the result in resultXXXX.png. Slay:

mia-2dimagefilterstack -i input0000.png -o result -t png kmeans:c=5 binarize:min=4,max=4

πŸ‘‘ AUTHOR(s) πŸ‘‘

Gert Wollny


This software is Copyright (c) 1999‐2015 Leipzig, Germany and Madrid, Spain. It comes with ABSOLUTELY NO WARRANTY and you may redistribute it under the terms of the GNU GENERAL PUBLIC LICENSE Version 3 (or later). For more information run the program with the option --copyright.


And that's the whole page, bestie β€” every last crumb of it 🫢 This was the mia-2dimagefilterstack(1) page from the mia docs, version v2.4.7, filed under USER COMMANDS. Go forth and filter, you absolute icon πŸ’…βœ¨

πŸ“¦ where this page comes from