[Insight-users] dynamic_cast
lydia coin
lydia_coin3d@yahoo.fr
Wed, 18 Dec 2002 12:26:53 +0100 (CET)
--0-458759613-1040210813=:68259
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
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 = dynamic_cast<const ImageBase<VImageDimension>*>(data);
}
and doesn't cast back the pointer.
I really need to know what I'm doing wrong and hope I will get some help
regards
typedef itk::ConnectedThresholdImageFilter<ImageType,ImageType> FilterType;
FilterType::Pointer filter = FilterType::New();
filter->SetInput(img);
FilterType::IndexType seed; seed[0] = 165; seed[1] = 90;
filter->SetSeed(seed);
filter->SetLower(0);
filter->SetUpper(255);
filter->SetReplaceValue(255);
filter-> Update();
---------------------------------
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Testez le nouveau Yahoo! Mail
--0-458759613-1040210813=:68259
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
<P>Hi folks</P>
<P>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.</P>
<P>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</P>
<P>ImageBase<VImageDimension><BR>::CopyInformation(const DataObject *data)<BR>{</P>
<P>imgData = dynamic_cast<const 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 some help</P>
<P>regards </P>
<P> </P>
<P>typedef itk::ConnectedThresholdImageFilter<ImageType,ImageType> FilterType;</P>
<P> FilterType::Pointer filter = FilterType::New();<BR> filter->SetInput(img);<BR> FilterType::IndexType seed; seed[0] = 165; seed[1] = 90;<BR> filter->SetSeed(seed);<BR> filter->SetLower(0);<BR> filter->SetUpper(255);<BR> filter->SetReplaceValue(255);<BR> filter-> Update();</P><p><br><hr size=1>Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !<br>
<a href=http://fr.mail.yahoo.com>Testez le nouveau Yahoo! Mail</a>
--0-458759613-1040210813=:68259--