[Insight-users] Converting itk::Image<float, 2> to itk::Image<VectorPixelType, 2>
Carlos Cardenas
caedcasa at hotmail.com
Thu, 11 Mar 2004 04:41:53 +0000
<html><div style='background-color:'><DIV class=RTE>Hi everyone,</DIV>
<DIV class=RTE> </DIV>
<DIV class=RTE> I was trying to find a solution for my problem looking into the old emails sendet to the mailinglist but I did not find a solution. I am trying to convert an itk::Image<float, 2> into a vector image.</DIV>
<DIV class=RTE>I used the class ScalarToArrayCastImageFilter without success. I can compile my program and also link it without problem. My program crashes when it comes to the part where the image has to be converted. Could anybody tell me what I am doing wrong and how I can convert my image into a vector image so that I can use the VectorGradientAnisotropicDiffusionImageFilter.</DIV>
<DIV class=RTE> </DIV>
<DIV class=RTE> Part of the source code below:</DIV>
<DIV class=RTE> </DIV>
<DIV class=RTE> typedef itk::Image<float, 2>ImageTypeFloat2D;<BR> typedef itk::Vector<float, 3> VectorPixelType;<BR> typedef itk::Image<VectorPixelType, 2> VectorImageType;</DIV>
<DIV class=RTE><BR> typedef itk::ScalarToArrayCastImageFilter<ImageTypeFloat2D, VectorImageType> CastFilterTypeToVector;<BR> CastFilterTypeToVector::Pointer casterToVector = CastFilterTypeToVector::New();<BR> casterToVector->SetInput(filterSlice->GetOutput());<BR> casterToVector->Update(); // my program says good bye at this point</DIV>
<DIV class=RTE> </DIV>
<DIV class=RTE> typedef itk::VectorGradientAnisotropicDiffusionImageFilter<VectorImageType, VectorImageType> FilterType;<BR> FilterType::Pointer filter = FilterType::New();</DIV>
<DIV class=RTE> </DIV>
<DIV class=RTE>Thank you in advance for any help,</DIV>
<DIV class=RTE> </DIV>
<DIV class=RTE>Carlos<BR> </DIV></div><br clear=all><hr>Lieblingssong auf’s Handy laden oder Display aufpeppen – bei MSN gibt’s jetzt auch polyphone Klingeltöne & farbige Logos! <a href="http://g.msn.com/8HMBDEDE/2740??PS=">Hier klicken</a> </html>