<div dir="ltr">First call Render() then try reset camera .<br><br>Jothy<br><br><div class="gmail_quote">On Tue, Oct 19, 2010 at 6:24 PM, Leonardo M. Ramé <span dir="ltr"><<a href="mailto:l.rame@griensu.com">l.rame@griensu.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">On 2010-10-19 18:20:24 +0100, Jothy wrote:<br>
> Try ResetCameraClippingRange() on renderer.<br>
><br>
> Jothy<br>
><br>
<br>
</div>I tried that, but it does not work. Could you take a look at my code<br>
below?, maybe the ResetCameraClippingRange is not on the correct line:<br>
<br>
mImage = m_qdicomImage->getDicomImage();<br>
mImage->flipImage(0,-1);<br>
m_imageDataVTK->SetOrigin( 0, 0, 0 );<br>
<br>
m_imageDataVTK->SetDimensions( mImage->getWidth(),<br>
mImage->getHeight(), 1 );<br>
m_imageDataVTK->SetScalarTypeToUnsignedShort(); // the data will be 16 bit<br>
m_imageDataVTK->AllocateScalars();<br>
<br>
<br>
// apply PixelSpacing<br>
double lPixelSpacing;<br>
m_qdicomImage->getDataSet()->findAndGetFloat64(DCM_PixelSpacing, lPixelSpacing, 0, false);<br>
m_imageDataVTK->SetSpacing(lPixelSpacing, lPixelSpacing, lPixelSpacing);<br>
<br>
// aplicamos Window Level<br>
m_qdicomImage->getDicomImage()->setWindow(0);<br>
mImage->getOutputData(<br>
m_imageDataVTK->GetScalarPointer(0,0,0),<br>
mImage->getOutputDataSize()<br>
);<br>
<br>
m_ImageViewer->SetInput(m_imageDataVTK);<br>
m_ImageViewer->SetRenderWindow(this->GetRenderWindow());<br>
m_ImageViewer->SetupInteractor(this->GetInteractor());<br>
<br>
// ResetCameraClippingRange<br>
m_ImageViewer->GetRenderer()->ResetCameraClippingRange();<br>
<font color="#888888">--<br>
</font><div><div></div><div class="h5">Leonardo M. Ramé<br>
<a href="http://leonardorame.blogspot.com" target="_blank">http://leonardorame.blogspot.com</a><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>
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>
</div></div></blockquote></div><br></div>