[Insight-developers] Typo in itkMetaImageIO.cxx

Stephen R. Aylward Stephen.Aylward at Kitware.com
Wed Feb 15 11:21:46 EST 2006


Fixed - Thanks!

Stephen

Peter Cech wrote:
> Hi,
> 
> there is a bug in computation of Offset field when writing MetaImage file and
> 
> 1. Index of image region is not zero filled.
> 2. Image consists of anisotropic pixels.
> 3. Direction is not identity.
> 
> Due to mixup of inner and outer loop control variables, current CVS code
> applies spacing to each component of direction cosines vectors instead
> of scaling whole vector with the corresponding spacing element.
> 
> Patch is attached, please review and apply if it looks correct.
> 
> Thanks!
> 
> Peter
> 
> 
> ------------------------------------------------------------------------
> 
> Index: itkMetaImageIO.cxx
> ===================================================================
> RCS file: /cvsroot/Insight/Insight/Code/IO/itkMetaImageIO.cxx,v
> retrieving revision 1.60
> diff -u -3 -d -r1.60 itkMetaImageIO.cxx
> --- itkMetaImageIO.cxx	12 Dec 2005 20:29:57 -0000	1.60
> +++ itkMetaImageIO.cxx	8 Feb 2006 16:03:41 -0000
> @@ -1049,7 +1049,7 @@
>      int j;
>      for(j=0; j<nDims; j++)
>        {
> -      eOrigin[i] += indx[j] * eSpacing[i] * this->GetDirection(j)[i];
> +      eOrigin[i] += indx[j] * eSpacing[j] * this->GetDirection(j)[i];
>        }
>      }
>  
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Insight-developers mailing list
> Insight-developers at itk.org
> http://www.itk.org/mailman/listinfo/insight-developers

-- 
=============================================================
Stephen R. Aylward, Ph.D.
Chief Medical Scientist
Kitware, Inc.
http://www.kitware.com


More information about the Insight-developers mailing list