Multiview port dicom viewer zoom in problem

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Multiview port dicom viewer zoom in problem

K O ranjith
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();


_______________________________________________
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

after_zoomin.jpg (435K) Download Attachment
While_starting.jpg (422K) Download Attachment
Loading...