[Insight-users] Problem implementing GradientAnisotropicDiffusionImageFilter

Bill Lorensen bill.lorensen at gmail.com
Mon Dec 7 12:11:23 EST 2009


BasicFilters/itkStatisticsImageFilter computes a number of common statistics.

On Mon, Dec 7, 2009 at 10:50 AM, O'Connor, Michael
<Michael.OConnor at umassmed.edu> wrote:
> Hello again Bill,
>    Once again thanks for resolving my issue last week.   As stated
> previously, doing as you advised & using conductance (K) that is a function
> of the average gradient magnitude does give expected results and resolves my
> issue
>    I am now cleaning up my documentation so that other users will have an
> understanding how to specify conductance.  To start, I am wondering if
> scaling conductance parameter by average gradient magnitude is done to
> extend dynamic range of filters using gradient magnitudes?   Also I do agree
> with you that it can be an advantage that the itk class as written is
> independent of intesity range; however in our case the user will clearly
> know the intensity magnitude and therefore have a good idea of gradient
> magnitude of the boundary across which there should be little/no diffusion.
> Yet the user will not know the average gradient magnitude in the image.   I
> have used itkGradientMagnitudeImageFilter to get gradient magnitudes in
> order to determine the average gradient magnitude (that confirmed what you
> told me that in the test image that I sent you the mean gradient magnitude
> was 0.0005).   I am wondering if there is a public function that gives this
> mean or did you do essentially what I did to determine the mean gradient
> magnitude?
>
> Regards,
>   Michael
>
>
> -----Original Message-----
> From: Bill Lorensen [mailto:bill.lorensen at gmail.com]
> Sent: Wed 12/2/2009 10:22 AM
> To: O'Connor, Michael
> Cc: Luis Ibanez; insight-users at itk.org
> Subject: Re: [Insight-users] Problem implementing
> GradientAnisotropicDiffusionImageFilter
>
> The advantage of the itk class is that the conductance you provide is
> independent of the image intensity range.
>
> On Wed, Dec 2, 2009 at 10:12 AM, O'Connor, Michael
> <Michael.OConnor at umassmed.edu> wrote:
>> Hello Bill and Luis,
>>    With conductance = 6 the ITK data output do compare well with MATLAB.
>> Thanks for your help.
>>
>> Regards,
>>    Mike
>>
>>
>> -----Original Message-----
>> From: Bill Lorensen [mailto:bill.lorensen at gmail.com]
>> Sent: Wed 12/2/2009 12:03 AM
>> To: O'Connor, Michael
>> Cc: Luis Ibanez; insight-users at itk.org
>> Subject: Re: [Insight-users] Problem implementing
>> GradientAnisotropicDiffusionImageFilter
>>
>> The average gradient in your data is about .0005.  So the conductance
>> of the itk code should be about the matlab conductance / .0005 which
>> is about .003 / .0005 = 6.
>>
>> Try a conductance of 6  without scaling your data and see how it compares.
>>
>> Bill
>>
>>
>> On Tue, Dec 1, 2009 at 11:36 PM, Bill Lorensen <bill.lorensen at gmail.com>
>> wrote:
>>> In itk, the K divisor is average_gradient_squared *
>>> conductance_squared. I suspect that accounts for some of the
>>> difference.
>>>
>>> On Tue, Dec 1, 2009 at 9:01 PM, O'Connor, Michael
>>> <Michael.OConnor at umassmed.edu> wrote:
>>>> Hello Luis,
>>>>      The pixel spacing is .2 mm.   I did not SetSpacing in ITK code.
>>>> Thanks for the insight.   I will check that out.
>>>>
>>>> Regards,
>>>>    Michael
>>>>
>>>>
>>>> -----Original Message-----
>>>> From: Luis Ibanez [mailto:luis.ibanez at kitware.com]
>>>> Sent: Tue 12/1/2009 7:56 PM
>>>> To: O'Connor, Michael
>>>> Cc: Bill Lorensen; insight-users at itk.org
>>>> Subject: Re: [Insight-users] Problem implementing
>>>> GradientAnisotropicDiffusionImageFilter
>>>>
>>>> Hi Michael,
>>>>
>>>> What is the pixel spacing of your image ?
>>>>
>>>> I believe that the ITK implementation may
>>>> be taking the pixel spacing into account
>>>> when using the value of conductance.
>>>>
>>>>
>>>>    Please let us know,
>>>>
>>>>
>>>>              Thanks
>>>>
>>>>
>>>>                        Luis
>>>>
>>>>
>>>> ------------------------------------------------------------------
>>>> On Tue, Dec 1, 2009 at 5:17 PM, O'Connor, Michael
>>>> <Michael.OConnor at umassmed.edu> wrote:
>>>>> Hi Bill,
>>>>>     I use the exact same file with ITK (the one attached to the
>>>>> previous
>>>>> email with MATLAB code).
>>>>>
>>>>> Regards,
>>>>>    Michael
>>>>>
>>>>>
>>>>> -----Original Message-----
>>>>> From: Bill Lorensen [mailto:bill.lorensen at gmail.com]
>>>>> Sent: Tue 12/1/2009 4:17 PM
>>>>> To: O'Connor, Michael
>>>>> Cc: insight-users at itk.org
>>>>> Subject: Re: [Insight-users] Problem implementing
>>>>> GradientAnisotropicDiffusionImageFilter
>>>>>
>>>>> Can you provide a png file or meta file, or whatever file you tried
>>>>> with
>>>>> itk?
>>>>>
>>>>> On Tue, Dec 1, 2009 at 4:08 PM, O'Connor, Michael
>>>>> <Michael.OConnor at umassmed.edu> wrote:
>>>>>> Hi Bill,
>>>>>>     Thanks.   Attached is simple MATLAB test code  + the MATLAB filter
>>>>>> function used (Dr. Guy Gilboa's code).   I've also take the liberty of
>>>>>> attaching a test image (specifically opened in MATLAB code).   The
>>>>>> test
>>>>>> image is 400x400 float with background = 0.024 + additive Gaussian
>>>>>> Noise
>>>>>> and
>>>>>> foreground (circle) = 0.031 + additive Gaussian Noise.   As said
>>>>>> previously
>>>>>> MATLAB code seems to work as expected as shown in plot.   In ITK there
>>>>>> is
>>>>>> no
>>>>>> similar intraregion filtering (i.e. filtered image ~ input )
>>>>>>
>>>>>> Regards,
>>>>>>    Michael
>>>>>>
>>>>
>>>>
>>>>
>>>
>>
>>
>>
>
>
>


More information about the Insight-users mailing list