mia-2dimagefilter(1)

๐Ÿ“ฆ
version 2.4.7 ยท 3 versions
, in debian bookworm, ubuntu jammy

๐Ÿ’– 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 see PLUGINS:2dimage/io.
  • -o, --out-file=(required, output); io โ€” output image(s) that have been filtered. For supported file types see PLUGINS: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 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).

๐Ÿงš 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 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 =(required, input, 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 โ€” Neighborhood mask to describe connectivity.. For supported plug-ins see PLUGINS: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 see PLUGINS: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 see PLUGINS:2dimage/io.
  • inverse = 0; bool โ€” set to true to 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 of float type to define the per-pixel flow to the sink. For supported file types see PLUGINS:2dimage/io.
  • source-flow =(required, input, io) โ€” image of float type to define the per-pixel flow to the source. For supported file types see PLUGINS: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 see PLUGINS: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 see PLUGINS: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 see PLUGINS: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 see PLUGINS: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 see PLUGINS:2dimage/shape.
  • seed =(required, input, io) โ€” seed image (bit valued). For supported file types see PLUGINS: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 see PLUGINS: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 see PLUGINS:1d/spacialkernel.
  • ky = [gauss:w=1]; factory โ€” filter kernel in y-direction. For supported plug-ins see PLUGINS:1d/spacialkernel.

๐Ÿš shmean

2D image filter that evaluates the mean over a given neighborhood shape.

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

๐ŸŒ€ sobel

The 2D Sobel filter for gradient evaluation. 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-direction
    • y โ€” gradient in y-direction

๐Ÿ”ค sort-label

This plug-in sorts the labels of a gray-scale image so that the lowest label value corresponds to the label with the most pixels. The background (0) is not touched.

  • (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 see PLUGINS: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 see PLUGINS: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 see PLUGINS: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 at PLUGINS:2dtransform/io ๐Ÿฆ‹
  • ws โ€” basic watershed segmentation, periodt. Its parameters:
    • evalgrad = 0; bool โ€” flip this to 1 if 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 at 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 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
  • datapool โ€” virtual IO to and from the internal data pool. it's the ~internal~ one ๐Ÿซถ
    • 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
  • 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. iconic, obviously ๐ŸŽ€
    • Recognized file extensions: .PNG, .png
    • Supported element types:
      • binary data
      • unsigned 8 bit
      • unsigned 16 bit
  • 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
  • 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. 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 radius r, 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, the square plug-in calls its size parameter width and 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
  • 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. readable, unlike some people ๐Ÿ˜ญ
    • Recognized file extensions: .x2dt

โœจ 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 stdlib rand(). 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 ๐Ÿ’œ


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