<div class="message-text" id="nabble.msgtxt25530506"><span>Hello,
</span><br><br><span>I&#39;m using Level Set Segmentation for my project <b class="highlight">and</b> <b class="highlight">am</b> trying <b class="highlight">to</b> develop my own speed function. I&#39;ve included the file itkSegmentationLevelSetImageFilter.h <b class="highlight">and</b> then was <b class="highlight">adding</b> some functions <b class="highlight">to</b> this file <b class="highlight">and</b> I realized that with the original header file I&#39;m getting errors. Below is <b class="highlight">a</b> very simple program where I&#39;m creating <b class="highlight">an</b> instance of <b class="highlight">a</b> pointer <b class="highlight">to</b> this filter <b class="highlight">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 class="highlight">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 class="highlight">argc</b>, char *<b class="highlight">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 class="highlight">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 class="highlight">TObjectType</b>&gt;&#39; <b class="highlight">to</b> &#39;itk::SmartPointer&lt;<b class="highlight">TObjectType</b>&gt;&#39;
</span><br><span>1&gt;        with
</span><br><span>1&gt;        [
</span><br><span>1&gt;            <b class="highlight">TObjectType</b>=itk::SparseFieldLevelSetImageFilter&lt;InternalImageType, itk::Image&lt;InternalPixelType,2&gt;&gt;
</span><br><span>1&gt;        ]
</span><br><span>1&gt;        <b class="highlight">and</b>
</span><br><span>1&gt;        [
</span><br><span>1&gt;            <b class="highlight">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 class="highlight">ambiguous</b>
</span><br><span>1&gt;Build log was saved <b class="highlight">at</b> &quot;file://c:\Documents <b class="highlight">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 class="highlight">ALL_BUILD</b>, Configuration: Debug Win32 ------
</span><br><br><br><br><span>Originally I had <b class="highlight">a</b> longer program with the speed function <b class="highlight">and</b> I was landing into the error below. Then I reduced the program <b class="highlight">to</b> the very basic (<b class="highlight">above</b>) <b class="highlight">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 class="highlight">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 class="highlight">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 class="highlight">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 class="highlight">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 class="highlight">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 class="highlight">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 class="highlight">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>