[Insight-users] itk Subtraction Image filter runtime error
Miller, James V (Research)
millerjv@crd.ge.com
Mon May 10 17:36:57 EDT 2004
Sachin,
You called SetInput1 twice, so the second input to the subtract filter
was not set.
This will cause an exception to be thrown do to an improper number of
inputs being specified. Your application did not try to catch the
exception.
Jim
-----Original Message-----
From: Sachin Jambawalikar [mailto:sachinjam@gmail.com]
Sent: Monday, May 10, 2004 12:20 PM
To: insight-users@itk.org
Subject: [Insight-users] itk Subtraction Image filter runtime error
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;
}
_______________________________________________
Insight-users mailing list
Insight-users@itk.org
http://www.itk.org/mailman/listinfo/insight-users
More information about the Insight-users
mailing list