[vtkusers] Changing the color of dicom image while displaying it.
Jothybasu Selvaraj
jothybasu at gmail.com
Fri Nov 2 06:02:17 EDT 2012
You need to setup a proper interaction style.
Set your interactor style to vtkInteractorStyleImage.
On Fri, Nov 2, 2012 at 9:54 AM, Kiran Gachchi <Kiran.Gachchi at hcl.com> wrote:
> Thanks for your Answer.****
>
> ** **
>
> I Have one more doubt. Please try to solve this issue.****
>
> ** **
>
> **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, the image in 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();****
>
> ** **
>
> Regards,****
>
> Kiran ****
>
> ** **
>
> ** **
>
> ** **
>
> ** **
>
> *From:* Jothybasu Selvaraj [mailto:jothybasu at gmail.com]
> *Sent:* Friday, November 02, 2012 3:22 PM
> *To:* Kiran Gachchi
> *Cc:* vtkusers at vtk.org
> *Subject:* Re: [vtkusers] Changing the color of dicom image while
> displaying it.****
>
> ** **
>
> You could use vtkDICOmImageReader and a proper lookup table to color the
> image.
>
> Have a look at this example
>
>
> http://vtk.org/gitweb?p=VTK.git;a=blob;f=Examples/ImageProcessing/Cxx/ImageSlicing.cxx
>
> Jothy
>
> ****
>
> ** **
>
> On Fri, Nov 2, 2012 at 5:31 AM, Kiran Gachchi <Kiran.Gachchi at hcl.com>
> wrote:****
>
> Hi all,****
>
> ****
>
> I want to read a DICOM image (Gray Scale) in vtk and display it as color
> image.****
>
> Could anyone 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.****
>
>
> ----------------------------------------------------------------------------------------------------------------------------------------------------
> ****
>
>
> _______________________________________________
> 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
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers****
>
>
>
>
> -- ****
>
> Jothybasu Selvaraj
> PhD Student
> University of Liverpool
> UK****
>
> ** **
>
--
Jothybasu Selvaraj
PhD Student
University of Liverpool
UK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20121102/d62717c8/attachment.htm>
More information about the vtkusers
mailing list