[vtkusers] vtkDistanceWidget and Dicom Images

Jothy jothybasu at gmail.com
Tue Oct 19 13:27:01 EDT 2010


First call Render() then try reset camera .

Jothy

On Tue, Oct 19, 2010 at 6:24 PM, Leonardo M. Ramé <l.rame at griensu.com>wrote:

> On 2010-10-19 18:20:24 +0100, Jothy wrote:
> > Try ResetCameraClippingRange() on renderer.
> >
> > Jothy
> >
>
> I tried that, but it does not work. Could you take a look at my code
> below?, maybe the ResetCameraClippingRange is not on the correct line:
>
> mImage = m_qdicomImage->getDicomImage();
> mImage->flipImage(0,-1);
> m_imageDataVTK->SetOrigin( 0, 0, 0 );
>
> m_imageDataVTK->SetDimensions( mImage->getWidth(),
> mImage->getHeight(), 1 );
> m_imageDataVTK->SetScalarTypeToUnsignedShort(); // the data will be 16 bit
> m_imageDataVTK->AllocateScalars();
>
>
> // apply PixelSpacing
> double lPixelSpacing;
> m_qdicomImage->getDataSet()->findAndGetFloat64(DCM_PixelSpacing,
> lPixelSpacing, 0, false);
> m_imageDataVTK->SetSpacing(lPixelSpacing, lPixelSpacing, lPixelSpacing);
>
> // aplicamos Window Level
> m_qdicomImage->getDicomImage()->setWindow(0);
> mImage->getOutputData(
>  m_imageDataVTK->GetScalarPointer(0,0,0),
>  mImage->getOutputDataSize()
> );
>
> m_ImageViewer->SetInput(m_imageDataVTK);
> m_ImageViewer->SetRenderWindow(this->GetRenderWindow());
> m_ImageViewer->SetupInteractor(this->GetInteractor());
>
> // ResetCameraClippingRange
> m_ImageViewer->GetRenderer()->ResetCameraClippingRange();
> --
> Leonardo M. Ramé
> http://leonardorame.blogspot.com
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20101019/d6f6febb/attachment.htm>


More information about the vtkusers mailing list