[Insight-users] trouble with SceneSpatialObject::RemoveSpatialObject

Kexiang Wang kxwang at gmail.com
Tue Jun 29 01:21:09 EDT 2004


#include "itkSpatialObject.h"
#include "itkSpatialObjectPoint.h"
#include "itkSceneSpatialObject.h"


void foo()
{
	itk::SceneSpatialObject<2>::Pointer scene = itk::SceneSpatialObject<2>::New();
	itk::SpatialObject<2>::Pointer object = itk::SpatialObject<2>::New();
	scene->AddSpatialObject(object);

	scene->RemoveSpatialObject(object);

}

void main()
{
	foo();
}

A access violvation occurs when foo() returns.  I guess something
wrong with 'object' but don't know to fix it. please help.


More information about the Insight-users mailing list