[Insight-users] More questions on Daniellson distance map fil ter

Radhika Sivaramakrishna radhika.sivaramakrishna at synarc.com
Wed, 14 Apr 2004 10:45:45 -0700


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C42247.CFF1079E
Content-Type: text/plain

Hi Luis,
Thanks for your explanation. I have a doubt: when the UseImageSpacing is
enabled, does this (1) take into account diagonal distances and (2)
nonisotropic voxels also? I thought it did both. If I want to just make sure
that diagonal distances are taken into account (ie I don't want to do city
block distances or chessboard distances), but do not want to take
non-isotropy into account, what should I do?
Hope my question is clear.
Thanks
Radhika



-----Original Message-----
From: Luis Ibanez [mailto:luis.ibanez at kitware.com] 
Sent: Monday, April 12, 2004 6:46 PM
To: Radhika Sivaramakrishna
Cc: ITK
Subject: Re: [Insight-users] More questions on Daniellson distance map
filter



Hi Radhika,

When you enable the "UseImageSpacing" flag, the values
of pixel spacing are used in the last stage of distance
computation. The spacing is used to multiply the distance
components when their squares are summed up.

The resulting distance is then casted to the type of the
output image pixel type. This is done in the file:

     Insight/Code/BasicFilters/
       itkDanielssonDistanceMapImageFilter.txx:

in line 299:

    dt.Set(
      static_cast<
         typename
           OutputImageType::PixelType>(sqrt( distance )) );


Note that the casting is done as a flat truncation.
No effort is made for scaling the distances in the
range of the pixel type.  Depending on the physical
extent of your image, this may or may not be a problem.



If you want to compute this distance scaling in a better
way, you could setup the output pixel type as float,
and then connect the output of the DanielssonDistanceMap
filter to a RescaleIntensityImageFilter with output pixel
type = unsigned char.  This last filter will then rescale
nicely the distances into the range of intensities of the
output image. Note that with this filter you can select
what values to use for representing the maximum and minimum
values of the distance.


--

You may want to take a look at the new VolView plugin
for computing the Danielsson distance. The source code
for this plugin is available at


       InsightApplications/
                VolviewPlugins/
                   vvITKDanielssonDistanceMap.cxx




Please let us know if you have further questions,


Thanks


   Luis



-------------------------------

Radhika Sivaramakrishna wrote:

> Hi,
> 
> I had more questions on the Danielsson distance map filter. I have set 
> the input and output of the filter to unsigned char.
> 
> I have also put the SetUseImageSpacing flag to true. This means that 
> actual distances may be computed which are more floating point
> 
> numbers.  Since I am forcing the output to unsigned char, then does this 
> mean that the actual distances are truncated to unsigned char
> 
> or are they rounded to it? Is there a better way to handle this?
> 
> Thanks
> 
> Radhika
> 
>  
> 
> -----------------------------------------------------
> 
> Confidentiality Notice.
> 
> This email message is for the sole use of the intended recipient(s) and 
> may contain confidential and privileged information. Any unauthorized 
> review, use, disclosure or distribution is prohibited. If you are not 
> the intended recipient, please contact the sender by reply email and 
> destroy all copies of the original message. If you are the intended 
> recipient, please be advised that the content of this message is subject 
> to access, review and disclosure by the sender's Email System
Administrator.
> 


                                                     
-----------------------------------------------------  
Confidentiality Notice. 
This email message is for the sole use of the intended recipient(s) and may
contain confidential and privileged information. Any unauthorized review,
use, disclosure or distribution is prohibited. If you are not the intended
recipient, please contact the sender by reply email and destroy all copies
of the original message. If you are the intended recipient, please be
advised that the content of this message is subject to access, review and
disclosure by the sender's Email System Administrator.

------_=_NextPart_001_01C42247.CFF1079E
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2656.87">
<TITLE>RE: [Insight-users] More questions on Daniellson distance map =
filter</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2>Hi Luis,</FONT>
<BR><FONT SIZE=3D2>Thanks for your explanation. I have a doubt: when =
the UseImageSpacing is enabled, does this (1) take into account =
diagonal distances and (2) nonisotropic voxels also? I thought it did =
both. If I want to just make sure that diagonal distances are taken =
into account (ie I don't want to do city block distances or chessboard =
distances), but do not want to take non-isotropy into account, what =
should I do?</FONT></P>

<P><FONT SIZE=3D2>Hope my question is clear.</FONT>
<BR><FONT SIZE=3D2>Thanks</FONT>
<BR><FONT SIZE=3D2>Radhika</FONT>
</P>
<BR>
<BR>

<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: Luis Ibanez [<A =
HREF=3D"mailto:luis.ibanez at kitware.com">mailto:luis.ibanez at kitware.com</=
A>] </FONT>
<BR><FONT SIZE=3D2>Sent: Monday, April 12, 2004 6:46 PM</FONT>
<BR><FONT SIZE=3D2>To: Radhika Sivaramakrishna</FONT>
<BR><FONT SIZE=3D2>Cc: ITK</FONT>
<BR><FONT SIZE=3D2>Subject: Re: [Insight-users] More questions on =
Daniellson distance map filter</FONT>
</P>
<BR>
<BR>

<P><FONT SIZE=3D2>Hi Radhika,</FONT>
</P>

<P><FONT SIZE=3D2>When you enable the &quot;UseImageSpacing&quot; flag, =
the values</FONT>
<BR><FONT SIZE=3D2>of pixel spacing are used in the last stage of =
distance</FONT>
<BR><FONT SIZE=3D2>computation. The spacing is used to multiply the =
distance</FONT>
<BR><FONT SIZE=3D2>components when their squares are summed up.</FONT>
</P>

<P><FONT SIZE=3D2>The resulting distance is then casted to the type of =
the</FONT>
<BR><FONT SIZE=3D2>output image pixel type. This is done in the =
file:</FONT>
</P>

<P><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp; =
Insight/Code/BasicFilters/</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
itkDanielssonDistanceMapImageFilter.txx:</FONT>
</P>

<P><FONT SIZE=3D2>in line 299:</FONT>
</P>

<P><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; dt.Set(</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
static_cast&lt;</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
typename</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
OutputImageType::PixelType&gt;(sqrt( distance )) );</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>Note that the casting is done as a flat =
truncation.</FONT>
<BR><FONT SIZE=3D2>No effort is made for scaling the distances in =
the</FONT>
<BR><FONT SIZE=3D2>range of the pixel type.&nbsp; Depending on the =
physical</FONT>
<BR><FONT SIZE=3D2>extent of your image, this may or may not be a =
problem.</FONT>
</P>
<BR>
<BR>

<P><FONT SIZE=3D2>If you want to compute this distance scaling in a =
better</FONT>
<BR><FONT SIZE=3D2>way, you could setup the output pixel type as =
float,</FONT>
<BR><FONT SIZE=3D2>and then connect the output of the =
DanielssonDistanceMap</FONT>
<BR><FONT SIZE=3D2>filter to a RescaleIntensityImageFilter with output =
pixel</FONT>
<BR><FONT SIZE=3D2>type =3D unsigned char.&nbsp; This last filter will =
then rescale</FONT>
<BR><FONT SIZE=3D2>nicely the distances into the range of intensities =
of the</FONT>
<BR><FONT SIZE=3D2>output image. Note that with this filter you can =
select</FONT>
<BR><FONT SIZE=3D2>what values to use for representing the maximum and =
minimum</FONT>
<BR><FONT SIZE=3D2>values of the distance.</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>--</FONT>
</P>

<P><FONT SIZE=3D2>You may want to take a look at the new VolView =
plugin</FONT>
<BR><FONT SIZE=3D2>for computing the Danielsson distance. The source =
code</FONT>
<BR><FONT SIZE=3D2>for this plugin is available at</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
InsightApplications/</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp; VolviewPlugins/</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
vvITKDanielssonDistanceMap.cxx</FONT>
</P>
<BR>
<BR>
<BR>

<P><FONT SIZE=3D2>Please let us know if you have further =
questions,</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>Thanks</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>&nbsp;&nbsp; Luis</FONT>
</P>
<BR>
<BR>

<P><FONT SIZE=3D2>-------------------------------</FONT>
</P>

<P><FONT SIZE=3D2>Radhika Sivaramakrishna wrote:</FONT>
</P>

<P><FONT SIZE=3D2>&gt; Hi,</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; I had more questions on the Danielsson distance =
map filter. I have set </FONT>
<BR><FONT SIZE=3D2>&gt; the input and output of the filter to unsigned =
char.</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; I have also put the SetUseImageSpacing flag to =
true. This means that </FONT>
<BR><FONT SIZE=3D2>&gt; actual distances may be computed which are more =
floating point</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; numbers.&nbsp; Since I am forcing the output to =
unsigned char, then does this </FONT>
<BR><FONT SIZE=3D2>&gt; mean that the actual distances are truncated to =
unsigned char</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; or are they rounded to it? Is there a better =
way to handle this?</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; Thanks</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; Radhika</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp; </FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; =
-----------------------------------------------------</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; Confidentiality Notice.</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; This email message is for the sole use of the =
intended recipient(s) and </FONT>
<BR><FONT SIZE=3D2>&gt; may contain confidential and privileged =
information. Any unauthorized </FONT>
<BR><FONT SIZE=3D2>&gt; review, use, disclosure or distribution is =
prohibited. If you are not </FONT>
<BR><FONT SIZE=3D2>&gt; the intended recipient, please contact the =
sender by reply email and </FONT>
<BR><FONT SIZE=3D2>&gt; destroy all copies of the original message. If =
you are the intended </FONT>
<BR><FONT SIZE=3D2>&gt; recipient, please be advised that the content =
of this message is subject </FONT>
<BR><FONT SIZE=3D2>&gt; to access, review and disclosure by the =
sender's Email System Administrator.</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
</P>
<BR>

<P><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT>
<BR><FONT =
SIZE=3D2>-----------------------------------------------------&nbsp; =
</FONT>
<BR><FONT SIZE=3D2>Confidentiality Notice. </FONT>
<BR><FONT SIZE=3D2>This email message is for the sole use of the =
intended recipient(s) and may contain confidential and privileged =
information. Any unauthorized review, use, disclosure or distribution =
is prohibited. If you are not the intended recipient, please contact =
the sender by reply email and destroy all copies of the original =
message. If you are the intended recipient, please be advised that the =
content of this message is subject to access, review and disclosure by =
the sender's Email System Administrator.</FONT></P>

</BODY>
</HTML>
------_=_NextPart_001_01C42247.CFF1079E--