[Insight-users] itk Subtraction Image filter runtime error

Sachin Jambawalikar sachinjam@gmail.com
Mon May 10 17:19:54 EDT 2004


Hi ,
I'm trying to subtract  two volumes  using itk  SubtractImageFilter.
I get a runtime error   when I do update for subtraction filter.
Error " this application has requested the runtime to terminate in an
unusal way.
please contact  the app support team for more info" 

Can anybody help me on this ???

Regards
--Sachin



typedef itk::Image< float, 3 > ImageType;
typedef itk::SubtractImageFilter<ImageType,ImageType,ImageType>
SubImgFiltertype;


S1Image=LoadImage((const char*)file_name1 );
S2Image=LoadImage((const char*)file_name2);

	SubImgFiltertype::Pointer subfilt=SubImgFiltertype::New();
	subfilt->SetInput1(S1Image);
  subfilt->SetInput1(S2Image);
ImageType::Pointer image=subfilt->GetOutput();
  subfilt->Update();


ImageType::Pointer LoadImage( const char * filename )
{
	VolumeReaderType::Pointer reader;
	ImageType::Pointer image;

	reader = VolumeReaderType::New();
	reader->SetFileName(filename);

	try
	{
		reader->Update();      
		m_LastLoadedImagePath = filename;     
	}
	catch( itk::ExceptionObject &e )
	{
		std::cout<<e<<std::endl;
	}
	catch(...)
	{
		std::cout<<" Unknow exception caught in LoadImage!!!"<<std::endl;
	}

	image = reader->GetOutput();

	return image;
}



More information about the Insight-users mailing list