From: Simon Rit Date: Mon, 25 Apr 2011 16:01:44 +0000 (+0200) Subject: Fixed order problem in condition for analyze orientation handling. X-Git-Tag: v1.2.0~17 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=368f7b2069ff80f3a664d5325020292a685ca781;p=clitk.git Fixed order problem in condition for analyze orientation handling. --- 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(); }