mia-2dseriesgradMAD(1)

πŸ“¦
version 2.4.7 Β· 4 versions
, in ubuntu resolute, ubuntu stonking

πŸ’– mia-2dseriesgradMAD πŸ’–

okay bestie, so this one lives in the General Commands Manual, section 1. Pull up a chair, grab a boba, we're doing this. πŸ§‹βœ¨


✨ NAME ✨

mia-2dseriesgradMAD β€” calculate the time-intensity gradient MAD across a whole series of images. literally what it says on the tin, no cap. πŸ¦‹


🌸 SYNOPSIS 🌸

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

πŸ’… DESCRIPTION πŸ’…

okay so mia-2dseriesgradMAD takes a stack of images that happen in temporal succession β€” like, a lil movie of images β€” and it works out the pixel-wise temporal gradient. then it goes and computes the median average distance (MAD) of that, and saves the whole thing out as an image. πŸ’Ύ

and the best part? if you want, you can slap on spatial pre-filtering by adding extra plugin(s) from filter/2dimage and it will run those first. main character energy fr fr. ✨


πŸ‘‘ OPTIONS πŸ‘‘

  • -i, --in-file=(input, required); string β€” the input segmentation set. this is required, bestie, it's not optional, it's the whole point. 🌸
  • -o, --out-file=(output, required); io β€” output file name. also required. for the file types that actually work, go peek at PLUGINS:2dimage/io πŸ’Ύ
  • -k, --skip=0 β€” skip files at the beginning. like, don't even look at the first few, they're not invited. πŸ™ˆ
  • -e, --enlarge-boundary=5 β€” enlarge the cropbox by this many pixels. personal space, but bigger. πŸŽ€
  • -c, --crop β€” crop the image before running the statistics. βœ‚οΈ

🫢 Help & Info

  • -V, --verbose=warning β€” verbosity of output; it prints messages of the given level and anything with higher priority. the supported priorities, starting from 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 β€” prints the copyright info. legal era πŸ’…
  • -h, --help β€” print this help. we love a self-aware icon.
  • -?, --usage β€” print a short help. the tl;dr version.
  • --version β€” print the version number and dip. πŸšͺ✨

πŸ”₯ Processing

  • --threads=-1 β€” maximum number of threads to use for processing. this number should be lower than or equal to the number of logical processor cores in the machine. (-1: automatic estimation β€” just let it figure itself out, it's a big kid.) ⚑

🌈 PLUGINS: 1d/spacialkernel 🌈

cdiff

Central difference filter kernel β€” mirror boundary conditions are used. no thoughts, just vibes.

(no parameters)

gauss

spacial Gauss filter kernel. the supported parameters are:

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

scharr

This plugin provides the 1D folding kernel for the Scharr gradient filter.

(no parameters)


πŸ¦‹ PLUGINS: 1d/splinekernel πŸ¦‹

bspline

B-spline kernel creation. the supported parameters are:

  • d = 3; int in [0, 5] β€” Spline degree. ✨

omoms

OMoms-spline kernel creation. the supported parameters are:

  • d = 3; int in [3, 3] β€” Spline degree.

πŸ’œ PLUGINS: 2dimage/combiner πŸ’œ

absdiff

Image combiner absdiff.

(no parameters)

add

Image combiner add.

(no parameters)

div

Image combiner div.

(no parameters)

mul

Image combiner mul.

(no parameters)

sub

Image combiner sub.

(no parameters)


πŸŽ€ PLUGINS: 2dimage/filter πŸŽ€

okay this is the big one, the main event, the whole buffet. buckle up. πŸ“

adaptmed

2D image adaptive median filter. the supported parameters are:

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

admean

An adaptive mean filter that works like a normal mean filter, if the intensity variation within the filter mask is lower 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. the supported parameters are:

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

aniso

2D Anisotropic image filter. the supported parameters are:

  • epsilon = 1; float in (0, inf) β€” iteration change threshold.
  • iter = 100; int in [1, 10000] β€” number of iterations.
  • k = -1; float in [0, 100] β€” k the noise threshold (<=0 -> adaptive).
  • n = 8; set β€” neighbourhood. supported values are: ( 4, 8, )
  • psi = tuckey; dict β€” edge stopping function. supported values are:
    • tuckey ‐ tukey stopping function
    • pm1 ‐ stopping function 1
    • guess ‐ test stopping function
    • pm2 ‐ stopping function 2

bandpass

intensity bandpass filter. the supported parameters are:

  • max = 3.40282e+38; float β€” maximum of the band.
  • min = 0; float β€” minimum of the band.

binarize

image binarize filter. the supported parameters are:

  • max = 3.40282e+38; float β€” maximum of accepted range.
  • min = 0; float β€” minimum of accepted range.

close

morphological close. the 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. the 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. the 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. the supported parameters are:

  • end = [[-1,-1]]; streamable β€” end of crop region.
  • start = [[0,0]]; streamable β€” start of crop region.

dilate

2d image stack dilate filter. the 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. the supported parameters are:

  • b = [[1,1]]; 2dbounds β€” blocksize.
  • bx = 1; uint in [1, inf) β€” blocksize in x direction.
  • by = 1; uint in [1, inf) β€” blocksize in y direction.
  • kernel = gauss; factory β€” smoothing filter kernel to be applied, 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. the 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. the supported parameters are:

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

gradnorm

2D image to gradient norm filter. the supported parameters are:

  • normalize = 0; bool β€” Normalize the gradient norms to range [0,1]..

invert

intensity invert filter

(no parameters)

kmeans

2D image k-means filter. In the output image the pixel value represents the class membership and the class centers are stored as attribute in the image. the supported parameters are:

  • c = 3; int in [2, inf) β€” number of classes.

label

Label connected components in a binary 2D image. the supported parameters are:

  • n = 4n; factory β€” Neighborhood mask to describe connectivity.. for supported plug-ins see PLUGINS:2dimage/shape

labelmap

Image filter to remap label id's. Only applicable to images with integer valued intensities/labels. the supported parameters are:

(picking up right where we left off β€” last param of the filter we were just vibing with πŸ’…)

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

✨ labelscale ✨

this one is picky in the best way: it only creates output voxels that are already created in the input image. the scaling is done with a voting algorithm β€” it picks the target pixel value based on whichever label has the highest pixel count in the corresponding source region πŸ—³οΈ.

and if that region has two labels with the same count? the one with the lower number wins. no tiebreakers, no drama, periodt.

supported parameters are:

  • out-size =(required, 2dbounds) β€” target size given as two coma separated values.

πŸ“₯ load

does exactly what it says on the tin: it loads the input image from a file and uses it to replace the current image in the pipeline. swap-in, no notes πŸ”„

supported parameters are:

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

🎭 mask

2D masking, and one of the two input images must be of type bit. yes, that's a requirement, not a suggestion bestie 🫢

supported parameters are:

  • fill = min; dict β€” fill style for pixels outside of the mask. supported values are:
    • min β€” set values outside the mask to the minimum value found in the image.
    • zero β€” set the values outside the mask to zero.
    • max β€” set the values outside the mask to the maximum value found in the image.
  • input =(input, required, io) β€” second input image file name. for supported file types see PLUGINS:2dimage/io
  • inverse = 0; bool β€” set to true to use the inverse of the mask for masking. flip it and reverse it πŸ”ƒ

🌊 maxflow

this filter uses the max-flow min-cut algorithm for image segmentation. graph theory said let her cook 😀

supported parameters are:

  • sink-flow =(input, required, io) β€” image of float type to define the per-pixel flow to the sink. for supported file types see PLUGINS:2dimage/io
  • source-flow =(input, required, 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. smooth, simple, iconic.

supported parameters are:

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

πŸ“Š meanvar

a filter that evaluates simultaneously the pixel-wise mean and the variance of an image in a given window. pixel intensities below the given thresh get ignored, and at their locations the output mean and variation are set to zero.

the mean intensity image is passed directly into the pipeline as a float image ✨, and the variation image gets saved to a file you name with the varfile parameter.

supported parameters are:

  • thresh = 0; double in [0, inf) β€” intensity thresholding parameter: pixels with intensities below this threshold will be set to zero, and also not used when evaluating mean and variation.
  • varfile =(output, required, io) β€” name of the output file to save the variation image too. for supported file types see PLUGINS:2dimage/io
  • w = 1; uint in [1, inf) β€” filter width parameter.

🎯 median

2D image median filter. the mean's chill, unbothered cousin.

supported parameters are:

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

πŸ¦‹ medianmad

this one 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 get ignored, and at their locations the output median and MAD are set to zero.

the median intensity image is passed directly to the pipeline, and the variation image gets saved to a file you give it with the varfile parameter. both output images have the same pixel type as the input image β€” consistency queen πŸ‘‘

supported parameters are:

  • madfile =(output, required, io) β€” name of the output file to save the median absolute deviation image too. 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.

supported parameters are:

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

🌈 ngfnorm

2D image to normalized-gradient-field-norm filter. just vibes and math, no knobs to turn.

  • (no parameters)

πŸ“» noise

2D image noise filter: add additive or modulated noise to an image. chaos, but make it configurable πŸŽ€

supported parameters are:

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

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

βœ‚οΈ pruning

Morphological pruning. and head's up: pruning until convergence will erase all pixels but closed loops. that's the whole point, but bestie, know what you're signing up for πŸ’€

supported parameters are:

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

🌱 regiongrow

region growing starting from a seed, but only along increasing gradients. it grows where the math says it may πŸ“ˆ

supported parameters are:

  • n = 8n; factory β€” neighborhood shape. for supported plug-ins see PLUGINS:2dimage/shape
  • seed =(input, required, io) β€” seed image (bit valued). for supported file types see PLUGINS:2dimage/io

πŸ§‚ sandp

salt and pepper 3d filter. (yes, it says 3d on a 2d image filter page. we don't ask questions, we just report the facts 🫑)

supported parameters are:

  • thresh = 100; float in (0, inf) β€” thresh value.
  • w = 1; int in [1, inf) β€” filter width parameter.

πŸ” scale

2D image downscale filter. make it smol but keep it pretty.

supported parameters are:

  • 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. main character energy, literally: only the biggest component survives.

  • (no parameters)

🧡 sepconv

2D image intensity separable convolution filter.

supported parameters are:

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

supported parameters are:

  • 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. ⚠️ important 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. do that little prep step, your results will thank you πŸ’–

supported parameters are:

  • 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. and the background (0)? not touched. it stays exactly where it is πŸ™ˆ

  • (no parameters)

πŸ’§ sws

seeded watershed. the algorithm extracts exactly so many regions as initial labels are given in the seed image β€” one label in, one region out, that's the deal.

supported parameters are:

  • grad = 0; bool β€” interpret the input image as gradient.
  • mark = 0; bool β€” mark the segmented watersheds with a special gray scale value.
  • n = [sphere:r=1]; factory β€” neighborhood for watershed region growing. for supported plug-ins see PLUGINS:2dimage/shape
  • seed =(input, required, string) β€” seed input image containing the labels for the initial regions.

πŸ«– tee

save the input image to a file and also pass it through to the next filter. both. it does both. that's the whole serve ✨

supported parameters are:

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

🦴 thinning

Morphological thinning. and fyi: thinning until convergence will result in a 8-connected skeleton. bones but make it topology 🩻

supported parameters are:

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

🚦 thresh

this filter sets all pixels of an image to zero that fall below a certain threshold and whose neighbours in a given neighborhood shape also fall below this threshold. two conditions, both gotta be true, no exceptions πŸ”₯

supported parameters are:

  • 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. selective, lowkey πŸ’…

supported parameters are:

  • t = 0; float β€” threshold for pixels not to take into account.
  • w = 1; int in [1, inf) β€” half filter width.
  • transform β€” Transform the input image with the given transformation. Supported parameters are:
    • file =(input, required, io) β€” Name of the file containing the transformation. For supported file types see PLUGINS:2dtransform/io.
  • ws β€” basic watershead segmentation (yes, that spelling, we love a typo). Supported parameters are:
    • evalgrad = 0; bool β€” Set to 1 if the input image does not represent a gradient norm image.
    • mark = 0; bool β€” Mark the segmented watersheds with a special gray scale value.
    • n = [sphere:r=1]; factory β€” Neighborhood for watershead region growing. For supported plug-ins see PLUGINS:2dimage/shape.
    • thresh = 0; float in [0, 1) β€” Relative gradient norm threshold. The actual value threshold value is thresh * (max_grad - min_grad) + min_grad. Bassins separated by gradients with a lower norm will be joined.

✨ PLUGINS: 2dimage/io ✨

  • bmp β€” BMP 2D-image input/output support. The plug-in supports reading and writing of binary images and 8-bit gray scale images. Read-only support is provided for 4-bit gray scale images. The color table is ignored and the pixel values are taken as literal gray scale values.
    • Recognized file extensions: .BMP, .bmp
    • Supported element types: binary data, unsigned 8 bit
  • datapool β€” Virtual IO to and from the internal data pool.
    • Recognized file extensions: .@
  • dicom β€” 2D image io for DICOM.
    • Recognized file extensions: .DCM, .dcm
    • Supported element types: signed 16 bit, unsigned 16 bit
  • exr β€” a 2dimage io plugin for OpenEXR images.
    • Recognized file extensions: .EXR, .exr
    • Supported element types: unsigned 32 bit, floating point 32 bit
  • jpg β€” a 2dimage io plugin for jpeg gray scale images.
    • Recognized file extensions: .JPEG, .JPG, .jpeg, .jpg
    • Supported element types: unsigned 8 bit
  • png β€” a 2dimage io plugin for png images.
    • Recognized file extensions: .PNG, .png
    • Supported element types: binary data, unsigned 8 bit, unsigned 16 bit
  • raw β€” RAW 2D-image output support.
    • Recognized file extensions: .RAW, .raw
    • Supported element types: binary data, signed 8 bit, unsigned 8 bit, signed 16 bit, unsigned 16 bit, signed 32 bit, unsigned 32 bit, floating point 32 bit, floating point 64 bit
  • tif β€” TIFF 2D-image input/output support.
    • Recognized file extensions: .TIF, .TIFF, .tif, .tiff
    • Supported element types: binary data, unsigned 8 bit, unsigned 16 bit, unsigned 32 bit
  • vista β€” a 2dimage io plugin for vista images.
    • Recognized file extensions: .-, .V, .VISTA, .v, .vista
    • Supported element types: binary data, signed 8 bit, unsigned 8 bit, signed 16 bit, unsigned 16 bit, signed 32 bit, unsigned 32 bit, floating point 32 bit, floating point 64 bit

πŸ¦‹ PLUGINS: 2dimage/shape πŸ¦‹

  • 1n β€” A shape that only contains the central point.
    • (no parameters)
  • 4n β€” 4n neighborhood 2D shape.
    • (no parameters)
  • 8n β€” 8n neighborhood 2D shape.
    • (no parameters)
  • rectangle β€” rectangle shape mask creator. Supported parameters are:
    • fill = 1; bool β€” create a filled shape.
    • height = 2; int in [1, inf) β€” height of rectangle.
    • width = 2; int in [1, inf) β€” width of rectangle.
  • sphere β€” Closed spherical neighborhood shape of radius r. Supported parameters are:
    • r = 2; float in (0, inf) β€” sphere radius.
  • square β€” square shape mask creator. Supported parameters are:
    • fill = 1; bool β€” create a filled shape.
    • width = 2; int in [1, inf) β€” width of rectangle.

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

  • bbs β€” Binary (non-portable) serialized IO of 2D transformations.
    • Recognized file extensions: .bbs
  • datapool β€” Virtual IO to and from the internal data pool.
    • Recognized file extensions: .@
  • vista β€” Vista storage of 2D transformations.
    • Recognized file extensions: .v2dt
  • xml β€” XML serialized IO of 2D transformations.
    • Recognized file extensions: .x2dt

🌈 PLUGINS: generator/noise 🌈

  • gauss β€” This noise generator creates random values that are distributed according to a Gaussien distribution by using the Box-Muller transformation. Supported parameters are:
    • mu = 0; float β€” mean of distribution.
    • seed = 0; uint in [0, inf) β€” set random seed (0=init based on system time).
    • sigma = 1; float in (0, inf) β€” standard derivation of distribution.
  • uniform β€” Uniform noise generator using C stdlib rand(). Supported parameters are:
    • a = 0; float β€” lower bound if noise range.
    • b = 1; float β€” higher bound if noise range.
    • seed = 0; uint in [0, inf) β€” set random seed (0=init based on system time).

πŸŽ€ EXAMPLE πŸŽ€

Evaluate the MAD-image of the bounding box surrounding the segmentation from a series segment.set. No spacial filtering will be applied. The bounding box will be enlarged by 3 pixels in all directions. Store the image in OpenEXR format.

mia-2dseriesgradMAD  -i segment.set -o mad.exr -c -e 3

πŸ‘‘ 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.


Okay bestie, that's the whole page. This was mia-2dseriesgradMAD(1) from MIA v2.4.7 β€” no date in the footer, but the vibe is timeless. πŸ’…βœ¨

πŸ“¦ where this page comes from