From 327ed9a4c0398e274453754d4ec27ca9633810dd Mon Sep 17 00:00:00 2001 From: David Sarrut Date: Tue, 20 Mar 2012 14:23:24 +0100 Subject: [PATCH] Add dice with reference image --- segmentation/clitkStructuresExtractionFilter.h | 2 +- segmentation/clitkStructuresExtractionFilter.txx | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) 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; -- 2.47.1