[vtkusers] Enlarge dicom's display on iOS

邓卓夫 dzfowen at qq.com
Sat Dec 5 02:02:54 EST 2015


Hi developers,


    Now I have a project on iOS with vtk. I try to read a dicom file to display in iPad. It works, but the size of the dicom image is limited. I try to resize the actor and vtkIOSRenderWindow, but no reaction, the following is my codes, Please help me which method can enlarge the dicom display!
 
     vtkObjectFactory::RegisterFactory(vtkRenderingOpenGL2ObjectFactory::New());
 
    
 
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
 
    NSString *basePath = paths.firstObject;
 
    std::string fname([basePath UTF8String]);
 
    fname += "/dicom/output_1.dcm";
 
    vtkNew<vtkDICOMImageReader> reader;
 
    reader->SetFileName(fname.data());  
 


 
    vtkNew<vtkImageMapper> imageMapper;
 
    imageMapper->SetInputConnection(reader->GetOutputPort());
 
    
 
    vtkNew<vtkActor2D> imageActor;
 
    imageActor->SetMapper(imageMapper.Get());
 
    imageActor->SetDisplayPosition(500, 1000);
 


 
    imageActor->SetHeight(500);
 
    imageActor->SetWidth(500);
 
    
 
    vtkNew<vtkRenderer> renderer;
 
    renderer->SetBackground(1,1,1);
 
    renderer->GradientBackgroundOn();
 
    renderer->AddActor(imageActor.Get());
 
    
 


 
   vtkIOSRenderWindow *renWin = vtkIOSRenderWindow::New();
 
    renWin->AddRenderer(renderer.Get());
 
    [self setVTKRenderWindow:renWin];




Thank you very much!




Bob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20151205/2a0e35df/attachment.html>


More information about the vtkusers mailing list