[Insight-users] Converting itk::Image<float, 2> to itk::Image
<VectorPixelType, 2>
Miller, James V (Research)
millerjv at crd.ge.com
Thu, 11 Mar 2004 10:39:33 -0500
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C4077E.87AFC331
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Carlos,=20
=20
Can simply use the GradientAnisotropicDiffusionImageFilter on your =
original
scalar image?=20
=20
I am not sure whether the VectorGradientAnisotropicDiffusionImageFilter =
will
like processing a vector image where the vector length is one.
=20
If you still need to convert a scalar image to a vector, this is how I =
have
done it in the past
=20
typedef =
itk::ScalarToArrayCastImageFilter<InputImageType,VectorImageType>
ScalarToVectorFilterType;
ScalarToVectorFilterType::Pointer scalarToVector =3D
ScalarToVectorFilterType::New();
scalarToVector->SetInput( reader->GetOutput() );
scalarToVector->Update();
=20
-----Original Message-----
From: Carlos Cardenas [mailto:caedcasa at hotmail.com]
Sent: Wednesday, March 10, 2004 11:42 PM
To: insight-users at itk.org
Subject: [Insight-users] Converting itk::Image<float, 2> to
itk::Image<VectorPixelType, 2>
Hi everyone,
=20
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.
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.
=20
Part of the source code below:
=20
typedef itk::Image<float, 2>ImageTypeFloat2D;
typedef itk::Vector<float, 3> VectorPixelType;
typedef itk::Image<VectorPixelType, 2> VectorImageType;
typedef itk::ScalarToArrayCastImageFilter<ImageTypeFloat2D,
VectorImageType> CastFilterTypeToVector;
CastFilterTypeToVector::Pointer casterToVector =3D
CastFilterTypeToVector::New();
casterToVector->SetInput(filterSlice->GetOutput());
casterToVector->Update(); // my program says good bye at this point
=20
typedef
itk::VectorGradientAnisotropicDiffusionImageFilter<VectorImageType,
VectorImageType> FilterType;
FilterType::Pointer filter =3D FilterType::New();
=20
Thank you in advance for any help,
=20
Carlos
=20
_____ =20
Lieblingssong auf's Handy laden oder Display aufpeppen - bei MSN gibt's
jetzt auch polyphone Klingelt=F6ne & farbige Logos! Hier klicken
<http://g.msn.com/8HMBDEDE/2740??PS=3D>
_______________________________________________ Insight-users mailing =
list
Insight-users at itk.org http://www.itk.org/mailman/listinfo/insight-users
------_=_NextPart_001_01C4077E.87AFC331
Content-Type: text/html;
charset="iso-8859-1"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1276" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=621493515-11032004><FONT color=#0000ff size=2>Carlos,
</FONT></SPAN></DIV>
<DIV><SPAN class=621493515-11032004><FONT color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=621493515-11032004><FONT color=#0000ff size=2>Can simply use
the GradientAnisotropicDiffusionImageFilter on your original scalar image?
</FONT></SPAN></DIV>
<DIV><SPAN class=621493515-11032004><FONT color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=621493515-11032004><FONT color=#0000ff size=2>I am not sure
whether the VectorGradientAnisotropicDiffusionImageFilter will like processing a
vector image where the vector length is one.</FONT></SPAN></DIV>
<DIV><SPAN class=621493515-11032004><FONT color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=621493515-11032004><FONT color=#0000ff size=2>If you still need
to convert a scalar image to a vector, this is how I have done it in the
past</FONT></SPAN></DIV>
<DIV><SPAN class=621493515-11032004><FONT color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=621493515-11032004><FONT color=#0000ff size=2> typedef
itk::ScalarToArrayCastImageFilter<InputImageType,VectorImageType>
ScalarToVectorFilterType;<BR> ScalarToVectorFilterType::Pointer
scalarToVector = ScalarToVectorFilterType::New();<BR>
scalarToVector->SetInput( reader->GetOutput() );<BR>
scalarToVector->Update();<BR></FONT></SPAN></DIV>
<DIV><SPAN class=621493515-11032004><FONT color=#0000ff
size=2></FONT></SPAN> </DIV>
<BLOCKQUOTE>
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B> Carlos Cardenas
[mailto:caedcasa at hotmail.com]<BR><B>Sent:</B> Wednesday, March 10, 2004 11:42
PM<BR><B>To:</B> insight-users at itk.org<BR><B>Subject:</B> [Insight-users]
Converting itk::Image<float, 2> to itk::Image<VectorPixelType,
2><BR><BR></FONT></DIV>
<DIV>
<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>
_______________________________________________ Insight-users mailing list
Insight-users at itk.org
http://www.itk.org/mailman/listinfo/insight-users</BLOCKQUOTE></BODY></HTML>
------_=_NextPart_001_01C4077E.87AFC331--