Search code examples
itk

itkMRIBiasFieldCorrectionFilter wont run


Did anyone use itk::MRIBiasFieldCorrectionFilter before? It keeps on showing error of exception of memory on filter->Update():

using FilterType = itk::MRIBiasFieldCorrectionFilter < ImageType, ImageType, MaskType >;

FilterType::Pointer filter = FilterType::New();

filter->SetInput(reader->GetOutput());

filter->Update(); 

I didn't input any parameters to this filter except input image from a .dcm file. Reading in the .dcm file is 100% correct since it is successfully shown by QuickView.


Solution

  • Documentation for it says it is for 3D images, and you might be passing a 2D one.

    You could also take a look at the no longer maintained example application. It should work with ITK version 4.2, maybe up to 4.6 or 4.8.