<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'><div style="text-align: left;">Hi Edgar,<br><br>I don't think you can actually use the ImageToImageFilter like that. I think its just a function that other filters use. For that reason, the New() function just returns and object pointer and not a&nbsp; smart pointer. If you want to convert your image types you should be able to use a casting filter of some sort. Maybe like the one you already have included? I'm not exactly sure because I've only been using ITK for about a month.<br><br>Hope that helps a bit.<br><br>Cameron.<br><br></div><br><div></div><br><br><hr id="stopSpelling">&gt; Date: Thu, 10 Apr 2008 09:47:57 +0200<br>&gt; From: edgar.andrasch@gmx.de<br>&gt; To: insight-users@itk.org<br>&gt; Subject: [Insight-users] ImageToImageFilter for the watershed transformation<br>&gt; <br>&gt; Hello,<br>&gt; I want to achieve the watershed transformation on my image. The problem is my ImageToImageFilter function. How can I use this the right way to use later the watershed transformation?<br>&gt; <br>&gt; typedef itk::Image &lt;pixelType, 3&gt; ItkImageType;<br>&gt; <br>&gt; typedef itk::FixedArray&lt; float, 1 &gt; MeasurementVectorType;<br>&gt; typedef itk::Image&lt; MeasurementVectorType, 2 &gt; ArrayImageType;<br>&gt; typedef itk::ScalarToArrayCastImageFilter&lt; FloatImage2DType, ArrayImageType &gt; CasterType;<br>&gt;                         <br>&gt; typedef itk::ImageToImageFilter&lt; ItkImageType, ArrayImageType &gt; FilterType1;<br>&gt; FilterType1::Pointer filter1 = FilterType1::New();&lt;-error C2440: 'initializing' : cannot convert from 'itk::Object::Pointer' to 'itk::SmartPointer&lt;TObjectType&gt;'<br>&gt; filter1-&gt;SetInput(itkImage);<br>&gt;                                 <br>&gt; CasterType::Pointer caster = CasterType::New();<br>&gt; caster-&gt;SetInput(filter1-&gt;GetOutput());<br>&gt; diffusion-&gt;SetInput(caster-&gt;GetOutput());<br>&gt; <br>&gt; Thanks for all responses<br>&gt; -- <br>&gt; Psssst! Schon vom neuen GMX MultiMessenger gehört?<br>&gt; Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger<br>&gt; _______________________________________________<br>&gt; Insight-users mailing list<br>&gt; Insight-users@itk.org<br>&gt; http://www.itk.org/mailman/listinfo/insight-users<br><br /><hr />Find out: SEEK Salary Centre <a href='http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fninemsn%2Eseek%2Ecom%2Eau%2Fcareer%2Dresources%2Fsalary%2Dcentre%2F%3Ftracking%3Dsk%3Ahet%3Asc%3Anine%3A0%3Ahot%3Atext&_t=764565661&_r=OCT07_endtext_salary&_m=EXT' target='_new'>Are you paid what you're worth?</a></body>
</html>