<div class="message-text" id="nabble.msgtxt25530506"><span>Hello,
</span><br><br><span>I'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'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'm getting errors. Below is <b class="highlight">a</b> very simple program where I'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'm getting the error that follows the program. I've tried changing data types but I'm unable <b class="highlight">to</b> get rid of this error. Please help... Thank you.
</span><br><br><span>#include "itkImage.h"
</span><br><span>#include "itkImageFileReader.h"
</span><br><span>#include "itkImageFileWriter.h"
</span><br><span>#include "itkSegmentationLevelSetImageFilter.h"
</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< InternalPixelType, Dimension > InternalImageType;
</span><br><span>
</span><br><span> typedef itk::SegmentationLevelSetImageFilter<InternalImageType, InternalImageType> 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>------ Build started: Project: cellSegmentation, Configuration: Debug Win32 ------
</span><br><span>1>Compiling...
</span><br><span>1>cellSegmentation.cxx
</span><br><span>1>.\cellSegmentation.cxx(32) : error C2440: 'initializing' : cannot convert from 'itk::SmartPointer<<b class="highlight">TObjectType</b>>' <b class="highlight">to</b> 'itk::SmartPointer<<b class="highlight">TObjectType</b>>'
</span><br><span>1> with
</span><br><span>1> [
</span><br><span>1> <b class="highlight">TObjectType</b>=itk::SparseFieldLevelSetImageFilter<InternalImageType, itk::Image<InternalPixelType,2>>
</span><br><span>1> ]
</span><br><span>1> <b class="highlight">and</b>
</span><br><span>1> [
</span><br><span>1> <b class="highlight">TObjectType</b>=itk::SegmentationLevelSetImageFilter<InternalImageType,InternalImageType>
</span><br><span>1> ]
</span><br><span>1> No constructor could take the source type, or constructor overload resolution was <b class="highlight">ambiguous</b>
</span><br><span>1>Build log was saved <b class="highlight">at</b> "file://c:\Documents <b class="highlight">and</b> Settings\USER\My Documents\Visual Studio 2008\Projects\CellSegm01\cellSegmentation.dir\Debug\BuildLog.htm"
</span><br><span>1>cellSegmentation - 1 error(s), 0 warning(s)
</span><br><span>2>------ 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>------ Build started: Project: cellSegmentation, Configuration: Debug Win32 ------
</span><br><span>1>Compiling...
</span><br><span>1>cellSegmentation.cxx
</span><br><span>1>c:\documents <b class="highlight">and</b>
settings\user\my documents\visual studio
2008\projects\cellsegm01\itkSNAPLevelSetFunction.txx(347) : error
C2664:
'itk::VectorLinearInterpolateImageFunction<TInputImage,TCoordRep>::EvaluateAtContinuousIndex'
: cannot convert parameter 1 from
'itk::ContinuousIndex<TCoordRep,VIndexDimension>' <b class="highlight">to</b> 'const itk::ContinuousIndex<TCoordRep,VIndexDimension> &'
</span><br><span>1> with
</span><br><span>1> [
</span><br><span>1> TInputImage=itk::Image<itk::FixedArray<float,2>,2>,
</span><br><span>1> TCoordRep=float
</span><br><span>1> ]
</span><br><span>1> <b class="highlight">and</b>
</span><br><span>1> [
</span><br><span>1> TCoordRep=double,
</span><br><span>1> VIndexDimension=2
</span><br><span>1> ]
</span><br><span>1> <b class="highlight">and</b>
</span><br><span>1> [
</span><br><span>1> TCoordRep=float,
</span><br><span>1> VIndexDimension=2
</span><br><span>1> ]
</span><br><span>1> Reason: cannot convert from 'itk::ContinuousIndex<TCoordRep,VIndexDimension>' <b class="highlight">to</b> 'const itk::ContinuousIndex<TCoordRep,VIndexDimension>'
</span><br><span>1> with
</span><br><span>1> [
</span><br><span>1> TCoordRep=double,
</span><br><span>1> VIndexDimension=2
</span><br><span>1> ]
</span><br><span>1> <b class="highlight">and</b>
</span><br><span>1> [
</span><br><span>1> TCoordRep=float,
</span><br><span>1> VIndexDimension=2
</span><br><span>1> ]
</span><br><span>1> 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>