[Insight-users] ImageFilter problems

Fleysher, Lazar lazar.fleysher at mountsinai.org
Fri Dec 23 08:19:21 EST 2011



Hello insight-users at itk.org.

I am new to ITK and I am experiencing a strange problem with the image filters.
So I was wondering if someone could shed some light on this.

I have this code


  typedef itk::OptimalSharpeningImageFilter<ImageType,ImageType > sharpeningFilter;
  typename sharpeningFilter::Pointer shFilter = sharpeningFilter::New();
  shFilter->SetInput( averageimage );
  shFilter->SetSValue(0.5);
//  shFilter->Update();
  averageimage =  shFilter->GetOutput();


which should filter the averageimage.

Unfortunately, when I run this code the resulting averageimage contains zero pixels.
If I uncomment the "Update()" call (which I do not know if is needed) then
the Update() generates a segmentation violation.


I have ITK installed from sources using git clone git://itk.org/ITK.git from
2 days ago. I think it is version 4.1.

Also, I have noticed that if I do not call Update() and try to save the image with

typename writertype::Pointer writer = writertype::New();
writer->SetFileName("aaa");
writer->SetInput( averageimage );
writer->Update();

writer->Update() never returns. That is, it cannot write an empty image.

Am I doing something wrong? What is going on?

Thank you very much for your help

Lazar


More information about the Insight-users mailing list