[Insight-users] Compilation error with inPlace filters
Radhika Sivaramakrishna
radhika.sivaramakrishna at synarc.com
Mon, 9 Feb 2004 12:08:26 -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_01C3EF48.7A676AAC
Content-Type: text/plain
Hi Luis,
Thanks for entering this as a bug.
You are right about the cumulators. I should declare them as float.
I do not understand the issue you pointed to below.
I am forced to do my calculations this way because what I want to do is the
following:
Use the histogram analysis to identify a threshold to threshold the image.
But I want to do the thresholding only in the region of the mask. Ie I am
basically happy my mask, except it also includes regions in the original
image that are higher than the threshold which I want to remove.
If
I just use this threshold through a standard Threshold filter, then I will
end up with a lot of other regions (values lower than this threshold that I
don't need), so I am constraining this thresholding only in the region of
the mask, so I am directly editing the ON pixels in my mask to switch off at
regions in the gray level that are higher than threshold. Is there a better
way to do this?
Radhika
-----Original Message-----
From: Luis Ibanez [mailto:luis.ibanez at kitware.com]
Sent: Monday, February 09, 2004 11:59 AM
To: Radhika Sivaramakrishna
Cc: ITK; Miller, James V (Research)
Subject: Re: [Insight-users] Compilation error with inPlace filters
Hi Radhika,
This seems to be a bug in the RelabelImageFilter.
The issue has been entered in the bug tracker with ID # 582
http://www.itk.org/Bug/bug.php?op=show&bugid=582&pos=0
In the meantime, please instantiate the RelabelImageFilter
using the same image type for input and output.
----
Unrelated to the error above,... but still worrisome:
In your code you are taking the output of a reader and
using an iterator for changing the value of this image.
(the "mask" image in lines 193 - 201 ).
Then you pass the image as input to another filter.
This is a violation of the pipeline encapsulation.
You should use a threshold image filter instead of
using an iterator through the image. The output of the
filters should be const... but we still have this
weakness in ITK filters....
The cumulators that you have for frequencies are
being declared unsigned long. They should be floats
or doubles. Note that Frequencies are not just counters,
they actually provide floating point values.
Regards,
Luis
---------------------------------------
Radhika Sivaramakrishna wrote:
> Hi Luis,
> I actually did the checkout this morning and I did see the Dashboard
> was pretty green. I don't know if I am making a silly mistake or a
> more serious error.
>
> I have copied my code here which doesn't compile and gives the error
> indicated below. I think the problem has something to do with the
> IntImageType I put in for dealing with the Relabel.. filter.
>
> Sorry about not putting the correct subject. Will try to make sure to
> do it from now on.
>
> Radhika
>
>
> -----Original Message-----
> From: Luis Ibanez [mailto:luis.ibanez at kitware.com]
> Sent: Monday, February 09, 2004 10:34 AM
> To: Radhika Sivaramakrishna
> Cc: ITK
> Subject: Re: [Insight-users] Compilation error with inPlace filters
>
>
> Hi Radhika,
>
>
> A number of changes were made last week for extending
> the functionality of "InPlace" filters.
>
> You probably updated your checkout in the middle of
> one of such modifications. Please trying cvs updating
> to this morning (since the nightly Dashboard was quite
> green today).
>
>
> Regards,
>
>
> Luis,
>
>
> PS. Please don't reuse email threads with other subjects when
> you post questions about new topics/problems. This is
> confusing for anybody trying to follow a thread.
>
>
> ---------------------------------------
> Radhika Sivaramakrishna wrote:
>
> > Hi Luis,
> > I am getting this very strange error message while compiling. Can you
> > explain what this could be?
> >
> > /home/rsivaram/Insight/Code/Common/itkInPlaceImageFilter.txx: In member
> > function `void itk::InPlaceImageFilter<TInputImage,
> > TOutputImage>::AllocateOutputs() [with TInputImage = main(int,
> > char**)::IntImageType, TOutputImage = main(int,
> char**)::ImageType]':
> > /home/rsivaram/Insight/Code/Common/itkImageRegion.h:173:
> > instantiated from here
> > /home/rsivaram/Insight/Code/Common/itkInPlaceImageFilter.txx:76: no
> > matching
> > function for call to `itk::InPlaceImageFilter<main(int,
> > char**)::IntImageType, main(int,
> > char**)::ImageType>::GraftOutput(main(int,
> > char**)::IntImageType*)'
> > /home/rsivaram/Insight/Code/Common/itkImageSource.txx:95: candidates
> > are: void
> > itk::ImageSource<TOutputImage>::GraftOutput(TOutputImage*) [with
> > TOutputImage = main(int, char**)::ImageType]
> >
> >
> > 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_01C3EF48.7A676AAC
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] Compilation error with inPlace =
filters</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=3D2>Hi Luis,</FONT>
</P>
<P><FONT SIZE=3D2>Thanks for entering this as a bug. </FONT>
<BR><FONT SIZE=3D2>You are right about the cumulators. I should declare =
them as float.</FONT>
<BR><FONT SIZE=3D2>I do not understand the issue you pointed to below. =
</FONT>
</P>
<P><FONT SIZE=3D2>I am forced to do my calculations this way because =
what I want to do is the following:</FONT>
</P>
<P><FONT SIZE=3D2>Use the histogram analysis to identify a threshold to =
threshold the image. But I want to do the thresholding only in the =
region of the mask. Ie I am basically happy my mask, except it also =
includes regions in the original image that are higher than the =
threshold which I want to remove. </FONT></P>
<P><FONT SIZE=3D2>If</FONT>
<BR><FONT SIZE=3D2>I just use this threshold through a standard =
Threshold filter, then I will end up with a lot of other regions =
(values lower than this threshold that I don't need), so I am =
constraining this thresholding only in the region of the mask, so I am =
directly editing the ON pixels in my mask to switch off at regions in =
the gray level that are higher than threshold. Is there a better way to =
do this?</FONT></P>
<P><FONT SIZE=3D2>Radhika</FONT>
</P>
<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, February 09, 2004 11:59 AM</FONT>
<BR><FONT SIZE=3D2>To: Radhika Sivaramakrishna</FONT>
<BR><FONT SIZE=3D2>Cc: ITK; Miller, James V (Research)</FONT>
<BR><FONT SIZE=3D2>Subject: Re: [Insight-users] Compilation error with =
inPlace filters</FONT>
</P>
<BR>
<P><FONT SIZE=3D2>Hi Radhika,</FONT>
</P>
<P><FONT SIZE=3D2>This seems to be a bug in the =
RelabelImageFilter.</FONT>
<BR><FONT SIZE=3D2>The issue has been entered in the bug tracker with =
ID # 582</FONT>
</P>
<P><FONT SIZE=3D2><A =
HREF=3D"http://www.itk.org/Bug/bug.php?op=3Dshow&bugid=3D582&pos=3D0" =
TARGET=3D"_blank">http://www.itk.org/Bug/bug.php?op=3Dshow&bugid=3D582&p=
os=3D0</A></FONT>
</P>
<P><FONT SIZE=3D2>In the meantime, please instantiate the =
RelabelImageFilter</FONT>
<BR><FONT SIZE=3D2>using the same image type for input and =
output.</FONT>
</P>
<P><FONT SIZE=3D2>----</FONT>
</P>
<P><FONT SIZE=3D2>Unrelated to the error above,... but still =
worrisome:</FONT>
</P>
<P><FONT SIZE=3D2>In your code you are taking the output of a reader =
and</FONT>
<BR><FONT SIZE=3D2>using an iterator for changing the value of this =
image.</FONT>
<BR><FONT SIZE=3D2>(the "mask" image in lines 193 - 201 =
).</FONT>
</P>
<P><FONT SIZE=3D2>Then you pass the image as input to another =
filter.</FONT>
<BR><FONT SIZE=3D2>This is a violation of the pipeline =
encapsulation.</FONT>
<BR><FONT SIZE=3D2>You should use a threshold image filter instead =
of</FONT>
<BR><FONT SIZE=3D2>using an iterator through the image. The output of =
the</FONT>
<BR><FONT SIZE=3D2>filters should be const... but we still have =
this</FONT>
<BR><FONT SIZE=3D2>weakness in ITK filters....</FONT>
</P>
<P><FONT SIZE=3D2>The cumulators that you have for frequencies =
are</FONT>
<BR><FONT SIZE=3D2>being declared unsigned long. They should be =
floats</FONT>
<BR><FONT SIZE=3D2>or doubles. Note that Frequencies are not just =
counters,</FONT>
<BR><FONT SIZE=3D2>they actually provide floating point values.</FONT>
</P>
<BR>
<P><FONT SIZE=3D2> Regards,</FONT>
</P>
<BR>
<P><FONT SIZE=3D2> Luis</FONT>
</P>
<BR>
<P><FONT SIZE=3D2>---------------------------------------</FONT>
<BR><FONT SIZE=3D2>Radhika Sivaramakrishna wrote:</FONT>
</P>
<P><FONT SIZE=3D2>> Hi Luis,</FONT>
<BR><FONT SIZE=3D2>> I actually did the checkout this morning and I =
did see the Dashboard </FONT>
<BR><FONT SIZE=3D2>> was pretty green. I don't know if I am making a =
silly mistake or a </FONT>
<BR><FONT SIZE=3D2>> more serious error.</FONT>
<BR><FONT SIZE=3D2>></FONT>
<BR><FONT SIZE=3D2>> I have copied my code here which doesn't =
compile and gives the error </FONT>
<BR><FONT SIZE=3D2>> indicated below. I think the problem has =
something to do with the </FONT>
<BR><FONT SIZE=3D2>> IntImageType I put in for dealing with the =
Relabel.. filter.</FONT>
<BR><FONT SIZE=3D2>></FONT>
<BR><FONT SIZE=3D2>> Sorry about not putting the correct subject. =
Will try to make sure to </FONT>
<BR><FONT SIZE=3D2>> do it from now on.</FONT>
<BR><FONT SIZE=3D2>></FONT>
<BR><FONT SIZE=3D2>> Radhika</FONT>
<BR><FONT SIZE=3D2>></FONT>
<BR><FONT SIZE=3D2>></FONT>
<BR><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, February 09, 2004 10:34 AM</FONT>
<BR><FONT SIZE=3D2>> To: Radhika Sivaramakrishna</FONT>
<BR><FONT SIZE=3D2>> Cc: ITK</FONT>
<BR><FONT SIZE=3D2>> Subject: Re: [Insight-users] Compilation error =
with inPlace filters</FONT>
<BR><FONT SIZE=3D2>></FONT>
<BR><FONT SIZE=3D2>></FONT>
<BR><FONT SIZE=3D2>> Hi Radhika,</FONT>
<BR><FONT SIZE=3D2>></FONT>
<BR><FONT SIZE=3D2>></FONT>
<BR><FONT SIZE=3D2>> A number of changes were made last week for =
extending</FONT>
<BR><FONT SIZE=3D2>> the functionality of "InPlace" =
filters.</FONT>
<BR><FONT SIZE=3D2>></FONT>
<BR><FONT SIZE=3D2>> You probably updated your checkout in the =
middle of</FONT>
<BR><FONT SIZE=3D2>> one of such modifications. Please trying =
cvs updating</FONT>
<BR><FONT SIZE=3D2>> to this morning (since the nightly Dashboard =
was quite</FONT>
<BR><FONT SIZE=3D2>> green today).</FONT>
<BR><FONT SIZE=3D2>></FONT>
<BR><FONT SIZE=3D2>></FONT>
<BR><FONT SIZE=3D2>> Regards,</FONT>
<BR><FONT SIZE=3D2>></FONT>
<BR><FONT SIZE=3D2>></FONT>
<BR><FONT SIZE=3D2>> Luis,</FONT>
<BR><FONT SIZE=3D2>></FONT>
<BR><FONT SIZE=3D2>></FONT>
<BR><FONT SIZE=3D2>> PS. Please don't reuse email threads with other =
subjects when</FONT>
<BR><FONT SIZE=3D2>> you post =
questions about new topics/problems. This is</FONT>
<BR><FONT SIZE=3D2>> confusing for =
anybody trying to follow a thread.</FONT>
<BR><FONT SIZE=3D2>></FONT>
<BR><FONT SIZE=3D2>></FONT>
<BR><FONT SIZE=3D2>> ---------------------------------------</FONT>
<BR><FONT SIZE=3D2>> Radhika Sivaramakrishna wrote:</FONT>
<BR><FONT SIZE=3D2>></FONT>
<BR><FONT SIZE=3D2>> > Hi Luis,</FONT>
<BR><FONT SIZE=3D2>> > I am getting this very strange error =
message while compiling. Can you</FONT>
<BR><FONT SIZE=3D2>> > explain what this could be?</FONT>
<BR><FONT SIZE=3D2>> ></FONT>
<BR><FONT SIZE=3D2>> > =
/home/rsivaram/Insight/Code/Common/itkInPlaceImageFilter.txx: In =
member</FONT>
<BR><FONT SIZE=3D2>> > function `void =
itk::InPlaceImageFilter<TInputImage,</FONT>
<BR><FONT SIZE=3D2>> > =
TOutputImage>::AllocateOutputs() [with TInputImage =3D =
main(int,</FONT>
<BR><FONT SIZE=3D2>> > char**)::IntImageType, =
TOutputImage =3D main(int, </FONT>
<BR><FONT SIZE=3D2>> char**)::ImageType]':</FONT>
<BR><FONT SIZE=3D2>> > =
/home/rsivaram/Insight/Code/Common/itkImageRegion.h:173: </FONT>
<BR><FONT SIZE=3D2>> > instantiated from here</FONT>
<BR><FONT SIZE=3D2>> > =
/home/rsivaram/Insight/Code/Common/itkInPlaceImageFilter.txx:76: =
no</FONT>
<BR><FONT SIZE=3D2>> > matching</FONT>
<BR><FONT SIZE=3D2>> > function for call to =
`itk::InPlaceImageFilter<main(int,</FONT>
<BR><FONT SIZE=3D2>> > char**)::IntImageType, =
main(int,</FONT>
<BR><FONT SIZE=3D2>> > =
char**)::ImageType>::GraftOutput(main(int,</FONT>
<BR><FONT SIZE=3D2>> > =
char**)::IntImageType*)'</FONT>
<BR><FONT SIZE=3D2>> > =
/home/rsivaram/Insight/Code/Common/itkImageSource.txx:95: =
candidates</FONT>
<BR><FONT SIZE=3D2>> > are: void</FONT>
<BR><FONT SIZE=3D2>> > =
itk::ImageSource<TOutputImage>::GraftOutput(TOutputImage*) =
[with</FONT>
<BR><FONT SIZE=3D2>> > TOutputImage =3D =
main(int, char**)::ImageType]</FONT>
<BR><FONT SIZE=3D2>> ></FONT>
<BR><FONT SIZE=3D2>> ></FONT>
<BR><FONT SIZE=3D2>> > Thanks</FONT>
<BR><FONT SIZE=3D2>> > Radhika</FONT>
<BR><FONT SIZE=3D2>> ></FONT>
<BR><FONT SIZE=3D2>> ></FONT>
<BR><FONT SIZE=3D2>> ></FONT>
<BR><FONT SIZE=3D2>></FONT>
<BR><FONT SIZE=3D2>></FONT>
<BR><FONT =
SIZE=3D2>>  =
;  =
;  =
;  =
; </FONT>
<BR><FONT SIZE=3D2>> =
----------------------------------------------------- </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) </FONT>
<BR><FONT SIZE=3D2>> and may contain confidential and privileged =
information. Any </FONT>
<BR><FONT SIZE=3D2>> unauthorized review, use, disclosure or =
distribution is prohibited. If </FONT>
<BR><FONT SIZE=3D2>> you are not the intended recipient, please =
contact the sender by reply </FONT>
<BR><FONT SIZE=3D2>> email and destroy all copies of the original =
message. If you are the </FONT>
<BR><FONT SIZE=3D2>> intended recipient, please be advised that the =
content of this message </FONT>
<BR><FONT SIZE=3D2>> is subject to access, review and disclosure by =
the sender's Email </FONT>
<BR><FONT SIZE=3D2>> System Administrator.</FONT>
<BR><FONT SIZE=3D2>></FONT>
<BR><FONT SIZE=3D2>> </FONT>
<BR><FONT SIZE=3D2>></FONT>
<BR><FONT SIZE=3D2>> </FONT>
<BR><FONT SIZE=3D2>></FONT>
</P>
<BR>
<BR>
<P><FONT =
SIZE=3D2> &nb=
sp; &nb=
sp; &nb=
sp; &nb=
sp; </FONT>
<BR><FONT =
SIZE=3D2>----------------------------------------------------- =
</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_01C3EF48.7A676AAC--