[vtkusers] fit to screen in vtkImageViewer2 + QVTKWidget

K O ranjith kor1581 at gmail.com
Thu Jul 27 05:32:32 EDT 2017


Thanks for the solution,
One more doubt in my application, vtkDICOMImageReader is used for reading
all the DICOM files in a folder and setting directly to vtkImageViewer2
 through SetInputConnection(reader->GetOutputPort());. The DICOM images in
the folder might have different size. In this case how can get "Extent"
"Orgin" "spacing" parameters of each image.
Have any methods to extract these from  vtkDICOMImageReader  or vtkImageViewer2
?

On Wed, Jul 26, 2017 at 5:16 PM, Bill Lorensen <bill.lorensen at gmail.com>
wrote:

> This example may help.
> https://lorensen.github.io/VTKExamples/site/Cxx/Images/FillWindow/
>
> On Jul 26, 2017 6:36 AM, "K O ranjith" <kor1581 at gmail.com> wrote:
>
>> Hello,
>> Using  vtkImageViewer2 + QVTKWidget and vtkInteractorStyleImage, I
>> created a DICOM image viewer.  But the image mot filling to the the
>> entire viewport.  I need the fit the image to the viewport. For this I
>> tried different suggestion available online, but no effect,
>> like
>>
>>     m_vtkImViewer->GetRenderer()->GetActiveCamera()->ParallelProjectionOn();
>>
>>     m_vtkImViewer->GetRenderer()->GetActiveCamera()->SetParallelScale(1000);
>>
>>
>>     m_vtkImViewer->GetRenderer()->GetActiveCamera()->Dolly(10);
>>
>>
>>        m_vtkImViewer->GetRenderWindow()->SetSize(50, 50);
>>
>>
>> Please help to fit the image in window.
>>
>> Screenshot of current viewer is attached.
>>
>> As shown in the screnshot the image is displaying within a margin inside the viewport.
>>
>> But the corner annotations (set using vtkCornerAnnotation) are set in corners of the view port.
>>
>>
>> _______________________________________________
>> 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
>>
>> Search the list archives at: http://markmail.org/search/?q=vtkusers
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/vtkusers
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170727/9ee60576/attachment.html>


More information about the vtkusers mailing list