[Insight-users] ITK Level Set Segmentation

Kishore Mosaliganti kishoreraom at gmail.com
Mon Sep 21 21:20:49 EDT 2009


Hi Gupt,

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.

Since you are looking for level-set methods already implemented, you can
look at classes inheriting from itkSegmentationLevelSetImageFilter. This can
be seen in the very wide figure in:
http://www.itk.org/Doxygen314/html/classitk_1_1SegmentationLevelSetImageFilter.html


Kishore



On Mon, Sep 21, 2009 at 11:48 PM, Aditya Gupta <adityargupta at gmail.com>wrote:

> Hello,
>
> I'm using Level Set Segmentation for my project *and* *am* trying *to*develop my own speed function. I've included the file
> itkSegmentationLevelSetImageFilter.h *and* then was *adding* some
> functions *to* this file *and* I realized that with the original header
> file I'm getting errors. Below is *a* very simple program where I'm
> creating *an* instance of *a* pointer *to* this filter *and* I'm getting
> the error that follows the program. I've tried changing data types but I'm
> unable *to* get rid of this error. Please help... Thank you.
>
> #include "itkImage.h"
> #include "itkImageFileReader.h"
> #include "itkImageFileWriter.h"
> #include "itkSegmentationLevelSetImageFilter.h"
>
> int main( int *argc*, char **argv*[] )
> {
>   typedef   float           InternalPixelType;
>   const unsigned int    Dimension = 2;
>   typedef itk::Image< InternalPixelType, Dimension >  InternalImageType;
>
>         typedef itk::SegmentationLevelSetImageFilter<InternalImageType,
> InternalImageType> SLSfilter;
>
> // *ACTUAL* LEVEL SET starts
>
>         SLSfilter::Pointer multipleLevelSet = SLSfilter::New();
>
>   return 0;
> }
>
> ERROR:
> 1>------ Build started: Project: cellSegmentation, Configuration: Debug
> Win32 ------
> 1>Compiling...
> 1>cellSegmentation.cxx
> 1>.\cellSegmentation.cxx(32) : error C2440: 'initializing' : cannot convert
> from 'itk::SmartPointer<*TObjectType*>' *to* 'itk::SmartPointer<*
> TObjectType*>'
> 1>        with
> 1>        [
> 1>            *TObjectType*=itk::SparseFieldLevelSetImageFilter<InternalImageType,
> itk::Image<InternalPixelType,2>>
> 1>        ]
> 1>        *and*
> 1>        [
> 1>            *TObjectType*=itk::SegmentationLevelSetImageFilter<InternalImageType,InternalImageType>
>
> 1>        ]
> 1>        No constructor could take the source type, or constructor
> overload resolution was *ambiguous*
> 1>Build log was saved *at* "file://c:\Documents *and* Settings\USER\My
> Documents\Visual Studio
> 2008\Projects\CellSegm01\cellSegmentation.dir\Debug\BuildLog.htm"
> 1>cellSegmentation - 1 error(s), 0 warning(s)
> 2>------ Skipped Build: Project: *ALL_BUILD*, Configuration: Debug Win32
> ------
>
>
>
> Originally I had *a* longer program with the speed function *and* I was
> landing into the error below. Then I reduced the program *to* the very
> basic (*above*) *and* still I get the error.
>
> 1>------ Build started: Project: cellSegmentation, Configuration: Debug
> Win32 ------
> 1>Compiling...
> 1>cellSegmentation.cxx
> 1>c:\documents *and* 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>' *to* 'const
> itk::ContinuousIndex<TCoordRep,VIndexDimension> &'
> 1>        with
> 1>        [
> 1>            TInputImage=itk::Image<itk::FixedArray<float,2>,2>,
> 1>            TCoordRep=float
> 1>        ]
> 1>        *and*
> 1>        [
> 1>            TCoordRep=double,
> 1>            VIndexDimension=2
> 1>        ]
> 1>        *and*
> 1>        [
> 1>            TCoordRep=float,
> 1>            VIndexDimension=2
> 1>        ]
> 1>        Reason: cannot convert from
> 'itk::ContinuousIndex<TCoordRep,VIndexDimension>' *to* 'const
> itk::ContinuousIndex<TCoordRep,VIndexDimension>'
> 1>        with
> 1>        [
> 1>            TCoordRep=double,
> 1>            VIndexDimension=2
> 1>        ]
> 1>        *and*
> 1>        [
> 1>            TCoordRep=float,
> 1>            VIndexDimension=2
> 1>        ]
> 1>        No user-defined-conversion operator *available* that can perform
> this conversion, or the operator cannot be called
>
>
> Thank you for your help...
>
> Gupt
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090922/6e172112/attachment.htm>


More information about the Insight-users mailing list