<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7654.12">
<TITLE>RE: [Insight-users] Problem implementing GradientAnisotropicDiffusionImageFilter</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<P><FONT SIZE=2>Hello again Bill,<BR>
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 <BR>
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? <BR>
<BR>
Regards,<BR>
Michael<BR>
<BR>
<BR>
-----Original Message-----<BR>
From: Bill Lorensen [<A HREF="mailto:bill.lorensen@gmail.com">mailto:bill.lorensen@gmail.com</A>]<BR>
Sent: Wed 12/2/2009 10:22 AM<BR>
To: O'Connor, Michael<BR>
Cc: Luis Ibanez; insight-users@itk.org<BR>
Subject: Re: [Insight-users] Problem implementing GradientAnisotropicDiffusionImageFilter<BR>
<BR>
The advantage of the itk class is that the conductance you provide is<BR>
independent of the image intensity range.<BR>
<BR>
On Wed, Dec 2, 2009 at 10:12 AM, O'Connor, Michael<BR>
<Michael.OConnor@umassmed.edu> wrote:<BR>
> Hello Bill and Luis,<BR>
> With conductance = 6 the ITK data output do compare well with MATLAB.<BR>
> Thanks for your help.<BR>
><BR>
> Regards,<BR>
> Mike<BR>
><BR>
><BR>
> -----Original Message-----<BR>
> From: Bill Lorensen [<A HREF="mailto:bill.lorensen@gmail.com">mailto:bill.lorensen@gmail.com</A>]<BR>
> Sent: Wed 12/2/2009 12:03 AM<BR>
> To: O'Connor, Michael<BR>
> Cc: Luis Ibanez; insight-users@itk.org<BR>
> Subject: Re: [Insight-users] Problem implementing<BR>
> GradientAnisotropicDiffusionImageFilter<BR>
><BR>
> The average gradient in your data is about .0005. So the conductance<BR>
> of the itk code should be about the matlab conductance / .0005 which<BR>
> is about .003 / .0005 = 6.<BR>
><BR>
> Try a conductance of 6 without scaling your data and see how it compares.<BR>
><BR>
> Bill<BR>
><BR>
><BR>
> On Tue, Dec 1, 2009 at 11:36 PM, Bill Lorensen <bill.lorensen@gmail.com><BR>
> wrote:<BR>
>> In itk, the K divisor is average_gradient_squared *<BR>
>> conductance_squared. I suspect that accounts for some of the<BR>
>> difference.<BR>
>><BR>
>> On Tue, Dec 1, 2009 at 9:01 PM, O'Connor, Michael<BR>
>> <Michael.OConnor@umassmed.edu> wrote:<BR>
>>> Hello Luis,<BR>
>>> The pixel spacing is .2 mm. I did not SetSpacing in ITK code.<BR>
>>> Thanks for the insight. I will check that out.<BR>
>>><BR>
>>> Regards,<BR>
>>> Michael<BR>
>>><BR>
>>><BR>
>>> -----Original Message-----<BR>
>>> From: Luis Ibanez [<A HREF="mailto:luis.ibanez@kitware.com">mailto:luis.ibanez@kitware.com</A>]<BR>
>>> Sent: Tue 12/1/2009 7:56 PM<BR>
>>> To: O'Connor, Michael<BR>
>>> Cc: Bill Lorensen; insight-users@itk.org<BR>
>>> Subject: Re: [Insight-users] Problem implementing<BR>
>>> GradientAnisotropicDiffusionImageFilter<BR>
>>><BR>
>>> Hi Michael,<BR>
>>><BR>
>>> What is the pixel spacing of your image ?<BR>
>>><BR>
>>> I believe that the ITK implementation may<BR>
>>> be taking the pixel spacing into account<BR>
>>> when using the value of conductance.<BR>
>>><BR>
>>><BR>
>>> Please let us know,<BR>
>>><BR>
>>><BR>
>>> Thanks<BR>
>>><BR>
>>><BR>
>>> Luis<BR>
>>><BR>
>>><BR>
>>> ------------------------------------------------------------------<BR>
>>> On Tue, Dec 1, 2009 at 5:17 PM, O'Connor, Michael<BR>
>>> <Michael.OConnor@umassmed.edu> wrote:<BR>
>>>> Hi Bill,<BR>
>>>> I use the exact same file with ITK (the one attached to the previous<BR>
>>>> email with MATLAB code).<BR>
>>>><BR>
>>>> Regards,<BR>
>>>> Michael<BR>
>>>><BR>
>>>><BR>
>>>> -----Original Message-----<BR>
>>>> From: Bill Lorensen [<A HREF="mailto:bill.lorensen@gmail.com">mailto:bill.lorensen@gmail.com</A>]<BR>
>>>> Sent: Tue 12/1/2009 4:17 PM<BR>
>>>> To: O'Connor, Michael<BR>
>>>> Cc: insight-users@itk.org<BR>
>>>> Subject: Re: [Insight-users] Problem implementing<BR>
>>>> GradientAnisotropicDiffusionImageFilter<BR>
>>>><BR>
>>>> Can you provide a png file or meta file, or whatever file you tried with<BR>
>>>> itk?<BR>
>>>><BR>
>>>> On Tue, Dec 1, 2009 at 4:08 PM, O'Connor, Michael<BR>
>>>> <Michael.OConnor@umassmed.edu> wrote:<BR>
>>>>> Hi Bill,<BR>
>>>>> Thanks. Attached is simple MATLAB test code + the MATLAB filter<BR>
>>>>> function used (Dr. Guy Gilboa's code). I've also take the liberty of<BR>
>>>>> attaching a test image (specifically opened in MATLAB code). The test<BR>
>>>>> image is 400x400 float with background = 0.024 + additive Gaussian<BR>
>>>>> Noise<BR>
>>>>> and<BR>
>>>>> foreground (circle) = 0.031 + additive Gaussian Noise. As said<BR>
>>>>> previously<BR>
>>>>> MATLAB code seems to work as expected as shown in plot. In ITK there<BR>
>>>>> is<BR>
>>>>> no<BR>
>>>>> similar intraregion filtering (i.e. filtered image ~ input )<BR>
>>>>><BR>
>>>>> Regards,<BR>
>>>>> Michael<BR>
>>>>><BR>
>>><BR>
>>><BR>
>>><BR>
>><BR>
><BR>
><BR>
><BR>
<BR>
<BR>
</FONT>
</P>
</BODY>
</HTML>