[Insight-developers] Casting constructors for DTI and Sym Mat pixeltypes

Luke Bloy luke.bloy at gmail.com
Fri Mar 5 13:00:13 EST 2010


The classes itkDiffusionTensor3D and itkSymmetricSecondRankTensor don't 
have constructors that enable casting. ( 
http://www.itk.org/Bug/view.php?id=10323 ) so code such as the following 
fails.

   typedef itk::SymmetricSecondRankTensor<int,3>     Int3DTensorType;
   typedef itk::SymmetricSecondRankTensor<float,3>   Float3DTensorType;
   typedef itk::SymmetricSecondRankTensor<double,3>  Double3DTensorType;
   Int3DTensorType intTensor(1);

   //Test constructors
   Float3DTensorType floatTensor(intTensor);
   Double3DTensorType doubleTensor(floatTensor);

   //test Assignment
   Float3DTensorType floatTensor2 = intTensor;


adding templated constructors and assignment operators will allow this 
type of behavior.

Is there a reason these constructors have been not been defined?

-Luke



More information about the Insight-developers mailing list