[vtkusers] vtk+mfc dicom image dispay
Kiran Gachchi
Kiran.Gachchi at hcl.com
Fri Nov 2 05:59:25 EDT 2012
Hi All,
1) I want to read a DICOM image using VTK and display it on MFC picture control.
I am able to do this. But the problem is, if I drag the image on picture control, it will rotate. How to resolve it? I have attached the code snippet.
pvtkDICOMImageReaderRef->SetFileName((LPCTSTR)cstrFileName);
pviewer_Ref->SetInput(pvtkDICOMImageReaderRef->GetOutput());
pviewer_Ref->SetupInteractor(pvtkMFCWindow_Ref->GetInteractor());
pvtkMFCWindow_Ref->SetRenderWindow((vtkWin32OpenGLRenderWindow *)pviewer_Ref->GetRenderWindow());
pviewer_Ref->SetColorLevel(128);
pviewer_Ref->SetColorWindow(1500);
pviewer_Ref->GetRenderer()->ResetCamera();
pviewer_Ref->Render();
2) I tried one more thing. In this case, DICOM image on MFC picture control will not rotate, but Image won't fit in the picture control properly.
this->pvtkDICOMImageReaderRef->SetFileName((LPCTSTR)cstrFileName);
this->pvtkDICOMImageReaderRef->Update();
this->pvtkImageMapper->SetInput(this->pvtkDICOMImageReaderRef->GetOutput());
this->pvtkImageMapper->SetColorLevel(128);
this->pvtkImageMapper->SetColorWindow(1500);//8192
this->pvtkActor2D->SetMapper(this->pvtkImageMapper);
this->pvtkRendererRef->AddActor(this->pvtkActor2D);
this->pvtkRendererRef->GetRenderWindow()->Render();
this->pvtkRendererRef->ResetCamera();
Please help me out.
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/20121102/bd0f2199/attachment.htm>
More information about the vtkusers
mailing list