]> Creatis software - clitk.git/commitdiff
Fixed order problem in condition for analyze orientation handling.
authorSimon Rit <simon.rit@creatis.insa-lyon.fr>
Mon, 25 Apr 2011 16:01:44 +0000 (18:01 +0200)
committerSimon Rit <simon.rit@creatis.insa-lyon.fr>
Mon, 25 Apr 2011 16:01:44 +0000 (18:01 +0200)
common/vvImageReader.txx

index 7607ab3a43cf27fc6b90c06ac926775b3f116e72..fa111e200c06fbbc4e6ad07f682b8ecedccbc37c 100644 (file)
@@ -172,11 +172,14 @@ void vvImageReader::UpdateWithDimAndInputPixelType()
 
   // For unknown analyze orientations, we set identity
   if(analyzeImageIO) {
-    const double m[16] = {1.,0.,0.,0.,0.,0.,1.,0.,0.,-1.,0.,0.,0.,0.,0.,1.};
+    const double m[16] = {1.,0.,0.,0.,
+                          0.,0.,1.,0.,
+                          0.,-1.,0.,0.,
+                          0.,0.,0.,1.};
     int i;
-    for(i=0; m[i]==mImage->GetTransform()->GetMatrix()->GetElement(i%4, i/4) && i<16; i++);
+    for(i=0; i<16 && m[i]==mImage->GetTransform()->GetMatrix()->GetElement(i%4, i/4); i++);
     if(i==16) {
-      itkWarningMacro(<< "Analyze image file format detected with unknown orientation."
+      itkWarningMacro(<< "Analyze image file format detected with unknown orientation. "
                       << "Forcing identity orientation, use other file format if not ok.");
       mImage->GetTransform()->Identity();
     }