From: David Sarrut Date: Tue, 18 Oct 2011 09:51:13 +0000 (+0200) Subject: Read CricoidCartilag image or Point position (simpler) X-Git-Tag: v1.3.0~180^2~3 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=0e6369c21d1ca6245ff6d9e1993a5118a36e6b4c;p=clitk.git Read CricoidCartilag image or Point position (simpler) --- 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);