1 #ifndef _DMORPHO_PATH_OPENING_H_
2 #define _DMORPHO_PATH_OPENING_H_
4 #include "Core/include/DCore.h"
20 template <
class T1,
class T2>
30 template <
typename T1,
typename T2>
34 ASSERT_ALLOCATED(&imIn)
35 ASSERT_SAME_SIZE(&imIn, &imOut)
38 RES_T res =
inv(imIn, imNeg);
44 return inv(imOut, imOut);
54 RES_T
ImPathOpening(
const Image<UINT8> &imIn,
const UINT32 Lenght,
67 ASSERT_ALLOCATED(&imIn)
68 ASSERT_SAME_SIZE(&imIn, &imOut)
70 RES_T res =
inv(imIn, imNeg);
76 return inv(imOut, imOut);
87 template <
class T1,
class T2>
89 Image<T2> &imIndicatrice,
int stop,
99 template <
typename T1,
typename T2>
101 Image<T2> &imInd,
int stop,
int lambdaAttribute)
103 ASSERT_ALLOCATED(&imIn)
104 ASSERT_SAME_SIZE(&imIn, &imTrans)
105 ASSERT_SAME_SIZE(&imIn, &imInd)
107 RES_T res =
inv(imIn, imNeg);
113 return inv(imTrans, imTrans);
123 template <
class T1,
class T2>
125 const UINT32 Slice, Image<T2> &imOut);
134 template <
typename T1,
typename T2>
138 ASSERT_ALLOCATED(&imIn)
139 ASSERT_SAME_SIZE(&imIn, &imOut)
141 RES_T res =
inv(imIn, imNeg);
147 return inv(imOut, imOut);
160 template <
typename T>
162 int Method, Image<T> &imOut,
float ScaleX = 1,
163 float ScaleY = 1,
float ScaleZ = 1);
175 template <
typename T>
177 int Method,
Image<T> &imOut,
float ScaleX = 1,
178 float ScaleY = 1,
float ScaleZ = 1)
180 ASSERT_ALLOCATED(&imIn)
181 ASSERT_SAME_SIZE(&imIn, &imOut)
183 RES_T res =
inv(imIn, imNeg);
190 return inv(imOut, imOut);
206 template <
typename T>
208 Image<UINT8> &imTrans, Image<T> &imInd,
209 float ScaleX = 1,
float ScaleY = 1,
210 float ScaleZ = 1,
int stop = -1,
211 int lambdaAttribute = 0,
int takeMin = 1);
226 template <
typename T>
229 Image<T> &imIndicatrice,
float ScaleX = 1,
230 float ScaleY = 1,
float ScaleZ = 1,
231 int stop = -1,
int lambdaAttribute = 0,
234 ASSERT_ALLOCATED(&imIn)
235 ASSERT_SAME_SIZE(&imIn, &imTrans)
236 ASSERT_SAME_SIZE(&imIn, &imIndicatrice)
238 RES_T res =
inv(imIn, imNeg);
242 ScaleY, ScaleZ, stop, lambdaAttribute,
246 return inv(imTrans, imTrans);
256 template <
typename T1,
typename T2>
258 int sliceBySlice = 0,
259 double dz_over_dx = 1);
268 template <
typename T1,
typename T2>
270 int sliceBySlice = 0,
271 double dz_over_dx = 1);
279 template <
typename T1,
typename T2>
288 template <
typename T1,
typename T2>
298 template <
typename T1,
typename T2>
308 template <
typename T1,
typename T2>
310 int sliceBySlice = 0,
double dz_over_dx = 1);
333 template <
typename T1,
typename T2>
335 Image<T1> &imTrans, Image<T2> &imInd,
336 int stop = -1,
int lambdaAttribute = 0);
345 template <
typename T1,
typename T2>
348 int stop = -1,
int lambdaAttribute = 0)
350 ASSERT_ALLOCATED(&imIn)
351 ASSERT_SAME_SIZE(&imIn, &imTrans)
352 ASSERT_SAME_SIZE(&imIn, &imInd)
354 RES_T res =
inv(imIn, imNeg);
361 return inv(imTrans, imTrans);
369 template <
typename T>
378 template <
typename T>
382 ASSERT_ALLOCATED(&imIn)
383 ASSERT_SAME_SIZE(&imIn, &imOut)
385 RES_T res =
inv(imIn, imNeg);
391 return inv(imOut, imOut);
401 template <
class T1,
class T2>
404 int SliceBySlice = 0);
412 template <
class T1,
class T2>
414 float paramSigma = 1);
423 template <
class T1,
class T2>
433 template <
class T1,
class T2>
435 Image<T2> &imIndicatriceCorr,
float percentage);
444 template <
class T1,
class T2>
446 const Image<T1> &imSk, Image<T2> &imOut);
453 template <
class T1,
class T2>
468 int nbElt,
float ScaleX,
float ScaleY,
478 RES_T
ImFalseColorHSL(
const Image<T> &imIn, Image<RGB> &imOut,
float Scale);
481 RES_T CountNbCCperThreshold(
const Image<T> &imIn,
int *NbCC,
int Invert = 0);
484 RES_T CountNbPixelOfNDG(
const Image<T> &imIn,
int NDG,
int *NbPixel);
486 template <
class T1,
class T2>
487 RES_T measComputeVolume(
const Image<T1> &imIn,
const Image<T2> &imLevel,
490 template <
class T1,
class T2>
491 RES_T measComputeIndFromPatternSpectrum(
const Image<T1> &imTrans,
492 const Image<T2> &imInd,
493 UINT16 BorneMin, UINT16 BorneMax,
494 UINT8 Normalized,
float *Value);
496 template <
class T1,
class T2>
497 RES_T ImFromSK_AreaForEachCC(
const Image<T1> &imIn,
int ScaleX,
int ScaleY,
498 int ScaleZ, Image<T2> &imOut);
501 RES_T MeanValueOf(
const Image<T> &imIn,
bool slideBySlide,
double *Value);
504 template <
class T1,
class T2>
505 RES_T GetConfusionMatrix(
const Image<T1> &imMask,
const Image<T2> &imIn2,
506 int seuil,
int *FP,
int *FN,
int *TP,
int *TN,
507 Image<RGB> &imOut,
int WantImOut = 1);
510 template <
class T1,
class T2>
511 RES_T ImLayerDist(Image<T1> &imIn,
int labelIn,
int labelOut,
float dx,
512 float dy,
float dz, Image<T2> &imOut);
518 #include "MorphoPathOpening/morphoPathOpening.hpp"
519 #include "MorphoPathOpening/morphoGeodesicPathOpening.hpp"
521 #include "MorphoPathOpening/morphoPathOpeningGraphV2.hpp"
522 #include "MorphoPathOpening/PO_Utilities.hpp"
RES_T ImFromSkeletonSupTriplePoint(const Image< T1 > &imIn, Image< T2 > &imOut)
ImFromSkeletonSupTriplePoint : Suppress the triples points from a skeleton.
Definition: PO_Utilities.hpp:705
RES_T ImLabelFlatZonesWithElongation(const Image< T1 > &imIn, Image< T2 > &imOut)
ImLabelFlatZonesWithElongation : we compute the elongation for each flat zone in a gray scale image.
Definition: morphoGeodesicPathOpening.hpp:840
RES_T ImBinaryPathOpening(const Image< T1 > &imIn, const UINT32 Lenght, const UINT32 Slice, Image< T2 > &imOut)
Binary Path Opening Operation.
Definition: morphoPathOpening.hpp:1002
RES_T ImBinaryPathClosing(const Image< T1 > &imIn, const UINT32 Lenght, const UINT32 Slice, Image< T2 > &imOut)
Binary Path Closing Operation.
Definition: DMorphoPathOpening.h:135
RES_T ImPathOpeningBruteForce(const Image< T1 > &imIn, const UINT32 Lenght, Image< T2 > &imOut)
Grayscale Path Opening Operation made by "staking" the results of the binary opening applied to each ...
Definition: morphoPathOpening.hpp:215
RES_T ImGeodesicExtremities(const Image< T1 > &imIn, Image< T2 > &imOut, int sliceBySlice=0, double dz_over_dx=1)
ImGeodesicExtremities : we compute the elongation for each CC.
Definition: morphoGeodesicPathOpening.hpp:774
RES_T ImGeodesicElongation(const Image< T1 > &imIn, Image< T2 > &imOut, int sliceBySlice=0, double dz_over_dx=1)
ImGeodesicElongation : we compute the elongation for each CC.
Definition: morphoGeodesicPathOpening.hpp:717
RES_T ImGeodesicPathOpening(const Image< UINT8 > &imIn, double Lenght, int Method, Image< T > &imOut, float ScaleX=1, float ScaleY=1, float ScaleZ=1)
ImGeodesicPathOpening : Compute the geodesic diameter for each connected component CC for each thresh...
Definition: morphoGeodesicPathOpening.hpp:502
RES_T ImSupSmallRegion(const Image< T1 > &imIndicatrice, Image< T2 > &imIndicatriceCorr, float percentage)
ImSupSmallRegion : Delete from an image of the conected component where their area is less than their...
Definition: PO_Utilities.hpp:231
RES_T FromSkeletonComputeGranulometry(const Image< T > &imIn, UINT32 *Granulo, int nbElt, float ScaleX, float ScaleY, float ScaleZ)
FromSkeletonComputeGranulometry : Compute the histogram of lenght of the skeleton.
Definition: PO_Utilities.hpp:836
RES_T ImUltimatePathOpening(const Image< UINT8 > &imIn, Image< T1 > &imOut, Image< T2 > &imIndicatrice, int stop, int lambdaAttribute)
Ultimate Path Opening Operation with the geodesic diameter as criterium.
Definition: morphoPathOpening.hpp:813
RES_T ImThresholdWithMuAndSigma(const Image< T1 > &imIn, Image< T2 > &imOut, float paramSigma=1)
ImThresholdWithMuAndSigma : for each slice of a 3D image, we compute Mu and Sigma and we apply a thre...
Definition: PO_Utilities.hpp:375
RES_T ImPathOpening_GraphV2(const Image< UINT8 > &imIn, double Lenght, Image< T > &imOut)
Path Opening Operation with a graph V2.
Definition: morphoPathOpeningGraphV2.hpp:610
RES_T ImLabelFlatZonesWithGeodesicDiameter(const Image< T1 > &imIn, Image< T2 > &imOut)
ImLabelFlatZonesWithGeodesicDiameter : we compute the geodesic diameter for each flat zone in a gray ...
Definition: morphoGeodesicPathOpening.hpp:959
RES_T ImLabelFlatZonesWithExtremities(const Image< T1 > &imIn, Image< T2 > &imOut)
ImLabelFlatZonesWithExtremities : we compute the elongation for each flat zone in a gray scale image.
Definition: morphoGeodesicPathOpening.hpp:905
RES_T ImElongationFromSkeleton(const Image< UINT8 > &imBin, const Image< T1 > &imSk, Image< T2 > &imOut)
ImElongationFromSkeleton : from a binary image and its skeleton, we compute the elongation of each CC...
Definition: PO_Utilities.hpp:423
RES_T ImFalseColorHSL(const Image< T > &imIn, Image< RGB > &imOut, float Scale)
ImFalseColorHSL : from a gray scale picture, we apply false color with a shade off.
Definition: PO_Utilities.hpp:558
RES_T ImThresholdWithUniqueCCForBackGround(const Image< T1 > &imIn, Image< T2 > &imOut, int SliceBySlice=0)
ImThresholdWithUniqueCCForBackGround : for each slice of a 3D image, we select a threshold to have on...
Definition: PO_Utilities.hpp:137
RES_T ImPathClosing(const Image< UINT8 > &imIn, const UINT32 Lenght, Image< T > &imOut)
Fast Grayscale Path Closing Operation made by updating the distance function from on threshold to an ...
Definition: DMorphoPathOpening.h:64
RES_T ImUltimateGeodesicPathClosing(const Image< UINT8 > &imIn, Image< UINT8 > &imTrans, Image< T > &imIndicatrice, float ScaleX=1, float ScaleY=1, float ScaleZ=1, int stop=-1, int lambdaAttribute=0, int takeMin=1)
ImGeodesicPathUltimateClosing: Compute the geodesic diameter for each connected component CC for each...
Definition: DMorphoPathOpening.h:227
RES_T ImPathOpening(const Image< UINT8 > &imIn, const UINT32 Lenght, Image< T > &imOut)
Fast Grayscale Path Opening Operation: made by updating the distance function from on threshold to an...
Definition: morphoPathOpening.hpp:639
RES_T ImGeodesicDiameter(const Image< T1 > &imIn, Image< T2 > &imOut, int sliceBySlice=0, double dz_over_dx=1)
ImGeodesicDiameter : we compute the geodesic diameter for each CC.
Definition: morphoGeodesicPathOpening.hpp:1064
RES_T PseudoPatternSpectrum(const Image< T1 > &imIn, const Image< T2 > &imIn2, int *patternSpect)
PseudoPatternSpectrum : With the contrast and the indicatrice images from the UPO,...
Definition: PO_Utilities.hpp:206
RES_T ImUltimatePathOpening_GraphV2(const Image< UINT8 > &imIn, Image< T1 > &imTrans, Image< T2 > &imInd, int stop=-1, int lambdaAttribute=0)
Ultimate Path Opening Operation with a graph V2.
Definition: morphoPathOpeningGraphV2.hpp:375
RES_T ImUltimateGeodesicPathOpening(const Image< UINT8 > &imIn, Image< UINT8 > &imTrans, Image< T > &imInd, float ScaleX=1, float ScaleY=1, float ScaleZ=1, int stop=-1, int lambdaAttribute=0, int takeMin=1)
ImGeodesicPathUltimateOpening : Compute the geodesic diameter for each connected component CC for eac...
Definition: morphoGeodesicPathOpening.hpp:565
RES_T ImUltimatePathClosing_GraphV2(const Image< UINT8 > &imIn, Image< T1 > &imTrans, Image< T2 > &imInd, int stop=-1, int lambdaAttribute=0)
Ultimate Path Closing Operation with a graph V2.
Definition: DMorphoPathOpening.h:346
RES_T ImPathClosingBruteForce(const Image< T1 > &imIn, const UINT32 Lenght, Image< T2 > &imOut)
Grayscale Path Closing Operation made by "staking" the results of the binary closing applied to each ...
Definition: DMorphoPathOpening.h:31
RES_T ImGeodesicPathClosing(const Image< UINT8 > &imIn, double Lenght, int Method, Image< T > &imOut, float ScaleX=1, float ScaleY=1, float ScaleZ=1)
ImGeodesicPathClosing : Compute the geodesic diameter for each connected component CC for each thresh...
Definition: DMorphoPathOpening.h:176
RES_T ImUltimatePathClosing(const Image< UINT8 > &imIn, Image< T1 > &imTrans, Image< T2 > &imInd, int stop, int lambdaAttribute)
Ultimate Path Closing Operation with a graph V3.
Definition: DMorphoPathOpening.h:100
RES_T ImPathClosing_GraphV2(const Image< UINT8 > &imIn, double Lenght, Image< T > &imOut)
Path Closing Operation with a graph V2.
Definition: DMorphoPathOpening.h:379
RES_T inv(const Image< T > &imIn, Image< T > &imOut)
inv() - Invert an image.
Definition: DImageArith.hpp:70