From: tbaudier Date: Thu, 9 Nov 2017 13:22:47 +0000 (+0100) Subject: Debug clitkDicom2Image with focal_origin option X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=b7842673d15e983fde13046981c9eb0d4e4158c8;p=clitk.git Debug clitkDicom2Image with focal_origin option --- 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; + } } } }