[Insight-users] Threaded Gaussian Filter

Mike Jackson mike.jackson at bluequartz.net
Thu Oct 1 17:17:41 EDT 2009


Well the process went something like this:
  Look for a gaussian filter in ITK
 Use Google because manually searching in ITK is too daunting.
Google comes back with entries for the example/test code.
Ok, I guess this is how it is done.
 Use the example code in my own code.
Note how slow it goes. Note how straight forward it is to thread.

About 3/4 the way through the threading, have a thought that you are
not the first person to thread that filter.

 Ask on the ITK List....

And so I have inserted the DiscreteGaussianFilter ITK code into my
workflow. Thanks for the heads up and helping me "take my blinders
off".

_________________________________________________________
Mike Jackson                  mike.jackson at bluequartz.net

On Thu, Oct 1, 2009 at 5:12 PM, Karthik Krishnan
<karthik.krishnan at kitware.com> wrote:
> Obviously, when you manually iterate over every pixel like that :
>
>  it.GoToBegin();
>  out.GoToBegin();
>  while (!it.IsAtEnd()) {
>      out.Set( gaussianFunction->EvaluateAtIndex(it.GetIndex() ) );
>      ++it;
>      ++out;
>  }
>
> its not going to magically multithread itself :)
>
>
> Either use the neighborhoodoperatorImageFilter, which is threaded....
>
> Or better still, why don't you use the DiscreteGaussianImageFilter/
> RecursiveGaussianImageFilter ?
>
> Convolving with a gaussian is the same as smoothing with it, since the
> gaussian function is symmetric.
>
>
>
> On Thu, Oct 1, 2009 at 4:48 PM, Mike Jackson
> <mike.jackson at bluequartz.net> wrote:
>> After reading the documentation for each class what is the definition
>> of "large" kernel? My image is 3000 x 3000 Pixels and the kernel we
>> are wanting to use is 25 pixels with a Sigma of 3 pixels.
>>
>> Thanks
>> _________________________________________________________
>> Mike Jackson                  mike.jackson at bluequartz.net
>>
>>
>> On Thu, Oct 1, 2009 at 3:59 PM, Karthik Krishnan
>> <karthik.krishnan at kitware.com> wrote:
>>> Which gaussian smoothing / convolution filter are you using ?
>>> itk::DiscreteGaussianImageFilter or itk::RecursiveGaussianImageFilter.
>>>
>>> In any case, both are threaded. However the execution time differs
>>> based on the filter you use.
>>>
>>> The first is slower, uses a neighborhood operator and visits each
>>> pixel with a gaussian kernel. Its speed will depend on the
>>> MaximumKernelWidth parameter given to the filter.
>>>
>>> The second is an IIR filter, however its much faster for a large
>>> image, its implemented using a separable kernel and is based on
>>> Deriche's approximation. (Its not based on a pixel wise neighborhood
>>> convolution operation).
>>>
>>>
>>>
>>> On Thu, Oct 1, 2009 at 1:41 PM, Mike Jackson
>>> <mike.jackson at bluequartz.net> wrote:
>>>> Anyone have a threaded version of the Gaussian Filter? I am currently
>>>> using the example code for a Gaussian filter from the ITK distribution
>>>> and for the image size I am throwing at it, the iteration loop takes a
>>>> long time because it performs the filter serially on every pixel.
>>>>
>>>> Thanks
>>>> _________________________________________________________
>>>> Mike Jackson                  mike.jackson at bluequartz.net
>>>> BlueQuartz Software                    www.bluequartz.net
>>>> Principal Software Engineer                  Dayton, Ohio
>>>> _____________________________________
>>>> Powered by www.kitware.com
>>>>
>>>> Visit other Kitware open-source projects at
>>>> http://www.kitware.com/opensource/opensource.html
>>>>
>>>> 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://www.itk.org/mailman/listinfo/insight-users
>>>>
>>>
>>>
>>>
>>> --
>>> Karthik Krishnan
>>> R&D Engineer,
>>> Kitware Inc.
>>> Ph: 518 881 4919
>>> Fax: 518 371 4573
>>>
>> _____________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> 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://www.itk.org/mailman/listinfo/insight-users
>>
>
>
>
> --
> Karthik Krishnan
> R&D Engineer,
> Kitware Inc.
> Ph: 518 881 4919
> Fax: 518 371 4573
>


More information about the Insight-users mailing list