[IGSTK-Users] How to connect vtkImageData with igstk::ImageResliceObjectRepresentation?

Patrick Cheng cheng at isis.georgetown.edu
Tue Nov 9 11:37:58 EST 2010


Hi Luo Shuiling,

It's by design for IGSTK to encapsulates vtkImageData.

You need to do some extra 'hacking' here to make it work.

There are two options:

1. The IGSTK way, write a NewBlendImageRepresentation class, which takes
two ImageSpatialObject inputs, and put all your vtkBlend code inside
that class.

2. The quick/dirty way, add a API in igstkImageRepresentation class,
something like SetVTKImage.

I strongly suggest you follow the first solution and encourages you to
contribute the new class back to IGSTK, I imaging many people will be
interested in such feature as well.


Patrick

On 11/8/10 8:10 AM, Luo Shuiling wrote:
> Hi IGSTK users,
> 
> I use igstk::CTImageReader and igstk::MRImageReader to load two set 
> files, and use vtkImageBlend make the fusion. The code snippet is:
> 
> VTKImageObserver::Pointer vtkImageObserver = VTKImageObserver::New();
> m_CTImageSpatialObject->AddObserver( igstk::VTKImageModifiedEvent(), 
> vtkImageObserver );
> m_CTImageSpatialObject->RequestGetVTKImage();
> 
> if ( vtkImageObserver->GotVTKImage())
> {
> vtkCTImage = vtkImageObserver->GetVTKImage();
> }
> 
> ......
> 
> vtkImageBlend *blend = vtkImageBlend::New();
> blend->SetInput(vtkCTImage);
> blend->SetInput(vtkMRImage);
> blend->SetOpacity(0,opacity);
> blend->SetOpacity(1,opacity);
> 
> After fusion, I w ant show them on the four-quadrant view. In my 
> opinion, the result should send to the object of 
> igstk::ImageResliceObjectRepresentation(if wrong, please correct me), 
> i.e., m_AxialPlaneRepresentation, m_SagittalPlaneRepresentation and 
> m_CoronalPlaneRepresentation. but I've no idea about the code. Who can 
> help me? I will be appreciated for any help.
> 
> Regards & Thank you
> 
> Shuiling
> 
> 
> 
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
> 
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/cgi-bin/mailman/listinfo/igstk-users



More information about the IGSTK-Users mailing list