Hi Gupt,<br><br>You cannot instantiate that filter in your code and several virtual functions are pure in this class. This class will have to be derived before instantiation.<br><br>Since you are looking for level-set methods already implemented, you can look at classes inheriting from <span>itkSegmentationLevelSetImageFilter</span>. This can be seen in the very wide figure in:<br>
<a href="http://www.itk.org/Doxygen314/html/classitk_1_1SegmentationLevelSetImageFilter.html">http://www.itk.org/Doxygen314/html/classitk_1_1SegmentationLevelSetImageFilter.html</a><br><br><br>Kishore<br><br><br><br><div class="gmail_quote">
On Mon, Sep 21, 2009 at 11:48 PM, Aditya Gupta <span dir="ltr">&lt;<a href="mailto:adityargupta@gmail.com">adityargupta@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><span>Hello,
</span><br><br><span>I&#39;m using Level Set Segmentation for my project <b>and</b> <b>am</b> trying <b>to</b> develop my own speed function. I&#39;ve included the file itkSegmentationLevelSetImageFilter.h <b>and</b> then was <b>adding</b> some functions <b>to</b> this file <b>and</b> I realized that with the original header file I&#39;m getting errors. Below is <b>a</b> very simple program where I&#39;m creating <b>an</b> instance of <b>a</b> pointer <b>to</b> this filter <b>and</b> I&#39;m getting the error that follows the program. I&#39;ve tried changing data types but I&#39;m unable <b>to</b> get rid of this error. Please help... Thank you.
</span><br><br><span>#include &quot;itkImage.h&quot;
</span><br><span>#include &quot;itkImageFileReader.h&quot;
</span><br><span>#include &quot;itkImageFileWriter.h&quot;
</span><br><span>#include &quot;itkSegmentationLevelSetImageFilter.h&quot;
</span><br><br><span>int main( int <b>argc</b>, char *<b>argv</b>[] )
</span><br><span>{
</span><br><span>  typedef   float           InternalPixelType;
</span><br><span>  const unsigned int    Dimension = 2;
</span><br><span>  typedef itk::Image&lt; InternalPixelType, Dimension &gt;  InternalImageType;
</span><br><span>        
</span><br><span>        typedef itk::SegmentationLevelSetImageFilter&lt;InternalImageType, InternalImageType&gt; SLSfilter;
</span><br><span>        
</span><br><span>// <b>ACTUAL</b> LEVEL SET starts
</span><br><br><span>        SLSfilter::Pointer multipleLevelSet = SLSfilter::New();
</span><br><span>        
</span><br><span>  return 0;
</span><br><span>}
</span><br><br><span>ERROR:
</span><br><span>1&gt;------ Build started: Project: cellSegmentation, Configuration: Debug Win32 ------
</span><br><span>1&gt;Compiling...
</span><br><span>1&gt;cellSegmentation.cxx
</span><br><span>1&gt;.\cellSegmentation.cxx(32) : error C2440: &#39;initializing&#39; : cannot convert from &#39;itk::SmartPointer&lt;<b>TObjectType</b>&gt;&#39; <b>to</b> &#39;itk::SmartPointer&lt;<b>TObjectType</b>&gt;&#39;
</span><br><span>1&gt;        with
</span><br><span>1&gt;        [
</span><br><span>1&gt;            <b>TObjectType</b>=itk::SparseFieldLevelSetImageFilter&lt;InternalImageType, itk::Image&lt;InternalPixelType,2&gt;&gt;
</span><br><span>1&gt;        ]
</span><br><span>1&gt;        <b>and</b>
</span><br><span>1&gt;        [
</span><br><span>1&gt;            <b>TObjectType</b>=itk::SegmentationLevelSetImageFilter&lt;InternalImageType,InternalImageType&gt;
</span><br><span>1&gt;        ]
</span><br><span>1&gt;        No constructor could take the source type, or constructor overload resolution was <b>ambiguous</b>
</span><br><span>1&gt;Build log was saved <b>at</b> &quot;file://c:\Documents <b>and</b> Settings\USER\My Documents\Visual Studio 2008\Projects\CellSegm01\cellSegmentation.dir\Debug\BuildLog.htm&quot;
</span><br><span>1&gt;cellSegmentation - 1 error(s), 0 warning(s)
</span><br><span>2&gt;------ Skipped Build: Project: <b>ALL_BUILD</b>, Configuration: Debug Win32 ------
</span><br><br><br><br><span>Originally I had <b>a</b> longer program with the speed function <b>and</b> I was landing into the error below. Then I reduced the program <b>to</b> the very basic (<b>above</b>) <b>and</b> still I get the error. 
</span><br><br><span>1&gt;------ Build started: Project: cellSegmentation, Configuration: Debug Win32 ------
</span><br><span>1&gt;Compiling...
</span><br><span>1&gt;cellSegmentation.cxx
</span><br><span>1&gt;c:\documents <b>and</b>
settings\user\my documents\visual studio
2008\projects\cellsegm01\itkSNAPLevelSetFunction.txx(347) : error
C2664:
&#39;itk::VectorLinearInterpolateImageFunction&lt;TInputImage,TCoordRep&gt;::EvaluateAtContinuousIndex&#39;
: cannot convert parameter 1 from
&#39;itk::ContinuousIndex&lt;TCoordRep,VIndexDimension&gt;&#39; <b>to</b> &#39;const itk::ContinuousIndex&lt;TCoordRep,VIndexDimension&gt; &amp;&#39;
</span><br><span>1&gt;        with
</span><br><span>1&gt;        [
</span><br><span>1&gt;            TInputImage=itk::Image&lt;itk::FixedArray&lt;float,2&gt;,2&gt;,
</span><br><span>1&gt;            TCoordRep=float
</span><br><span>1&gt;        ]
</span><br><span>1&gt;        <b>and</b>
</span><br><span>1&gt;        [
</span><br><span>1&gt;            TCoordRep=double,
</span><br><span>1&gt;            VIndexDimension=2
</span><br><span>1&gt;        ]
</span><br><span>1&gt;        <b>and</b>
</span><br><span>1&gt;        [
</span><br><span>1&gt;            TCoordRep=float,
</span><br><span>1&gt;            VIndexDimension=2
</span><br><span>1&gt;        ]
</span><br><span>1&gt;        Reason: cannot convert from &#39;itk::ContinuousIndex&lt;TCoordRep,VIndexDimension&gt;&#39; <b>to</b> &#39;const itk::ContinuousIndex&lt;TCoordRep,VIndexDimension&gt;&#39;
</span><br><span>1&gt;        with
</span><br><span>1&gt;        [
</span><br><span>1&gt;            TCoordRep=double,
</span><br><span>1&gt;            VIndexDimension=2
</span><br><span>1&gt;        ]
</span><br><span>1&gt;        <b>and</b>
</span><br><span>1&gt;        [
</span><br><span>1&gt;            TCoordRep=float,
</span><br><span>1&gt;            VIndexDimension=2
</span><br><span>1&gt;        ]
</span><br><span>1&gt;        No user-defined-conversion operator <b>available</b> that can perform this conversion, or the operator cannot be called
</span><br><br><br><span>Thank you for your help...
</span><br><br><span>Gupt</span></div>
<br>_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at: <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br>