6 #include <itkImageFileReader.h> 7 #include <itkImageRegionConstIterator.h> 9 #include <itkLabelContourImageFilter.h> 10 #include <itkBinaryContourImageFilter.h> 11 #include <itkSimpleFilterWatcher.h> 12 #include <itkHausdorffDistanceImageFilter.h> 13 #include <itkDirectedHausdorffDistanceImageFilter.h> 14 #include <itkContourMeanDistanceImageFilter.h> 15 #include <itkFlipImageFilter.h> 16 #include <itkImageDuplicator.h> 28 SegPerfCAnalyzer(std::string &pi_pchImageTestName, std::string &pi_pchImageRefName,
bool advancedEvaluation);
38 m_dfDetectionThresholdAlpha = pi_fVal;
43 m_dfDetectionThresholdBeta = pi_fVal;
48 m_dfDetectionThresholdGamma = pi_fVal;
53 m_dfMinLesionVolumeDetection = pi_fVal;
81 bool falsePositiveRatioTester(
int pi_iLessionReference,
int pi_iNbLabelsTest,
int pi_iNbLabelsRef,
int **pi_ppiOverlapTab,
int *pi_piTPRowSumTab,
int *pi_piColumnSumTab,
double pi_dfBeta,
double pi_dfGamma);
82 void getOverlapTab(
int&po_iNbLabelsRef,
int&po_iNbLabelsTest,
int **&po_ppiOverlapTab);
86 void transposer(
int pi_iNbLabelsRef,
int pi_iNbLabelsTest,
int * *pi_ppiOverlapTab,
int* *&po_rppiOverlapTabTransposed);
87 void removeOverlapTab(
int **pi_ppiOverlapTab,
int pi_iNbLabelsRef);
89 unsigned int m_uiNbLabels;
90 bool m_bValuesComputed;
91 bool m_bContourDetected;
93 double m_dfDetectionThresholdAlpha;
94 double m_dfDetectionThresholdBeta;
95 double m_dfDetectionThresholdGamma;
96 double m_dfMinLesionVolumeDetection;
99 typedef itk::Image <unsigned short, 3> ImageType;
100 typedef itk::ImageFileReader <ImageType> ImageReaderType;
101 typedef itk::ImageRegionConstIterator <ImageType> ImageIteratorType;
104 ImageType::Pointer m_imageTest;
105 ImageType::Pointer m_imageRef;
106 ImageType::Pointer m_imageTestContour;
107 ImageType::Pointer m_imageRefContour;
108 ImageType::Pointer m_imageRefDuplicated;
109 ImageType::Pointer m_imageTestDuplicated;
112 itk::ThreadIdType m_ThreadNb;
double getPPV()
Getter of Positive predictive value.
double getDiceCoefficient()
Getter of Dice coefficient.
double computeAverageSurfaceDistance()
Compute average surface distance.
void setDetectionThresholdBeta(double pi_fVal)
bool falsePositiveRatioTester(int pi_iLessionReference, int pi_iNbLabelsTest, int pi_iNbLabelsRef, int **pi_ppiOverlapTab, int *pi_piTPRowSumTab, int *pi_piColumnSumTab, double pi_dfBeta, double pi_dfGamma)
Compute if a lesion is detected or not with beta and gamma thresholds.
double getJaccardCoefficient()
Getter of Jaccard coefficient.
void computeITKMeasures()
Compute different measures with ITK to evaluate segmentation.
double computeMeanDist()
Compute mean distance.
itk::SmartPointer< Self > Pointer
double getNPV()
Getter of Negative predictive value.
void selectCluster(unsigned int)
Select the cluster we want to use to compute evaluation results.
double getMeanOverlap()
Getter of Mean overlap.
bool checkImagesMatrixAndVolumes()
Check if the 2 inputs images are compatible.
void contourDectection()
Extract the contour of the image to evaluate and the ground truth.
void getOverlapTab(int &po_iNbLabelsRef, int &po_iNbLabelsTest, int **&po_ppiOverlapTab)
Compute a table of lesion overlap between 2 images.
int getNumberOfClusters()
Return the number of clusters.
void formatLabels()
Format labels values for the image to evaluate and the ground truth to obtain : background pixels val...
double getRelativeVolumeError()
Getter of Relative volume error.
void setNbThreads(int pi_iNbThreads)
Set the number of threads to use for the computation of ITK.
bool getDetectionMarks(double &po_fPPVL, double &po_fSensL, double &po_fF1)
Compute useful variables to get detection scores.
Class to compute various metrics to evaluate segmentation results.
void setDetectionThresholdAlpha(double pi_fVal)
double getSensitivity()
Getter of Sensibility.
int getTruePositiveLesions(int pi_iNbLabelsRef, int pi_iNbLabelsTest, int **pi_ppiOverlapTab)
Getter of True positive lesions.
double getSpecificity()
Getter of Specificity.
double getUnionOverlap()
Getter of Union overlap.
void setMinLesionVolumeDetection(double pi_fVal)
double computeHausdorffDist()
Compute Haussdorf distance.
void checkNumberOfLabels(int, int)
Check if the number of labels is the same for both input images.
void setDetectionThresholdGamma(double pi_fVal)