[Insight-users] the Problem about seting up a filter pipeline

Shunming Fang shunm_fang at yahoo . com
Wed, 25 Jun 2003 11:29:13 -0700 (PDT)


Hello, ITK_users,
I am newbie of ITK, Our lab want to use some of
filters in itk to deal with image data. I write a
template function: 
ImageType* itkWrapFilters(ImageType* Inputimage),
there, the filter pipeline accepted inputimage and
process it and then return it as imageobject.my main
function is like the follow;
 Image = reader->GetOutput();
OutImage =itkWrapFilters(Image);
writer->SetInput(Outimage)
writer->update;

When I executed this program, segmentation fault
happened becaulse OutImage is empty,I checked the
whole procedure through DBG, I found after
itkWrapFilter process data(inside function, I found
result data was there), the dataobject was destructed
before return. Then, I use smartpointer to try to get
data, after callimg the pipeline function,
smartpointer also didn't get data pointer. Anyone know
how it happen and How I can get the dataobject after
call filter pipeline function?
Thanks
Fang  

__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc . yahoo . com