[Insight-developers] ImageIOBase::SetDirection

Bill Lorensen bill.lorensen at gmail.com
Sun Mar 12 10:47:13 EST 2006


Yes, it uses an itkMatrix.

On 3/8/06, Mathieu Malaterre <mathieu.malaterre at kitware.com> wrote:
>
> Ok, never send a mail just before going to lunch...
>
> I still have some initialized memory read, but this is not due to the
> size of m_Direction.
>
> Does ITK Direction cosines uses a dim x dim matrix ?
>
> Thanks,
> Mathieu
>
> Mathieu Malaterre wrote:
> > Hello,
> >
> >     I am looking at function like
> > ImageIOBase::SetDirection
> > and
> > ImageIOBase::SetNumberOfDimensions(unsigned int dim)
> >
> >     Could someone correct me, but I thought m_Direction was the
> > direction cosine, right ? If so I don't believe the code is working
> > since we need at least 2*image dimension (we assume orthogonal base to
> > compute direction of 3d component) for the size
> >
> >
> > void ImageIOBase::SetNumberOfDimensions(unsigned int dim)
> > {
> >   if(dim != m_NumberOfDimensions)
> >     {
> >     ...
> >     m_Direction.resize( dim * 2);
> >                             ^^^^
> >
> >
> > and incidentally the SetDirection code should look like:
> >
> >   if (i > m_Direction.size() ) {return;} // wrong precondition
> >   this->Modified();
> >   std::vector<double> v;
> >   v.resize(direction.size());
> >            ^^^^^^^^^
> >   for (unsigned int j=0; j < v.size(); j++)
> >     {
> >     v[j] = direction[j];
> >     }
> >   m_Direction[i] = v;
> >
> >
> > Comments welcome ?
> > Mathieu
> > _______________________________________________
> > Insight-developers mailing list
> > Insight-developers at itk.org
> > http://www.itk.org/mailman/listinfo/insight-developers
> >
>
> _______________________________________________
> Insight-developers mailing list
> Insight-developers at itk.org
> http://www.itk.org/mailman/listinfo/insight-developers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.itk.org/mailman/private/insight-developers/attachments/20060312/f22d899f/attachment.htm


More information about the Insight-developers mailing list