From 8ad511dfb51be0134831dfb008ac551354f2dfa6 Mon Sep 17 00:00:00 2001 From: dlegland Date: Mon, 15 Apr 2024 14:10:55 +0200 Subject: [PATCH] user manual: add interpretation of geodesic distance maps --- doc/MorphoLibJ-manual/MorphoLibJ-manual.lyx | 205 +++++++++++++++++- .../images/binary/geodDist_interp_input.png | Bin 0 -> 803 bytes .../images/binary/geodDist_interp_res.png | Bin 0 -> 1034 bytes .../binary/geodDist_interp_res_annot.png | Bin 0 -> 6119 bytes 4 files changed, 198 insertions(+), 7 deletions(-) create mode 100644 doc/MorphoLibJ-manual/images/binary/geodDist_interp_input.png create mode 100644 doc/MorphoLibJ-manual/images/binary/geodDist_interp_res.png create mode 100644 doc/MorphoLibJ-manual/images/binary/geodDist_interp_res_annot.png diff --git a/doc/MorphoLibJ-manual/MorphoLibJ-manual.lyx b/doc/MorphoLibJ-manual/MorphoLibJ-manual.lyx index f4d4df33..4da6d6d0 100644 --- a/doc/MorphoLibJ-manual/MorphoLibJ-manual.lyx +++ b/doc/MorphoLibJ-manual/MorphoLibJ-manual.lyx @@ -13629,6 +13629,7 @@ reference "fig:Geodesic-Distance-Map-3d" \end_inset . + \end_layout \begin_layout Standard @@ -13740,13 +13741,6 @@ literal "true" \end_layout -\begin_layout Standard -Geodesic distance maps are computed by propagating chamfer weights, as for - the computation of distance maps. - As chamfer weights are only an approximation of the real Euclidean distance, - some differences are expected compared to the actual geodesic distance. -\end_layout - \begin_layout Standard \begin_inset Float figure wide false @@ -13788,6 +13782,10 @@ Computation of the geodesic distance map on a 3D binary image. \end_layout +\begin_layout Subsubsection +Plugins +\end_layout + \begin_layout Minisec Geodesic Distance Map \end_layout @@ -13864,6 +13862,199 @@ reference "fig:Geodesic-Distance-Map-3d" Binary image is assumed to have cubic voxels. \end_layout +\begin_layout Subsubsection +Results interpretation +\end_layout + +\begin_layout Standard +Geodesic distance transforms plugins result in images that contains the + geodesic distance of foreground pixels or voxels, but also background pixels/vo +xels of the mask. + Also, some regions may not be reacheable by the propagation algorithm. + +\end_layout + +\begin_layout Standard +\begin_inset Float figure +wide false +sideways false +status open + +\begin_layout Plain Layout +\align center +\begin_inset Float figure +wide false +sideways false +status open + +\begin_layout Plain Layout +\align center +\begin_inset Graphics + filename images/binary/geodDist_interp_input.png + width 40text% + +\end_inset + + +\end_layout + +\begin_layout Plain Layout +\begin_inset Caption Standard + +\begin_layout Plain Layout +Input marker and mask images. +\end_layout + +\end_inset + + +\end_layout + +\end_inset + + +\begin_inset Float figure +wide false +sideways false +status open + +\begin_layout Plain Layout +\align center +\begin_inset Graphics + filename images/binary/geodDist_interp_res_annot.png + width 40text% + +\end_inset + + +\end_layout + +\begin_layout Plain Layout +\begin_inset Caption Standard + +\begin_layout Plain Layout +Geodesic Distance Map. +\end_layout + +\end_inset + + +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Plain Layout +\begin_inset Caption Standard + +\begin_layout Plain Layout +\begin_inset CommandInset label +LatexCommand label +name "fig:Interpretation-Geodesic-Distance-Map" + +\end_inset + +Interpretation of geodesic distance maps. + (a) Input marker (magenta) and mask images (green). + Overlay of marker and mask is shown in black. + (b) Geodesic Distance Map. + Numeric values correspond to distances (values are rounded for readability). + Non-reacheable components are set to +infinity. + Background of original mask is set to NaN. + +\end_layout + +\end_inset + + +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard +Values in geodesic distance maps can be interpreted this way: +\end_layout + +\begin_layout Itemize +0: the pixel is contained both within the original marker and mask images + (distance is zero by definition) +\end_layout + +\begin_layout Itemize +numerical value: the value corresponds to the length of the path that joins + the current pixel or voxel to the closest pixel or voxel belonging to the + mask. + +\end_layout + +\begin_layout Itemize +NaN: the pixel/voxel does not belong to the mask, and is not considered + during propagation. +\end_layout + +\begin_layout Itemize +“Infinity”, or very large value: the pixel does belong to the mask, but + can not be reached by propagation. + This corresponds to the case where the mask is composed of several components. +\end_layout + +\begin_layout Standard +Geodesic distance maps are computed by propagating chamfer weights, as for + the computation of distance maps. + As chamfer weights are only an approximation of the real Euclidean distance, + some differences are expected compared to the actual geodesic distance. + +\end_layout + +\begin_layout Standard +When computation are performed with integers, special values like Inf or + Nan can not be represented. + In these cases, they are replaced by the largest possible value for 16-bits + unsigned integer type. + +\end_layout + +\begin_layout Subsubsection +Algorithms +\end_layout + +\begin_layout Standard +Various algorithms are decribed in +\begin_inset CommandInset citation +LatexCommand citet +key "Soille_2003" +literal "false" + +\end_inset + +. + The simplest one consists in iterating forward and backward passes that + update the result map according to the neighbors pixels, until no more + modification occurs. + An alternative is to propagate the distance maps from the pixels within + the markers using a priority queue. + +\end_layout + +\begin_layout Standard +The MorphoLibJ plugins use an hybrid algorithm, that initializes the distance + map by a single sequence of forward and backward passes, and initializes + the queue during the backward pass. + This reduces the amount of memory required by the priority queue. +\end_layout + +\begin_layout Standard +\begin_inset Newpage newpage +\end_inset + + +\end_layout + \begin_layout Section Connected component labeling \end_layout diff --git a/doc/MorphoLibJ-manual/images/binary/geodDist_interp_input.png b/doc/MorphoLibJ-manual/images/binary/geodDist_interp_input.png new file mode 100644 index 0000000000000000000000000000000000000000..dd7b10c3845c2b3f3add8b27dcd3de10813251da GIT binary patch literal 803 zcmeAS@N?(olHy`uVBq!ia0y~yVAKJ!PjD~+$-8^KffUm#PZ!6Kid%25H1akmh&Ug7 zx4+~rWE@B!wvoQ&<+VEL7o8N0#|$>bmNX#Eu}~67J7ur|X$pmR)f#i0RWJb)%>qs!y5#~7 zkbdtFk$J(MbD=_ufD_O{+E4*aV8dAyTYwBsCk|FcU|0xnIROJfQKSXvdnXMJ#W_D4 zZ6gGnI23^{p(gS0*Ua5}WU`*0p{}tAXC|)StxZh_LrpF?01Pj%n}LA_Hs29q3pkR1 z%mAn`FzmqUfFTK12MkxR05FtMw7=ZV&W$tlrzn8T(*P#{EYWo-+O}o$mN#DyN7w=r OKZB>MpUXO@geCx={?JGO literal 0 HcmV?d00001 diff --git a/doc/MorphoLibJ-manual/images/binary/geodDist_interp_res.png b/doc/MorphoLibJ-manual/images/binary/geodDist_interp_res.png new file mode 100644 index 0000000000000000000000000000000000000000..9a0940dcf9eeb8aa7557c8b26d577e5c62b056d1 GIT binary patch literal 1034 zcmZ{j{ZkJH9LHa+I$erfQ)YSjPBB*K0^Pw52Eq_<0v8wulfVdgf;Sjn_(PxxL1u(@VW}m{ ztqHebwJni$MD=CM+r-$j(}6fg;)k+tI0r_MK#<=;&vRj zexPhGB?%Pmr!bNH1LPdSki@xUvX7E^jIAX*;^Cm&>g_&K3QgZVwn%`Oc6#g9leT+Sd&2e|LEAx)D9=N7^)eXw~?!#l11+ z_dhXvFy8c^Nv4n7-)fp_((GaK*o!AKc{-a`U!ME(B7m0*Xj?>k2px;*SVG4#I>YE( zLFX#og!ASrv>L5Nk!S;oLSLiJXe)|FF(?-8M7z*;C=TsG@n|nfK>JZ5`UxFGhtUy~ zjE7$?EV_r;pwQ zNFmZPDO`$_HcPS6ZfU=iB%P4brC+5SsZhEhRZ4YIqx3*(l3Juz>812q|1)hJksFK# zT=j6DlV1_@kN7ETy%7Fc0t0T5pj7Rcx2qm%*e<{G!(y#@7~wa_0_!2Q8BSbz|q0snWKGq WKyO+jY@Gjd+GC2h`{~I+TmA*1EbE*A literal 0 HcmV?d00001 diff --git a/doc/MorphoLibJ-manual/images/binary/geodDist_interp_res_annot.png b/doc/MorphoLibJ-manual/images/binary/geodDist_interp_res_annot.png new file mode 100644 index 0000000000000000000000000000000000000000..f230a92f50661d23c11b3936abf40f62b6385805 GIT binary patch literal 6119 zcmb7|cTiK^y2cd*H&RUKAT6K-5kx>lL|SOldvBshN2GW7fQ^83B28(bgHnVD5}HJ+ z6a&($pp;M|9Rz_J{ASLa@1Ar2xHD_^UNd{`S>=7!Z$0md*49*}zQlUz+_`hqDi0KN z&z(CjK&*EGB*f=*lN#~GRH33Er|&zlK27OKXK-?HwUp*BKn2+<^FOGSlE(&r8G#FT)KQ%Siky}gMKN2*4my0#D41)Z~AWu}S zVsxfEYC#UY(zN5<*UVM_ydOZw@TgzRe%2d!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