[Insight-users] How can I visualize the evolution of a level set segmentation

Luis Ibanez luis.ibanez at kitware.com
Tue Jul 6 21:12:53 EDT 2004


Hi Olivier,

The GetOutput() method in this class will give you the
current state of the LevelSet. Note that this will be a
grayscale image so you will not see directly the evolution
of a contour unless you do something like extracting
iso-surfaces on it. Officially you only need the iso-surface
at level = zero.

Note also, that any processing you do in this image for
producing a visualization *should not* attempt to update
the images since that will trigger the pipeline again
while you are simply attending an iteration event.

An option could be to use iterators for manually copying
the pixel values and doing a thresholing on them, then
displaying that binary images.  You will find hints on
how to do this in the SoftwareGuide chapter on Iterators.


     http://www.itk.org/ItkSoftwareGuide.pdf



Regards,


      Luis



----------------------

olivier Bernard wrote:

> Hi,
> I try to visualize the evolution of a segmentation using the levelset method.
> I'm using the class itkGeodesicActiveContourLevelSetImageFilter.
> To visualize each step I tried to implement the event/observer method.
> (I give at the end of the mail the code that I'm using).
> My problem is that I didn't manage to extract the result of the semgentation
>  obtained after each step.
> How can I do this ?
> 
> Thanks,
> olivier
> 
> 
> 
> 
> class CommandIterationUpdate : public itk::Command
> {
> public:
> 	typedef  CommandIterationUpdate   Self;
> 	typedef  itk::Command             Superclass;
> 	typedef itk::SmartPointer<Self>  Pointer;
> 	itkNewMacro( Self );
> protected:
> 	CommandIterationUpdate() {};
> public:
> 	typedef float PixelFloatType;
> 	typedef itk::Image< PixelFloatType, 2 > ImageFloatType;
> 	typedef  itk::GeodesicActiveContourLevelSetImageFilter< ImageFloatType,
>                 ImageFloatType >		GeodesicActiveContourFilterType;
> 
> void Execute(itk::Object *caller, const itk::EventObject & event)
> 	{
> 		Execute( (const itk::Object *)caller, event);
> 	}
> 
> void Execute(const itk::Object * object, const itk::EventObject & event)
>    {
> 		const GeodesicActiveContourFilterType * geodesicActiveContour=
>                  dynamic_cast< const GeodesicActiveContourFilterType * >(
> object );
> 
> 		if( typeid( event ) != typeid( itk::IterationEvent ) )
> 		{
> 		return;
> 		}
> 		std::cout << geodesicActiveContour->GetElapsedIterations()<< "   ";
> 	}
> };
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 





More information about the Insight-users mailing list