[Insight-developers] affine transform behavior

Damion Shelton dmshelto@andrew.cmu.edu
Mon, 05 Nov 2001 11:39:20 -0500


Another quick question...

The following code fragment works fine:

{
  FunctionInputType position;

  TImage::AffineTransformPointer indexToPhysicalTransform = 
m_Image->GetIndexToPhysicalTransform();

  // Convert the normal index to a continuous index
  typedef ContinuousIndex<double, NDimensions> ContinuousIndexType;
  ContinuousIndexType contIndex;

  for (int ii = 0; ii < NDimensions; ++ii)
    contIndex[ii] = index[ii];

  position = indexToPhysicalTransform->TransformPoint(contIndex);

  return m_Function->Evaluate(position);
}

While the following does not:

{
  FunctionInputType position;

  // Convert the normal index to a continuous index
  typedef ContinuousIndex<double, NDimensions> ContinuousIndexType;
  ContinuousIndexType contIndex;

  for (int ii = 0; ii < NDimensions; ++ii)
    contIndex[ii] = index[ii];

  m_Image->TransformContinuousIndexToPhysicalPoint(contIndex, position);

  return m_Function->Evaluate(position);
}

The distinction is that the first relies on the member variable m_Image to 
transform a point from index to physical, while the second gets the 
transform from m_Image and uses that to accomplish the transform. The 
second version produces the compile error:

error C2248: 'AffineTransform<double,3,class itk::Point<double,12>,class 
itk::Matrix<double,3,12> >::AffineTransform<double,3,class 
itk::Point<double,12>,class itk::Matrix<double,3,12> >' : cannot access prot
ected member declared in class 'itk::AffineTransform<double,3,class 
itk::Point<double,12>,class itk::Matrix<double,3,12> >'

Any thoughts?

-Damion-