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"><<a href="mailto:adityargupta@gmail.com">adityargupta@gmail.com</a>></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'm using Level Set Segmentation for my project <b>and</b> <b>am</b> trying <b>to</b> develop my own speed function. I'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'm getting errors. Below is <b>a</b> very simple program where I'm creating <b>an</b> instance of <b>a</b> pointer <b>to</b> this filter <b>and</b> I'm getting the error that follows the program. I've tried changing data types but I'm unable <b>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>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< InternalPixelType, Dimension > InternalImageType;
</span><br><span>
</span><br><span> typedef itk::SegmentationLevelSetImageFilter<InternalImageType, InternalImageType> 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>------ 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>TObjectType</b>>' <b>to</b> 'itk::SmartPointer<<b>TObjectType</b>>'
</span><br><span>1> with
</span><br><span>1> [
</span><br><span>1> <b>TObjectType</b>=itk::SparseFieldLevelSetImageFilter<InternalImageType, itk::Image<InternalPixelType,2>>
</span><br><span>1> ]
</span><br><span>1> <b>and</b>
</span><br><span>1> [
</span><br><span>1> <b>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>ambiguous</b>
</span><br><span>1>Build log was saved <b>at</b> "file://c:\Documents <b>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>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>------ 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>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>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>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>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>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>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>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>