[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&lt;VImageDimension&gt;<BR>::CopyInformation(const DataObject *data)<BR>{</P>
<P>imgData = dynamic_cast&lt;const ImageBase&lt;VImageDimension&gt;*&gt;(data);</P>
<P>}</P>
<P>and&nbsp;doesn't cast back the pointer.&nbsp;&nbsp;</P>
<P>I really need to know&nbsp;what I'm doing wrong&nbsp;and hope I will get some help</P>
<P>regards&nbsp;&nbsp;&nbsp;&nbsp;</P>
<P>&nbsp;</P>
<P>typedef itk::ConnectedThresholdImageFilter&lt;ImageType,ImageType&gt; FilterType;</P>
<P>&nbsp;FilterType::Pointer filter = FilterType::New();<BR>&nbsp;&nbsp;&nbsp; filter-&gt;SetInput(img);<BR>&nbsp;&nbsp;&nbsp; FilterType::IndexType seed; seed[0] = 165; seed[1] = 90;<BR>&nbsp;&nbsp;&nbsp; filter-&gt;SetSeed(seed);<BR>&nbsp;&nbsp;&nbsp; filter-&gt;SetLower(0);<BR>&nbsp;&nbsp;&nbsp; filter-&gt;SetUpper(255);<BR>&nbsp;&nbsp;&nbsp; filter-&gt;SetReplaceValue(255);<BR>&nbsp;&nbsp; filter-&gt; 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--