<br><br>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>
<div class="gmail_quote">
<div class="im">
<div> </div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>What would be the equivalent if I would use a vtkActor2D?</div></blockquote>
<div><br></div></div>
<div>There is no camera for vtkActor2D, they always use display coordinates directly. Instead of scaling a vtkImageMapper, you have to use vtkImageReslice to resample the image at a higher or lower resolution.</div></div>
</div></blockquote>
<div> </div>
<div>I was actually looking for accelerated scaling, so this sounds like vtkActor2D is not be the right thing for that.</div>
<div> </div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>
<div class="gmail_quote">
<div class="im">
<div> </div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>The possible reason to do that in my case is that the window level lookup table operation that I need in the vtkImageActor implementation seems to be very slow compared to when I set the window/level of the vtkImageMapper for a vtkActor2D (24ms slower per 512x512 image). I will need to look at that as well, since I assumed that the vtkImageMapper just uses the same lookup table operations, but that's a different story...<br>
</div></blockquote>
<div><br></div></div>
<div>What are you using for window/level with vtkImageActor? The typical way is with a vtkLookupTable and vtkImageMapToColors (which can also map to greyscale). </div>
<div><br></div>
<div>The vtkImageActor and the vtkImageMapper work completely differently. The more you expect them to behave similarly to one another, the more you will confuse yourself. Each is designed to utilize a completely different set of GPU primitives.</div>
<div> </div></div></div></blockquote>
<div> </div>
<div>I'm not sure, but it looks like my implementation probably doesn't use any GPU acceleration (it seems to be pure image data filtering). It still seemed to be not as performant as I expected (compared to an implementation where I only used VTK for the imaging pipeline, but did the LUT application and visualization separetely).</div>
<div> </div>
<div>I create a vtkWindowLevelTable, set the window and center, and then call build on the lut. Then I used it with a vtkImageMapToColors instance:</div>
<div> </div>
<div>vtkImageMapToColors *color = vtkImageMapToColors::New();</div>
<div>color->SetLookupTable(lut); // lut is the vtkWindowLevelTable</div>
<div>color->SetInput(...) // some vtkImageData</div>
<div> </div>
<div>Thanks,</div>
<div>Mark</div>
<div> </div>
<div> </div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>
<div class="gmail_quote"><font color="#888888">
<div> David</div></font>
<div class="im">
<div><br></div>
<div><br></div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div class="gmail_quote">2010/11/29 David Gobbi <span dir="ltr"><<a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a>></span>
<div>
<div></div>
<div><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hi Mark,
<div><br></div>
<div>The camera method you want is SetParallelScale(), it sets the height of viewport when ParallelProjection is on.</div>
<div><br></div>
<div> David<br><br>
<div class="gmail_quote">
<div>
<div></div>
<div>On Mon, Nov 29, 2010 at 8:24 AM, endlosschleife1 <span dir="ltr"><<a href="mailto:endlosschleife1@googlemail.com" target="_blank">endlosschleife1@googlemail.com</a>></span> wrote:<br></div></div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>
<div></div>
<div>
<div>Hi all,</div>
<div> </div>
<div>I'm a bit confused about how cameras are initialized. I would like to scale a 2D image (scale a DICOM image to best fit a viewport size). I first did this via vtkImageResample and that works fine, but now I would like to try this with accelarated scaling and so I wanted to do that as part of the visualization pipeline (I hope that means that it is actually using OpenGL). I replaced my original vtkActor2D/vtkImageMapper with a vtkImageActor. The following works (pseudo code):</div>
<div> </div>
<div>Variant 1:</div>
<div>- add imageActor to renderer, and renderer to renderwindow. Then call Render() on renderwindow. </div>
<div>-> The image displays as expected in the original size.</div>
<div> </div>
<div>Variant 2:</div>
<div>- same as in Variant 1 (including Render() call)</div>
<div>- renderer->GetActiveCamera()->ParallelProjectionOn()</div>
<div>- renderer->GetActiveCamera()->Zoom(zoomFactor);</div>
<div>-> The image displays with the desired scaling.</div>
<div> </div>
<div>But variant 2 only works because I called Render() first. I assume this somehow initializes the camera of the renderer with exactly the attributes that I need, but when I call GetActiveCamera without rendering first this (just calling the getter-method) will already) will give a different result (in my case a grey box in the upper right corner of the viewport). I'm now about to reverse engineer the camera settings after variant 1 was executed and set all the camera attributes to the desired initial values (position, viewUp, clipping range etc.), but I'm wondering if I'm just missing the more appropriate and convenient way to do this (after all the vtkImageActor seems to be all about convenience).</div>
<div> </div>
<div>Thank you.</div>
<div> </div>
<div>Mark</div>
<div> </div>
<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>Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br><br>Follow this link to subscribe/unsubscribe:<br><a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div></blockquote></div></div></div><br></blockquote></div></div><br></div></blockquote></div><br>