[vtkusers] Multiview port dicom viewer zoom in problem
K O ranjith
kor1581 at gmail.com
Wed Jul 5 07:24:39 EDT 2017
Hello,
I have created a multi view port (6 viewports in one window) mri dicom
viewer for displaying a list of DICOM files in a single window in Qt.
I used vtkDICOMReader, vtkImageActor, vtkImageSliceMapper and QVTKWidget.
The DICOM images are displaying as expected but have two issues.
1) Main issue is, while zooming in the images in view ports, after a
particular level of zoom the images disappearing. But after zoom out to the
previous particular level the image reappearing again. This happening in
case of all the view ports.
Also no issue for zoom out.
2) The images are displaying in smaller size than the view ports size.
Why this happening? Please help..
My code something like this, and attached few screen shots
vtkSmartPointer <vtkDICOMDirectory> m_vtkDcmDir;
vtkSmartPointer<vtkDICOMReader> m_vtkDcmRdr
vtkSmartPointer<vtkDICOMReader>::New();
vtkSmartPointer <vtkStringArray> m_aVtkStrFNames;
QVTKWidget m_vtkWgtWin; m_vtkWgtWin = new QVTKWidget();
m_vtkDcmDir->SetDirectoryName("E:/Projects/mri/evaluate/Qt/ImageViewer/VTK/VTKtest/ReadDICOM/DICOMSeries");
m_vtkDcmDir->*Update*();
// Iterate through all of the studies that are present.
m_iNoStudies = m_vtkDcmDir->GetNumberOfStudies();
for(int i = 0; i < m_iNoStudies; i++)
{
int j1 = m_vtkDcmDir ->GetFirstSeriesForStudy(i);
int j2 = m_vtkDcmDir ->GetLastSeriesForStudy(i);
for (int j = j1; j <= j2; j++)
{
m_aVtkStrFNames = m_vtkDcmDir->GetFileNamesForSeries(j);
// do something with the files
m_vtkDcmRdr ->*SetFileNames*(m_aVtkStrFNames);
m_vtkDcmRdr ->*Update*();
}
}
// Define viewport ranges
double xmins[6] = {0, .33, .66, 0, .33, .66};
double xmaxs[6] = {.33, .66, 1, .33, .66, 1};
double ymins[6] = {0, 0, 0, .5, .5, .5};
double ymaxs[6]= {.5, .5, .5, 1, 1, 1};
for(unsigned i = 0; i < 6; i++)
{
vtkSmartPointer<vtkImageActor> imageActor = vtkSmartPointer<
vtkImageActor>::New();
imageActor->*SetInputData*(m_vtkDcmRdr->GetOutput());
vtkSmartPointer<vtkImageSliceMapper> imageMapper =
vtkImageSliceMapper::SafeDownCast(imageActor->*GetMapper*());
imageActor->SetMapper(imageMapper);
imageMapper->SetInputData(m_vtkDcmRdr->GetOutput());
imageMapper->*SetSliceNumber*(i+1);
vtkSmartPointer<vtkRenderer> vtkRen = vtkSmartPointer<vtkRenderer
>::New();
vtkRen->*SetViewport*(xmins[i],ymins[i],xmaxs[i],ymaxs[i]);
vtkRen->AddActor(imageActor);
vtkRen->*ResetCamera*();
m_vtkWgtWin->*GetRenderWindow*()->*AddRenderer*(vtkRen);
}
m_vtkWgtWin->*GetRenderWindow*()->*Render*();
m_vtkWgtWin->update();
m_vtkWgtWin->show();
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170705/72497b78/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: after_zoomin.jpg
Type: image/jpeg
Size: 325586 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170705/72497b78/attachment-0002.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: While_starting.jpg
Type: image/jpeg
Size: 315847 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170705/72497b78/attachment-0003.jpg>
More information about the vtkusers
mailing list