[Insight-users] ITK Level Set Segmentation

Kishore Mosaliganti kishoreraom at gmail.com
Tue Sep 22 19:34:55 EDT 2009


What are your objects like. Are they connected to each other or disjoint? If
they are disjoint, you can get away with a single levelset function.

Are there image features like image gradients that characterize the object
boundaries. If so, you can use the
GeodesicActiveContoursLevelSetImageFilter. Assuming the objects are
connected, you can instantiate it inside the for loop and run it n times,
each time giving you a different object. In each iteration, you will need to
initialize a levelset function inside the n different objects successively.

The usage of the class is given as an example in the ITKSoftwareGuide. There
are many other levelset classes too.

Kishore

On Tue, Sep 22, 2009 at 5:51 PM, Aditya Gupta <adityargupta at gmail.com>wrote:

> Hey Kishore,
>
> Thank you so much for your help. I derived a class from the
> itkSegmentationLevelSetImageFilter and now I'm not getting any errors. But
> I'm still stuck with a method to call LevelSet n times for a image where n
> would be the number of objects I need to segment using level set. Like from
> my code I want to give something like LevelSet->Start() and have a
> LevelSet->Run() within a for loop which iterates n times. Any help will be
> appreciated.
>
> Thank you.
>
> Regards,
> Aditya Gupta
>
>
> On Mon, Sep 21, 2009 at 9:20 PM, Kishore Mosaliganti <
> kishoreraom at gmail.com> wrote:
>
>> 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/20090923/4f54caed/attachment-0001.htm>


More information about the Insight-users mailing list