<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18928"></HEAD>
<BODY>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=697413814-14072010>Hello vtk-devs,</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=697413814-14072010></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=697413814-14072010>sorry for this whole misunderstanding. The description
of Karthik makes sense for me now. Maybe we should at least add some comment for
this lines.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=697413814-14072010></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=697413814-14072010>Thanks for clarification!</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2
face=Arial></FONT> </DIV><FONT color=#0000ff size=2 face=Arial></FONT><FONT
color=#0000ff size=2 face=Arial></FONT><BR>
<DIV dir=ltr lang=de class=OutlookMessageHeader align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>Von:</B> Dave Partyka
[mailto:dave.partyka@kitware.com] <BR><B>Gesendet:</B> Mittwoch, 14. Juli 2010
16:28<BR><B>An:</B> Karthik Krishnan<BR><B>Cc:</B> David Gobbi; David Cole;
vtk-developers@vtk.org; Pokutnev, Pavel (GE EntSol, SensInsp)<BR><B>Betreff:</B>
Re: [vtk-developers] BUG: vtkImageActor - set of ComputedDisplayExtent
variable.<BR></FONT><BR></DIV>
<DIV></DIV>I apologize for hastily committing this. I have reverted it
back.<BR><BR>
<DIV class=gmail_quote>On Wed, Jul 14, 2010 at 10:23 AM, Karthik Krishnan <SPAN
dir=ltr><<A
href="mailto:karthik.krishnan@kitware.com">karthik.krishnan@kitware.com</A>></SPAN>
wrote:<BR>
<BLOCKQUOTE
style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote>This behaviour has always existed in vtkImageActor - due to
the way VTK deals with point data and cell data and the fact that the tips of
the render window delineate the available screen pixels for display. What this
means is that the tips of the clipped rectangle you are seeing (and the
centers of any other rectangle) correspond to the positions of the centers of
vtkImageData voxels. Because the display extent, in word coordinates runs from
the Word position of the left edge voxel center to the world position of the
right edge voxel center, you end up with clipping.<BR><BR>This has been the
topic of discussion on the list before.<BR><BR>I don't believe that the fix
you proposed can resolve that. Does it ? It would simply cause one to update
the whole input needlessly leading to slowness when one renders a
vtkImageActor for the very first time, without setting the
DisplayExtent.<BR><BR>Thanks<BR>--<BR><FONT color=#888888>karthik</FONT>
<DIV>
<DIV></DIV>
<DIV class=h5><BR><BR>
<DIV class=gmail_quote>On Wed, Jul 14, 2010 at 7:43 PM, Dave Partyka <SPAN
dir=ltr><<A href="mailto:dave.partyka@kitware.com"
target=_blank>dave.partyka@kitware.com</A>></SPAN> wrote:<BR>
<BLOCKQUOTE
style="BORDER-LEFT: rgb(204,204,204) 1px solid; MARGIN: 0pt 0pt 0pt 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote>Hi David Gobbi,
<DIV><BR></DIV>
<DIV>It appears from git blame that you are the author, or at
least, the last person to modify this code. What are your thoughts? Is
this a bug or intended as Karthik described?</DIV>
<DIV><BR></DIV>
<DIV>The blobs of code are:</DIV>
<DIV><BR></DIV>
<DIV>
<DIV> // if the display extent has not been set, then compute one</DIV>
<DIV>
<DIV> int *wExtent = input->GetWholeExtent();</DIV>
<DIV> if (this->DisplayExtent[0] == -1)</DIV>
<DIV> {</DIV>
<DIV> this->ComputedDisplayExtent[0] =
wExtent[0];</DIV>
<DIV> this->ComputedDisplayExtent[1] =
wExtent[1];</DIV>
<DIV> this->ComputedDisplayExtent[2] =
wExtent[2];</DIV>
<DIV> this->ComputedDisplayExtent[3] =
wExtent[3];</DIV>
<DIV> this->ComputedDisplayExtent[4] =
wExtent[4];</DIV>
<DIV> this->ComputedDisplayExtent[5] =
wExtent[4];</DIV>
<DIV> }</DIV></DIV></DIV>
<DIV><BR></DIV>
<DIV>and</DIV>
<DIV><BR></DIV>
<DIV>
<DIV> // if the display extent has not been set, then compute one</DIV>
<DIV> int *wExtent = this->Input->GetWholeExtent();</DIV>
<DIV>
<DIV> if (this->DisplayExtent[0] == -1)</DIV>
<DIV> {</DIV>
<DIV> this->ComputedDisplayExtent[0] =
wExtent[0];</DIV>
<DIV> this->ComputedDisplayExtent[1] =
wExtent[1];</DIV>
<DIV> this->ComputedDisplayExtent[2] =
wExtent[2];</DIV>
<DIV> this->ComputedDisplayExtent[3] =
wExtent[3];</DIV>
<DIV> this->ComputedDisplayExtent[4] =
wExtent[4];</DIV>
<DIV> this->ComputedDisplayExtent[5] =
wExtent[4];</DIV>
<DIV> }</DIV>
<DIV><BR></DIV><BR></DIV>
<DIV>
<DIV></DIV>
<DIV>
<DIV class=gmail_quote>On Wed, Jul 14, 2010 at 9:54 AM, Karthik Krishnan
<SPAN dir=ltr><<A href="mailto:karthik.krishnan@kitware.com"
target=_blank>karthik.krishnan@kitware.com</A>></SPAN> wrote:<BR>
<BLOCKQUOTE
style="BORDER-LEFT: rgb(204,204,204) 1px solid; MARGIN: 0pt 0pt 0pt 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote>Dave:<BR><BR>I would recommend holding off that commit.
I'm not convinced that its a bug. Specifically, the fragment of code reads
:<BR><BR><BR>int vtkImageActor::RenderOpaqueGeometry(vtkViewport*
viewport)<BR>{<BR>....<BR><BR> int *wExtent =
input->GetWholeExtent();<BR> if (this->DisplayExtent[0] ==
-1)<BR> {<BR>
this->ComputedDisplayExtent[0] = wExtent[0];<BR>
this->ComputedDisplayExtent[1] = wExtent[1];<BR>
this->ComputedDisplayExtent[2] = wExtent[2];<BR>
this->ComputedDisplayExtent[3] = wExtent[3];<BR>
this->ComputedDisplayExtent[4] = wExtent[4];
<DIV><BR> this->ComputedDisplayExtent[5] =
wExtent[4];<BR> }<BR></DIV>
input->SetUpdateExtent(this->ComputedDisplayExtent);<BR>
...<BR>}<BR><BR>An ImageActor should have flattened extents along some
dimension. It does not make sense for the ImageActor to update the WHOLE
input. It appears that with the fix, "this->ComputedDisplayExtent[5] =
wExtent[4];", it will lead to updating the entire image. <BR><BR>I think
the author of the class simply intended to set the display extent to the
first axial slice if they haven't been set.<BR><BR>Pavel: I'm also
interested in knowing how you uncovered/ concluded that this is a bug. We
use vtkImageActor quite heavily and haven't had any issues; Maybe we
haven't covered this "if" block, but still, its good to
know..<BR><BR>Thanks<BR>--<BR><FONT color=#888888>karthik</FONT>
<DIV>
<DIV></DIV>
<DIV><BR><BR>
<DIV class=gmail_quote>On Wed, Jul 14, 2010 at 7:09 PM, Dave Partyka <SPAN
dir=ltr><<A href="mailto:dave.partyka@kitware.com"
target=_blank>dave.partyka@kitware.com</A>></SPAN> wrote:<BR>
<BLOCKQUOTE
style="BORDER-LEFT: rgb(204,204,204) 1px solid; MARGIN: 0pt 0pt 0pt 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote>Hi Pavel, I am curious how you discovered this bug.
Were you just browsing through the file or do you have code that is
affected by this? If so would you mind sharing it? I would like to make
a test out of it if possible.
<DIV>
<DIV></DIV>
<DIV><BR><BR>
<DIV class=gmail_quote>On Wed, Jul 14, 2010 at 9:26 AM, Dave Partyka
<SPAN dir=ltr><<A href="mailto:dave.partyka@kitware.com"
target=_blank>dave.partyka@kitware.com</A>></SPAN> wrote:<BR>
<BLOCKQUOTE
style="BORDER-LEFT: rgb(204,204,204) 1px solid; MARGIN: 0pt 0pt 0pt 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote>Those lines are definitely covered. Though
it appears the only are used when the extents haven't been set yet.
<DIV><BR></DIV>
<DIV><A
href="http://www.cdash.org/CDash/viewCoverageFile.php?buildid=663956&fileid=10980615"
target=_blank>http://www.cdash.org/CDash/viewCoverageFile.php?buildid=663956&fileid=10980615</A>
<DIV>
<DIV></DIV>
<DIV><BR><BR>
<DIV class=gmail_quote>On Wed, Jul 14, 2010 at 9:18 AM, David Cole
<SPAN dir=ltr><<A href="mailto:david.cole@kitware.com"
target=_blank>david.cole@kitware.com</A>></SPAN> wrote:<BR>
<BLOCKQUOTE
style="BORDER-LEFT: rgb(204,204,204) 1px solid; MARGIN: 0pt 0pt 0pt 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote>This sort of error looks like it should produce
some sort of seriously incorrect results.
<DIV><BR></DIV>
<DIV>Do we not have a test that covers this code? Is the coverage
for the lines in question "0" or do we just not have a *good* test
that runs through that code...?</DIV>
<DIV><BR></DIV>
<DIV>I would think vtkImageActor is a heavily used class.</DIV>
<DIV><BR></DIV>
<DIV><BR>?</DIV>
<DIV>
<DIV></DIV>
<DIV>
<DIV><BR></DIV>
<DIV><BR>
<DIV class=gmail_quote>On Wed, Jul 14, 2010 at 8:51 AM, Dave Partyka
<SPAN dir=ltr><<A href="mailto:dave.partyka@kitware.com"
target=_blank>dave.partyka@kitware.com</A>></SPAN> wrote:<BR>
<BLOCKQUOTE
style="BORDER-LEFT: rgb(204,204,204) 1px solid; MARGIN: 0pt 0pt 0pt 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote>Thanks for the fix! I have just committed
it.<BR><BR>
<DIV class=gmail_quote>
<DIV>
<DIV></DIV>
<DIV>On Wed, Jul 14, 2010 at 4:19 AM, Pokutnev, Pavel (GE EntSol,
SensInsp) <SPAN dir=ltr><<A href="mailto:Pavel.Pokutnev@ge.com"
target=_blank>Pavel.Pokutnev@ge.com</A>></SPAN>
wrote:<BR></DIV></DIV>
<BLOCKQUOTE
style="BORDER-LEFT: rgb(204,204,204) 1px solid; MARGIN: 0pt 0pt 0pt 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote>
<DIV>
<DIV></DIV>
<DIV>
<DIV>
<DIV><FONT size=2 face=Arial><SPAN>Hello
vtk-devs,</SPAN></FONT></DIV>
<DIV><FONT size=2 face=Arial><SPAN></SPAN></FONT> </DIV>
<DIV><FONT size=2 face=Arial><SPAN>it looks like there is a copy
& paste bug in vtkImageActor line 250 and
293:</SPAN></FONT></DIV>
<DIV><FONT size=2 face=Arial><SPAN></SPAN></FONT> </DIV>
<DIV><FONT size=2 face=Arial><SPAN>The line:</SPAN></FONT></DIV>
<DIV><FONT size=2 face=Arial><SPAN>
this->ComputedDisplayExtent[5] =
wExtent[4];</SPAN></FONT></DIV>
<DIV><FONT size=2 face=Arial><SPAN>should
be:</SPAN></FONT></DIV>
<DIV><FONT size=2 face=Arial><SPAN>
this->ComputedDisplayExtent[5] =
wExtent[5];</SPAN></FONT></DIV>
<DIV><FONT size=2 face=Arial><SPAN></SPAN></FONT> </DIV>
<DIV><FONT size=2 face=Arial><SPAN>Best
regards!</SPAN></FONT></DIV>
<DIV><FONT size=2 face=Arial><SPAN></SPAN></FONT> </DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV><FONT size=2
face=Arial>
<DIV align=left><BR></DIV></FONT>
<DIV><FONT size=2
face=Arial></FONT> </DIV></DIV><BR></DIV></DIV>_______________________________________________<BR>Powered
by <A href="http://www.kitware.com"
target=_blank>www.kitware.com</A><BR><BR>Visit other Kitware
open-source projects at <A
href="http://www.kitware.com/opensource/opensource.html"
target=_blank>http://www.kitware.com/opensource/opensource.html</A><BR><BR>Follow
this link to subscribe/unsubscribe:<BR><A
href="http://www.vtk.org/mailman/listinfo/vtk-developers"
target=_blank>http://www.vtk.org/mailman/listinfo/vtk-developers</A><BR><BR><BR></BLOCKQUOTE></DIV><BR><BR>_______________________________________________<BR>Powered
by <A href="http://www.kitware.com"
target=_blank>www.kitware.com</A><BR><BR>Visit other Kitware
open-source projects at <A
href="http://www.kitware.com/opensource/opensource.html"
target=_blank>http://www.kitware.com/opensource/opensource.html</A><BR><BR>Follow
this link to subscribe/unsubscribe:<BR><A
href="http://www.vtk.org/mailman/listinfo/vtk-developers"
target=_blank>http://www.vtk.org/mailman/listinfo/vtk-developers</A><BR><BR><BR></BLOCKQUOTE></DIV><BR></DIV></DIV></DIV></BLOCKQUOTE></DIV><BR></DIV></DIV></DIV></BLOCKQUOTE></DIV><BR></DIV></DIV><BR>_______________________________________________<BR>Powered
by <A href="http://www.kitware.com"
target=_blank>www.kitware.com</A><BR><BR>Visit other Kitware open-source
projects at <A href="http://www.kitware.com/opensource/opensource.html"
target=_blank>http://www.kitware.com/opensource/opensource.html</A><BR><BR>Follow
this link to subscribe/unsubscribe:<BR><A
href="http://www.vtk.org/mailman/listinfo/vtk-developers"
target=_blank>http://www.vtk.org/mailman/listinfo/vtk-developers</A><BR><BR><BR></BLOCKQUOTE></DIV><BR></DIV></DIV></BLOCKQUOTE></DIV><BR></DIV></DIV></DIV></BLOCKQUOTE></DIV><BR></DIV></DIV></BLOCKQUOTE></DIV><BR></BODY></HTML>