[Insight-developers] ImageIOBase::SetDirection
Mathieu Malaterre
mathieu.malaterre at kitware.com
Wed Mar 8 12:03:32 EST 2006
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
More information about the Insight-developers
mailing list