From 368f7b2069ff80f3a664d5325020292a685ca781 Mon Sep 17 00:00:00 2001 From: Simon Rit Date: Mon, 25 Apr 2011 18:01:44 +0200 Subject: [PATCH] Fixed order problem in condition for analyze orientation handling. --- common/vvImageReader.txx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/common/vvImageReader.txx b/common/vvImageReader.txx index 7607ab3..fa111e2 100644 --- a/common/vvImageReader.txx +++ b/common/vvImageReader.txx @@ -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(); } -- 2.47.1