[Insight-users] dynamic_cast
Lorensen, William E (Research)
lorensen@crd.ge.com
Wed, 18 Dec 2002 08:00:48 -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_01C2A695.5B2310F0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
lydia,
What is your ImageType? Could you report your typedef?
=20
Bill
-----Original Message-----
From: lydia coin [mailto:lydia_coin3d@yahoo.fr]
Sent: Wednesday, December 18, 2002 6:27 AM
To: insight-users@public.kitware.com
Subject: [Insight-users] dynamic_cast
Hi folks
I'm a newbie at itk, I'm having many problems in using the filters, I =
already posted a message about
setspacing and setorigin methods of an itkimage class. It doesn't work =
because it says that the
transfroms associated to this image are not affine knowing that I =
associated no transform, it was
created by the class itself during the instanciation.
Second, I'm using a connectedthresholdImageFilter , it takes as input =
an image of unsigned char type
of pixels, but doesn't give any output. While using update() method of =
the filter it stops with an
error at this point of the itkImagebase.txx
ImageBase<VImageDimension>
::CopyInformation(const DataObject *data)
{
imgData =3D dynamic_cast<const ImageBase<VImageDimension>*>(data);
}
and doesn't cast back the pointer. =20
I really need to know what I'm doing wrong and hope I will get some =
help
regards =20
=20
typedef itk::ConnectedThresholdImageFilter<ImageType,ImageType> =
FilterType;
FilterType::Pointer filter =3D FilterType::New();
filter->SetInput(img);
FilterType::IndexType seed; seed[0] =3D 165; seed[1] =3D 90;
filter->SetSeed(seed);
filter->SetLower(0);
filter->SetUpper(255);
filter->SetReplaceValue(255);
filter-> Update();
_____ =20
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en fran=E7ais !
Testez le nouveau Yahoo! <http://fr.mail.yahoo.com> Mail
------_=_NextPart_001_01C2A695.5B2310F0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4919.2200" name=3DGENERATOR></HEAD>
<BODY>
<DIV><SPAN class=3D656485912-18122002><FONT face=3DArial =
color=3D#0000ff=20
size=3D2>lydia,</FONT></SPAN></DIV>
<DIV><SPAN class=3D656485912-18122002><FONT face=3DArial =
color=3D#0000ff size=3D2>What=20
is your ImageType? Could you report your typedef?</FONT></SPAN></DIV>
<DIV><SPAN class=3D656485912-18122002><FONT face=3DArial =
color=3D#0000ff=20
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D656485912-18122002><FONT face=3DArial =
color=3D#0000ff=20
size=3D2>Bill</FONT></SPAN></DIV>
<BLOCKQUOTE>
<DIV class=3DOutlookMessageHeader dir=3Dltr align=3Dleft><FONT =
face=3DTahoma=20
size=3D2>-----Original Message-----<BR><B>From:</B> lydia coin=20
[mailto:lydia_coin3d@yahoo.fr]<BR><B>Sent:</B> Wednesday, December =
18, 2002=20
6:27 AM<BR><B>To:</B> =
insight-users@public.kitware.com<BR><B>Subject:</B>=20
[Insight-users] dynamic_cast<BR><BR></FONT></DIV>
<P>Hi folks</P>
<P>I'm a newbie at itk, I'm having many problems in using the =
filters, I=20
already posted a message about setspacing and setorigin methods of an =
itkimage=20
class. It doesn't work because it says that the transfroms associated =
to this=20
image are not affine knowing that I associated no transform, it was =
created by=20
the class itself during the instanciation.</P>
<P>Second, I'm using a connectedthresholdImageFilter , it takes as =
input an=20
image of unsigned char type of pixels, but doesn't give any output. =
While=20
using update() method of the filter it stops with an error at this =
point of=20
the itkImagebase.txx</P>
<P>ImageBase<VImageDimension><BR>::CopyInformation(const =
DataObject=20
*data)<BR>{</P>
<P>imgData =3D dynamic_cast<const=20
ImageBase<VImageDimension>*>(data);</P>
<P>}</P>
<P>and doesn't cast back the pointer. </P>
<P>I really need to know what I'm doing wrong and hope I =
will get=20
some help</P>
<P>regards </P>
<P> </P>
<P>typedef =
itk::ConnectedThresholdImageFilter<ImageType,ImageType>=20
FilterType;</P>
<P> FilterType::Pointer filter =3D =
FilterType::New();<BR> =20
filter->SetInput(img);<BR> FilterType::IndexType =
seed;=20
seed[0] =3D 165; seed[1] =3D 90;<BR> =20
filter->SetSeed(seed);<BR> =20
filter->SetLower(0);<BR> =20
filter->SetUpper(255);<BR> =20
filter->SetReplaceValue(255);<BR> filter-> =
Update();</P>
<P><BR>
<HR SIZE=3D1>
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en fran=E7ais =
!<BR><A=20
href=3D"http://fr.mail.yahoo.com">Testez le nouveau Yahoo!=20
Mail</A></BLOCKQUOTE></BODY></HTML>
------_=_NextPart_001_01C2A695.5B2310F0--