From: David Sarrut Date: Tue, 20 Mar 2012 13:23:24 +0000 (+0100) Subject: Add dice with reference image X-Git-Tag: v1.3.0~52^2~42 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=327ed9a4c0398e274453754d4ec27ca9633810dd;p=clitk.git Add dice with reference image --- diff --git a/segmentation/clitkStructuresExtractionFilter.h b/segmentation/clitkStructuresExtractionFilter.h index 3e7d303..9bf57d0 100644 --- a/segmentation/clitkStructuresExtractionFilter.h +++ b/segmentation/clitkStructuresExtractionFilter.h @@ -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(); diff --git a/segmentation/clitkStructuresExtractionFilter.txx b/segmentation/clitkStructuresExtractionFilter.txx index 3a3e0ab..9559d4c 100644 --- a/segmentation/clitkStructuresExtractionFilter.txx +++ b/segmentation/clitkStructuresExtractionFilter.txx @@ -47,7 +47,7 @@ AddRelativePositionListFilename(std::string s) { template typename clitk::StructuresExtractionFilter::MaskImagePointer clitk::StructuresExtractionFilter:: -ApplyRelativePositionList(std::string name, MaskImageType * input) +ApplyRelativePositionList(std::string name, MaskImageType * input, bool overlap) { // Create all RelativePositionList for(unsigned int i=0; iSetCurrentStepNumber(GetCurrentStepNumber()); relpos->SetWriteStepFlag(GetWriteStepFlag()); relpos->SetInput(input); + if (overlap) { + std::string n = name.substr(8,2); + MaskImagePointer ref = this->GetAFDB()->template GetImage ("S"+n+"_Ref"); + relpos->SetReferenceImageForOverlapMeasure(ref); + } relpos->Update(); input = relpos->GetOutput(); + SetCurrentStepNumber(relpos->GetCurrentStepNumber()); } return input;