[vtkusers] VTK+MFC displaying DICOM image

Kiran Gachchi Kiran.Gachchi at hcl.com
Tue Oct 23 00:38:33 EDT 2012


Hi All,

I want to read a DICOM slice using VTK and display it using MFC.
I wrote the following code for the same.  It should display gray scale image. But I am getting RGB color DICOM image.

   vtkRenderer           *pvtkRenderer;
   vtkDataSetMapper      *pvtkDataSetMapper;
   vtkActor             *pvtkActor;
   vtkDICOMImageReader   *pvtkDICOMImageReader;


   pvtkDICOMImageReader->SetFileName(DicomFileName);
  pvtkDataSetMapper->SetInputConnection(pvtkDICOMImageReader->GetOutputPort());
   pvtkActor->SetMapper(pvtkDataSetMapper);
   pvtkRenderer->AddActor(pvtkActor);
  pvtkRenderer->ResetCamera();
   pvtkRenderer->GetRenderWindow()->Render();
   pvtkRenderer->ResetCamera();

Please help me out.

Thanks in Advance.

Regards,
Kiran



::DISCLAIMER::
----------------------------------------------------------------------------------------------------------------------------------------------------

The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only.
E-mail transmission is not guaranteed to be secure or error-free as information could be intercepted, corrupted,
lost, destroyed, arrive late or incomplete, or may contain viruses in transmission. The e mail and its contents
(with or without referred errors) shall therefore not attach any liability on the originator or HCL or its affiliates.
Views or opinions, if any, presented in this email are solely those of the author and may not necessarily reflect the
views or opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification,
distribution and / or publication of this message without the prior written consent of authorized representative of
HCL is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately.
Before opening any email and/or attachments, please check them for viruses and other defects.

----------------------------------------------------------------------------------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20121023/8fd0e08e/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TestImage.jpg
Type: image/jpeg
Size: 13591 bytes
Desc: TestImage.jpg
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20121023/8fd0e08e/attachment.jpg>


More information about the vtkusers mailing list