[ITK] Some Troubles with the itkPatchBasedDenoisingImageFilter
Dženan Zukić
dzenanz at gmail.com
Tue Apr 19 12:47:50 EDT 2016
Hi Andreas,
I can confirm that this filter is slow (even in release mode). However, the
output is not the same as input, there are some slight differences (e.g.
input value 248 for some pixel turns into 249). Not all pixels get changed
with the test image I used. The code I used is attached.
Regards
On Mon, Apr 18, 2016 at 6:18 PM, Andreas Klos <aklos at outlook.de> wrote:
> 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;
>
> }
>
>
>
>
> _______________________________________________
> Community mailing list
> Community at itk.org
> http://public.kitware.com/mailman/listinfo/community
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20160419/8816878d/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.cpp
Type: text/x-c++src
Size: 2836 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/community/attachments/20160419/8816878d/attachment-0001.cpp>
More information about the Community
mailing list