]> Creatis software - clitk.git/commitdiff
Debug clitkDicom2Image with focal_origin option
authortbaudier <thomas.baudier@creatis.insa-lyon.fr>
Thu, 9 Nov 2017 13:22:47 +0000 (14:22 +0100)
committertbaudier <thomas.baudier@creatis.insa-lyon.fr>
Thu, 9 Nov 2017 13:22:47 +0000 (14:22 +0100)
tools/clitkDicom2Image.cxx

index 2cced17e0d2da6980f5557ef916802694e8126dc..1ac985e504de85c97aef1c8695a0d59cf3b84660 100644 (file)
@@ -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;
+          }
         }
       }
     }