From b7842673d15e983fde13046981c9eb0d4e4158c8 Mon Sep 17 00:00:00 2001 From: tbaudier Date: Thu, 9 Nov 2017 14:22:47 +0100 Subject: [PATCH] Debug clitkDicom2Image with focal_origin option --- tools/clitkDicom2Image.cxx | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tools/clitkDicom2Image.cxx b/tools/clitkDicom2Image.cxx index 2cced17..1ac985e 100644 --- a/tools/clitkDicom2Image.cxx +++ b/tools/clitkDicom2Image.cxx @@ -238,14 +238,16 @@ int main(int argc, char * argv[]) } //Check on transform bool bId = true; - for(unsigned int i=0; i<4; i++) { - for(unsigned int j=0; j<4; j++) { - double elt = image->GetTransform()[0]->GetMatrix()->GetElement(i,j); - if(i==j && elt!=1.) { - bId = false; - } - if(i!=j && elt!=0.) { - bId = false; + if (!image->GetTransform().empty()) { + for(unsigned int i=0; i<4; i++) { + for(unsigned int j=0; j<4; j++) { + double elt = image->GetTransform()[0]->GetMatrix()->GetElement(i,j); + if(i==j && elt!=1.) { + bId = false; + } + if(i!=j && elt!=0.) { + bId = false; + } } } } -- 2.47.1