From 0e6369c21d1ca6245ff6d9e1993a5118a36e6b4c Mon Sep 17 00:00:00 2001 From: David Sarrut Date: Tue, 18 Oct 2011 11:51:13 +0200 Subject: [PATCH] Read CricoidCartilag image or Point position (simpler) --- segmentation/clitkExtractMediastinumFilter.txx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/segmentation/clitkExtractMediastinumFilter.txx b/segmentation/clitkExtractMediastinumFilter.txx index b3e17bf..39e5542 100644 --- a/segmentation/clitkExtractMediastinumFilter.txx +++ b/segmentation/clitkExtractMediastinumFilter.txx @@ -345,11 +345,16 @@ GenerateOutputInformation() { // RelativePosition to avoid some issue due to superior boundaries. this->StartNewStep("[Mediastinum] Keep inferior to CricoidCartilag"); // load Cricoid, get centroid, cut above (or below), lower bound - MaskImagePointer CricoidCartilag = this->GetAFDB()->template GetImage ("CricoidCartilag"); MaskImagePointType p; - p[0] = p[1] = p[2] = 0.0; // to avoid warning - clitk::FindExtremaPointInAGivenDirection(CricoidCartilag, - this->GetBackgroundValue(), 2, true, p); + try { + MaskImagePointer CricoidCartilag = this->GetAFDB()->template GetImage ("CricoidCartilag"); + p[0] = p[1] = p[2] = 0.0; // to avoid warning + clitk::FindExtremaPointInAGivenDirection(CricoidCartilag, + this->GetBackgroundValue(), 2, true, p); + } catch (clitk::ExceptionObject e) { + //DD("CricoidCartilag image not found, try CricoidCartilagZ"); + this->GetAFDB()->GetPoint3D("CricoidCartilagPoint", p); + } output = clitk::CropImageRemoveGreaterThan(output, 2, p[2], true, this->GetBackgroundValue()); this->template StopCurrentStep(output); -- 2.47.1