[ITK] Using spatialObjects as filters

Matt McCormick matt.mccormick at kitware.com
Thu Apr 9 17:04:09 EDT 2015


> Are the gaussians normalized during this calculus?

No the DiscreteGaussianImageFilter does not have an option for this;
although, the RecursiveGaussianImageFilter has a normalization flag.


> Can I change the maximum value?

Normalization, etc can be changed with another filter like
MultiplyImageFilter, NormaliszeToConstantImageFilter, or
ShiftScaleImageFilter.


> The variances help me adjust the radius but can I actually limit it?

This can be set with SetMaximumKernelWidth


> is the variance related to the actual radius in voxels? say: a variance of
> sigma would give me a 99.7% of the values under a radius of 3*sigma?

The variance will be in physical units or pixel units depending on
whether SetUseImageSpacing is on or off.


> what if I use the variance sigma but I want to limit it to a 2*sigma raidus?
> can I change the mean?

To limit the where the region is computed, use SetMaximumKernelWidth
or SetMaximumError.


The options, their descriptions, and pointers to other filters can be
found by examining the doxygen help for the class:

  http://www.itk.org/Doxygen/html/classitk_1_1DiscreteGaussianImageFilter.html#a00d9f0aab8f7cd38ba90a517fac58890

HTH,
Matt



>
> Thanks!
>
> Leslie
>
> 2015-04-09 16:38 GMT+02:00 Matt McCormick <matt.mccormick at kitware.com>:
>>
>> On Thu, Apr 9, 2015 at 9:17 AM, Leslie Solorzano <lesolorzanov at gmail.com>
>> wrote:
>> > Hello world.
>>
>> :-)
>>
>>
>> > I want to use a gaussianSpatialObject and a
>> > SpatialObjectToImageStatisticsCalculator to filter an image and make a
>> > gaussian convolution. Why not using a DiscreteGaussianImageFilter? easy,
>> > I
>> > need a gaussian with different radii in each dimension and I need to be
>> > able
>> > to set the size, the maximum value and the sigma, which only a
>> > gaussianSpatialObject can offer me.
>>
>> > is there anyway I can use DiscreteGaussianImageFilter with different
>> > radii?
>> > can I set the maximum value?
>>
>> Yes, DiscreteGaussianImageFilter will give much better performance.
>>
>> To set a different Gaussian width in each direction, something like:
>>
>>   typedef itk::DiscreteGaussianImageFilter< ImageType, ImageType>
>> GaussianFilterType;
>>   typedef GaussianFilterType::ArrayType VariancesType;
>>   VariancesType variances;
>>   variances[0] = 1.1;
>>   variances[1] = 0.5;
>>   variances[2] = 7.7;
>>   GaussianFilterType::Pointer gaussianFilter = GaussianFilterType::New();
>>   gaussianFilter->SetVariance( variances );
>>
>> would set different variances in each direction for a 3D image.
>>
>> HTH,
>> Matt
>
>


More information about the Community mailing list