mia-2dsegm...cal-kmeans(1)
π mia-2dsegment-local-kmeans π
bestie. hi. come sit. this is a General Commands Manual page, section 1, and it's about mia-2dsegment-local-kmeans β a whole 2D image segmenter that lives in your terminal and does localized k-means. i'm gonna walk you through literally everything on the page, no skips, no "we'll come back to that", fr fr. β¨
πΈ NAME πΈ
mia-2dsegment-local-kmeans β Run a k-means segmentation of a 2D image.
like... that's the whole vibe. it segments. 2D. k-means. π
π SYNOPSIS π
mia-2dsegment-local-kmeans -i <in-file> [options]
you give it an input file, you stack options on top. that's the shape of every call you'll ever write, bestie.
π¦ DESCRIPTION π¦
okay so listen. mia-2dsegment-local-kmeans runs the segmentation of a 2D image by applying a localized k-means approach that helps to overcome intensity inhomogeneities in the image.
it's giving... glow-up for your image. the plan is this:
- The approach evaluates a global k-means clustering first. a little warm-up, a little opening number. π
- Then it separates the image into overlapping regions.
- Then more k-means iterations are run only including the locally present classes β that is, the classes that relatively contain more pixels than a given threshold.
so the local regions don't waste time on classes that barely show up there. iconic behavior, honestly. the intensity inhomogeneities never saw it coming. π
β¨ OPTIONS β¨
π File-IO
-i,--in-file=(input, required);ioβ the image to be segmented. This one is required, so like, don't forget it. For supported file types seePLUGINS:2dimage/io. π-o,--out-file=(output);ioβ class label image based on merging local labels. For supported file types seePLUGINS:2dimage/io. πΈ-O,--out-file2=(output);ioβ class label image based on classifying by using the interpolated class centers. For supported file types seePLUGINS:2dimage/io. β¨-D,--debug-centers=(output);ioβ Save the class center images to a debug file (type isdouble). 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.
ποΈ Parameters
-g,--grid-spacing=20;int in [3, inf)β Spacing of the grid used to modulate the intensity inhomogeneities. default is20, and it's an integer that has to be3or bigger (no upper bound). π₯-n,--nclasses=3;uint in [2, 127]β Number of intensity classes to segment. defaults to3, and the allowed range is2through127, unsigned ints only. π-t,--relative-cluster-threshold=0.0001;double in [0, 1)β Number of intensity classes to segment. yes bestie, the page literally says the same sentence as-ndoes, i'm just reporting what's on the page π. what's actually on the line is the value type: default0.0001, adoublein[0, 1)β so0is allowed,1is not.
βοΈ Processing
--threads=-1β Maxiumum number of threads to use for processing. (that spelling is the page's spelling, i am not touching it π) This number should be lower or equal to the number of logical processor cores in the machine. (-1: automatic estimation).
π PLUGINS: 2dimage/io π
these are all the file type plug-ins that the io fields above can reach for. each one has its own recognized extensions and element types. no cap, this list is long and every single one matters.
π 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
π₯ EXAMPLE π₯
Run the segmentation on image test.png using three classes, local regions of 40 pixels (grid width 20 pixels), and a class ignore threshold of 0.01.
mia-2dsegment-local-kmeans -i test.png -o label.png -n 3 -g 20 -t 0.01
that's it. that's the whole glow-up. hit enter and let her cook. π
π AUTHOR(s) π
Gert Wollny
πΈ COPYRIGHT πΈ
This software is Copyright (c) 1999β2015 Leipzig, Germany and Madrid, Spain. It comes with ABSOLUTELY NO WARRANTY and you may redistribute it under the terms of the GNU GENERAL PUBLIC LICENSE Version 3 (or later). For more information run the program with the option '--copyright'.
β οΈ ok genuine note bestie: ABSOLUTELY NO WARRANTY is not a vibe, it's a legal fact, and --copyright is the receipt. respect it. π
and that's the page!! thanks for reading the whole thing, you ate that. this was the USER COMMANDS section, version v2.4.7, dated as the original page is dated β mwah, love u, go segment something gorgeous. π«Άπβ¨ππ
π¦ where this page comes from
- ubuntu noble: mia-tools 2.4.7-13build4 Β· GPL-3.0-or-later
- ubuntu resolute: mia-tools 2.4.7-18 Β· GPL-3.0-or-later
- ubuntu stonking: mia-tools 2.4.7-19build1 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms