]> Creatis software - clitk.git/commitdiff
Add dice with reference image
authorDavid Sarrut <david.sarrut@gmail.com>
Tue, 20 Mar 2012 13:23:24 +0000 (14:23 +0100)
committerDavid Sarrut <david.sarrut@gmail.com>
Tue, 20 Mar 2012 13:23:24 +0000 (14:23 +0100)
segmentation/clitkStructuresExtractionFilter.h
segmentation/clitkStructuresExtractionFilter.txx

index 3e7d303fce076c7df5634a573f1d1a57db13f05a..9bf57d0dc6f69ae6e277385a57bb0e5c80899241 100644 (file)
@@ -88,7 +88,7 @@ namespace clitk {
     
     // RelativePositionList management 
     void AddRelativePositionListFilename(std::string s);    
-    MaskImagePointer ApplyRelativePositionList(std::string name, MaskImageType * input);
+    MaskImagePointer ApplyRelativePositionList(std::string name, MaskImageType * input, bool overlap=false);
     
    protected:
     StructuresExtractionFilter();
index 3a3e0ab7c7758cbb26306b5330c028cfdf1b9e79..9559d4c2702ab9fe7cbff3cf21d632460a6f0aff 100644 (file)
@@ -47,7 +47,7 @@ AddRelativePositionListFilename(std::string s) {
 template <class TImageType>
 typename clitk::StructuresExtractionFilter<TImageType>::MaskImagePointer
 clitk::StructuresExtractionFilter<TImageType>::
-ApplyRelativePositionList(std::string name, MaskImageType * input) 
+ApplyRelativePositionList(std::string name, MaskImageType * input, bool overlap
 { 
   // Create all RelativePositionList
   for(unsigned int i=0; i<mListOfRelativePositionListFilename.size(); i++) {
@@ -71,8 +71,14 @@ ApplyRelativePositionList(std::string name, MaskImageType * input)
     relpos->SetCurrentStepNumber(GetCurrentStepNumber());
     relpos->SetWriteStepFlag(GetWriteStepFlag());
     relpos->SetInput(input);
+    if (overlap) {
+      std::string n = name.substr(8,2);
+      MaskImagePointer ref = this->GetAFDB()->template GetImage <MaskImageType>("S"+n+"_Ref");
+      relpos->SetReferenceImageForOverlapMeasure(ref);
+    }
     relpos->Update();
     input = relpos->GetOutput();
+
     SetCurrentStepNumber(relpos->GetCurrentStepNumber());
   }
   return input;