[Insight-users] Histogram quantile method

Radhika Sivaramakrishna radhika.sivaramakrishna at synarc.com
Mon, 9 Feb 2004 08:27:02 -0800


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_01C3EF29.8C21BDE8
Content-Type: text/plain

Hi Luis,
Thanks for clarifying this. I have some questions regarding
ScalarImagetoHistogramGenerator. I could not locate the documentation for
this in Doxygen.
My questions are:

I have  a 3D image and mask. I want to find the histogram of the image only
where the mask is on. I then want to use the Quantile method to find a
threshold on the image which is at 90% (again only in region of mask). Is
there a simple way to do this? 

I am assuming the quantile method also takes into account the counts at
zero?
Right now, I use the MaskImageFilter to mask my image with the given mask. I
implemented the above using iterators but advancing by 1 to skip the count
at 0. Is there a better way to do this?
Thanks
Radhika




-----Original Message-----
From: Luis Ibanez [mailto:luis.ibanez at kitware.com] 
Sent: Friday, February 06, 2004 6:42 PM
To: Radhika Sivaramakrishna
Cc: ITK
Subject: Re: [Insight-users] Histogram quantile method


Hi Radhika,


Resistance if futile...


The solution in this case is not to remove
the existing 'const' but to  add new ones.

The real issue here is that the method Quantile()
should be 'const', since it simply computes a
double using existing information from the Histogram.
This methods doesn't change the content nor the state
of the Histogram.

The 'const' declaration has been added to the
itkHistogram.h and .txx files in the CVS
repository. You may want to update your checkout
in order to get these modifications.


Please let us know if you find any further
problems.


   Thanks


     Luis



---------------------------------
Radhika Sivaramakrishna wrote:

> Hi Luis,
> 
> I adapted the example ImageHistogram2.cxx which uses 
> ScalarImagetoHistogramGenerator to generate a histogram from a 3D image. 
> I wanted to next threshold the image
> 
> using a threshold which I hoped to derive by using the Quantile 
> function. But I am getting a compile error:
> 
>  
> 
> HistogramThreshold.cxx:125: passing
> 
>    `const main(int, char**)::HistogramType' as `this' argument of `double
> 
>    itk::Statistics::Histogram<TMeasurement, VMeasurementVectorSize,
> 
>    TFrequencyContainer>::Quantile(unsigned int, const double&) [with
> 
>    TMeasurement = double, unsigned int VMeasurementVectorSize = 1,
> 
>    TFrequencyContainer = itk::Statistics::DenseFrequencyContainer<float>]'
> 
>    discards qualifiers
> 
>  
> 
> I thought it might be a "const" problem so I removed all the const 
> declarations but I still got a similar error.
> 
> Can you help me figure out what the problem is?
> 
>  
> 
> 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_01C3EF29.8C21BDE8
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] Histogram quantile method</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2>Hi Luis,</FONT>
<BR><FONT SIZE=3D2>Thanks for clarifying this. I have some questions =
regarding ScalarImagetoHistogramGenerator. I could not locate the =
documentation for this in Doxygen.</FONT></P>

<P><FONT SIZE=3D2>My questions are:</FONT>
</P>

<P><FONT SIZE=3D2>I have&nbsp; a 3D image and mask. I want to find the =
histogram of the image only where the mask is on. I then want to use =
the Quantile method to find a threshold on the image which is at 90% =
(again only in region of mask). Is there a simple way to do this? =
</FONT></P>

<P><FONT SIZE=3D2>I am assuming the quantile method also takes into =
account the counts at zero?</FONT>
<BR><FONT SIZE=3D2>Right now, I use the MaskImageFilter to mask my =
image with the given mask. I implemented the above using iterators but =
advancing by 1 to skip the count at 0. Is there a better way to do =
this?</FONT></P>

<P><FONT SIZE=3D2>Thanks</FONT>
<BR><FONT SIZE=3D2>Radhika</FONT>
</P>
<BR>
<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: Friday, February 06, 2004 6:42 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] Histogram quantile =
method</FONT>
</P>
<BR>

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

<P><FONT SIZE=3D2>Resistance if futile...</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>The solution in this case is not to remove</FONT>
<BR><FONT SIZE=3D2>the existing 'const' but to&nbsp; add new =
ones.</FONT>
</P>

<P><FONT SIZE=3D2>The real issue here is that the method =
Quantile()</FONT>
<BR><FONT SIZE=3D2>should be 'const', since it simply computes a</FONT>
<BR><FONT SIZE=3D2>double using existing information from the =
Histogram.</FONT>
<BR><FONT SIZE=3D2>This methods doesn't change the content nor the =
state</FONT>
<BR><FONT SIZE=3D2>of the Histogram.</FONT>
</P>

<P><FONT SIZE=3D2>The 'const' declaration has been added to the</FONT>
<BR><FONT SIZE=3D2>itkHistogram.h and .txx files in the CVS</FONT>
<BR><FONT SIZE=3D2>repository. You may want to update your =
checkout</FONT>
<BR><FONT SIZE=3D2>in order to get these modifications.</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>Please let us know if you find any further</FONT>
<BR><FONT SIZE=3D2>problems.</FONT>
</P>
<BR>

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

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

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

<P><FONT SIZE=3D2>&gt; Hi Luis,</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; I adapted the example ImageHistogram2.cxx which =
uses </FONT>
<BR><FONT SIZE=3D2>&gt; ScalarImagetoHistogramGenerator to generate a =
histogram from a 3D image. </FONT>
<BR><FONT SIZE=3D2>&gt; I wanted to next threshold the image</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; using a threshold which I hoped to derive by =
using the Quantile </FONT>
<BR><FONT SIZE=3D2>&gt; function. But I am getting a compile =
error:</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; HistogramThreshold.cxx:125: passing</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp; `const main(int, =
char**)::HistogramType' as `this' argument of `double</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp; =
itk::Statistics::Histogram&lt;TMeasurement, =
VMeasurementVectorSize,</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp; =
TFrequencyContainer&gt;::Quantile(unsigned int, const double&amp;) =
[with</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp; TMeasurement =3D double, =
unsigned int VMeasurementVectorSize =3D 1,</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp; TFrequencyContainer =3D =
itk::Statistics::DenseFrequencyContainer&lt;float&gt;]'</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp; discards qualifiers</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; I thought it might be a &quot;const&quot; =
problem so I removed all the const </FONT>
<BR><FONT SIZE=3D2>&gt; declarations but I still got a similar =
error.</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; Can you help me figure out what the problem =
is?</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; 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_01C3EF29.8C21BDE8--