[ITK] Some Troubles with the itkPatchBasedDenoisingImageFilter
Andreas Klos
aklos at outlook.de
Mon Apr 18 18:18:42 EDT 2016
Dear great ITK- Community,
Currently I am struggeling with the "itkPatchBasedDenoisingImageFilter". I try to use this filter but it does not work for me at the moment. I try to process a 16bit dicom Image with this denoising filter.
Currently when i try to apply this filter my computer seems to be very busy for several minutes. But the result of the computation is the same like the original data. As if there where no processing step performed on the image.
So the question is, do I have to downsample my image to 8 bit image? or do I have to do a special weigthing when I work with 16 bit images? Or is there something special which I should consider when I use this filter?
Because there is no real example about this filter I also have some questions on how to configure this filter to use it in an efficient way.
When I took a look in the doxygen of itk about this filter I read this sentence "It implements schemes for random sampling of patches non-locally (from the entire image)...". Do I understand it right that I can use subsamples of an image to create a searchwindow to reduce the computational time?
It would be very greatful if someone can help me to get a clear mind about this filter and how to apply it correctly.
Below is my current not really satisfying code where I try to determine my search window and the patch size.
Best Regards,
Andreas
typedef itk::Image<PixelType, 2> ImageType2D;
typedef itk::PatchBasedDenoisingImageFilter<ImageType2D, ImageType2D> PatchBasedDenoisingFilterType;
typedef itk::Statistics::GaussianRandomSpatialNeighborSubsampler<PatchBasedDenoisingFilterType::PatchSampleType, ImageType2D::RegionType> SamplerType;
PatchBasedDenoisingFilterType::Pointer denoisingImageFilter= PatchBasedDenoisingFilterType::New();
SamplerType::Pointer sampler = SamplerType::New();
//The value for the patchRadius is provided by the user through a GUI
double dataArray[1];
dataArray[0] = _patchSize;
itk::Array<double> dArray;
dArray.SetData(dataArray);
denoisingImageFilter->SetInput(inputImage);
//Here I set my PatchRadius. my default value is 7
denoisingImageFilter->SetPatchRadius(dArray[0]);
//Here I try to define a searchwindow to reduce the computational time
sampler->SetRadius(21);
denoisingImageFilter->SetSampler(sampler);
try{
denoisingImageFilter->Update();
}
catch (itk::ExceptionObject error){
std::cerr << "An ExceptionObject was caught!" << std::endl;
std::cerr << error << std::endl;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20160419/d2e2a83a/attachment-0001.html>
More information about the Community
mailing list