[ITK] [ITK-users] AdaptiveHistogramEqualizationImageFilter 3D

Bradley Lowekamp blowekamp at mail.nih.gov
Fri Oct 16 12:00:53 EDT 2015


Hello,

I am getting similar performance on my laptop with a random image using SimpleITK:

In [4]: img = sitk.Image(512,512,512,sitk.sitkFloat32)

In [8]: img = sitk.AdditiveGaussianNoise(img, standardDeviation=20, mean=127)

In [10]: %timeit -r 1 -n 1 sitk.AdaptiveHistogramEqualization( img, [1]*3, 1, 1)
1 loops, best of 1: 13min 59s per loop

I did notice that this was a single threaded algorithm. From looking at the algorithm, there is an expensive amount of histogram work that needs to be done per pixel. This could easily be made multi-threaded. I would be happy to help and show you similar multi-threading implementation in ITK if you would like to take this up.

Additional, optimization could be achieved by changing the algorithm to a "MovingHistogram" based one.

Alternatively, there are other algorithms that you could use with similar effect such as unsharp mask from gaussian math, or the UnsharpMaskLevelSetImageFilter.

HTH,
Brad


On Oct 16, 2015, at 8:56 AM, JoseBarretoT <jose.de.paula at live.com> wrote:

> Hello guys,
> itk::AdaptiveHistogramEqualizationImageFilter works well when applied in 3D
> images?
> Need to apply this filter to a .mhd arquido a DICOM (zraw), have a similar
> effect as unsharp.
> The problem is that when you step one reader pictures with 3 dimensions oo
> filter takes almost 15 minutes to apply.
> Really it does not apply in 3D images? Or am I doing something wrong?
> Well, follows the code:
> 
> 	itk::GDCMImageIOFactory::RegisterOneFactory();
> 			itk::MetaImageIOFactory::RegisterOneFactory();
> 			itk::VTKImageIOFactory::RegisterOneFactory();
> 			typedef signed short    PixelType;
> 			const unsigned int      Dimension = 3;
> 			typedef itk::Image< PixelType, Dimension >         ImageType;
> 			typedef itk::ImageSeriesReader< ImageType >        ReaderType;
> 
> 			ReaderType::Pointer reader = ReaderType::New();
> 			reader->SetFileName(clXUteis::ConverterStringParaChar("panoramica.mhd"));
> 			reader->Update();
> 
> 			typedef  itk::AdaptiveHistogramEqualizationImageFilter< ImageType >
> AdaptiveHistogramEqualizationImageFilterType;
> 			AdaptiveHistogramEqualizationImageFilterType::Pointer
> adaptiveHistogramEqualizationImageFilter =
> AdaptiveHistogramEqualizationImageFilterType::New();
> 			adaptiveHistogramEqualizationImageFilter->SetInput(reader->GetOutput());
> 			adaptiveHistogramEqualizationImageFilter->SetBeta(1);
> 			adaptiveHistogramEqualizationImageFilter->SetAlpha(1);
> 			adaptiveHistogramEqualizationImageFilter->SetRadius(1);
> 			adaptiveHistogramEqualizationImageFilter->Update(); //delay is 13~45
> minutes
> 
> 			typedef  itk::ImageFileWriter< ImageType  > WriterType;
> 			WriterType::Pointer writer = WriterType::New();
> 			writer->SetFileName("d://output.mhd");
> 			writer->SetUseCompression(1);
> 
> 			writer->SetInput(adaptiveHistogramEqualizationImageFilter->GetOutput());
> 			writer->Update();
> 
> 
> 
> --
> View this message in context: http://itk-users.7.n7.nabble.com/AdaptiveHistogramEqualizationImageFilter-3D-tp36339.html
> Sent from the ITK - Users mailing list archive at Nabble.com.
> _____________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
> 
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/insight-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20151016/b579c645/attachment.html>
-------------- next part --------------
_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/insight-users


More information about the Community mailing list