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

olivier Bernard bernard at creatis.insa-lyon.fr
Mon Jul 5 12:09:26 EDT 2004


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()<< "   ";
	}
};


More information about the Insight-users mailing list