1 from smilPython
import *
4 imIn = Image(
"https://smil.cmm.minesparis.psl.eu/images/DNA_small.png")
10 imLbl = Image(imIn,
"UINT16")
28 print(
"Label\tarea\tvolume\tbarycenter (x,y)")
29 for lbl
in blobs.keys():
30 print(str(lbl) +
"\t" + str(areas[lbl]) +
"\t" + str(vols[lbl]) +
"\t" + str(barys[lbl]))
map< T, Vector_double > blobsBarycenter(const Image< T > &imLbl, const bool onlyNonZero=true)
blobsBarycenter() - Measure barycenter of a labeled image.
Definition: DBlobMeasures.hpp:209
map< labelT, double > blobsVolume(const Image< T > &imIn, map< labelT, Blob > &blobs)
blobsVolume() - Measure the sum of values of each blob in imIn.
Definition: DBlobMeasures.hpp:91
map< T, Blob > computeBlobs(const Image< T > &imIn, bool onlyNonZero=true)
Create a map of blobs from a labeled image.
Definition: DBlob.hpp:98
map< T, vector< size_t > > blobsBoundBox(const Image< T > &imLbl, const bool onlyNonZero=true)
blobsBoundBox() - Measure bounding boxes of labeled image.
Definition: DBlobMeasures.hpp:239
map< T, double > blobsArea(const Image< T > &imLbl, const bool onlyNonZero=true)
blobsArea() - Calculate the area of each region in a labeled image
Definition: DBlobMeasures.hpp:60
RES_T drawOverlay(const Image< T > &imToDraw, Image< T > &imOut)
Draw overlay.
Definition: DImage.hpp:516
RES_T drawRectangles(Image< T > &imOut, const map< MapT, vector< size_t >> &coordsVectMap, bool fill=false)
Draw a list of rectangles.
Definition: DImageDraw.hpp:197
RES_T threshold(const Image< T > &imIn, T minVal, T maxVal, T_out trueVal, T_out falseVal, Image< T_out > &imOut)
threshold() - Image threshold
Definition: DImageHistogram.hpp:269
size_t label(const Image< T1 > &imIn, Image< T2 > &imOut, const StrElt &se=DEFAULT_SE)
label() - Image labelization
Definition: DMorphoLabel.hpp:564