[vtkusers] Re: LookupTable + ImagePlaneWidget

Mohamed Ben Reguiga breguiga_mh at yahoo.fr
Wed May 3 09:50:35 EDT 2006


Hello,
thank you for your help, but I still begining in the VTk's big world so 
excuse me if I'm asking abvious questions, but really I need help.
I did like following :
...

planeY->SetWindowLevel(WW,WC); //PlaneY is a vtkImagePlaneWidget
vTKWidget1->GetRenderWindow()->Render(); // rendering the new image  : 
vTKWidget1 is a QVTKWidget
vtkImageMapToColors* myColorMap = vtkImageMapToColors::New();
planeY->SetColorMap(myColorMap);
//access to the widget's reslice's buffer
QImage *myImg=new 
QImage((uchar*)(planeX->GetResliceOutput()->GetScalarPointer()), ....);
myImg->save("EssaiVTK.jpg","JPEG"); //Save the image in the DD;
..
nothing happens , the image is the same!

Is there something wron or I didn't access to the right Buffer because I 
didnt' know how to access to the buffer from the underlying 
vtkImageMapToColors.

thank you for your help, I really need it
regards,
Med.

----- Original Message ----- 
From: "Dean Inglis" <dean.inglis at camris.ca>
To: "Mohamed Ben Reguiga" <breguiga_mh at yahoo.fr>; <vtk-developers at vtk.org>
Sent: Tuesday, May 02, 2006 8:05 PM
Subject: RE: [vtk-developers] LookupTable + ImagePlaneWidget


> Hi,
>
> you need to access the buffer from the underlying vtkImageMapToColors:
> vtkImageMapToColors  *ColorMap;
>
> since the resliced output gets set in:
>
> void vtkImagePlaneWidget::SetInput(vtkDataSet* input)
> {
> ...
> this->ColorMap->SetInput(this->Reslice->GetOutput());
> ...
> }
>
> you can set the color map externally due to the following macro
> defined in vtkImagePlaneWidget.cxx:
>
> vtkCxxSetObjectMacro(vtkImagePlaneWidget, ColorMap, vtkImageMapToColors);
>
> just do
>
> vtkImageMapToColors* myColorMap = vtkImageMapToColors::New();
> widget->SetColorMap(myColorMap);
>
> and access the buffer as you like.
>
> In future, please post such questions to the user's list and not the
> developer's list.
>
> regards,
> Dean
>
>
>
>
>
> hello,
> I'm using the vtkImagePlaneWidget in my project for a 3d recontitution 
> use,
> under Qt.
> but I'm not using the vtkViewer but an OpenGl widget (QGLWidget), so I
> recover the adresse of the image-buffer like following :
> planeX=vtkImagePlaneWidget::New();
> .....
> uchar * Imgbuffer;
> Imgbuffer =(uchar *)planeX->GetResliceOutput()->GetScalarPointer();
> After that I create the image using Qt routines then I display its texture
> in the QGLWidget.
> the problem that when I use the SetWindowLevel (double window, double
> level), the appearance of the image in QVTKwidget ( that I use for test) 
> is
> changing while I'm changing the values of Window and level but when I
> recover the buffer of  the image nothing change.
> So, is it possible to telle me , how can I recover the changer image by 
> the
> lookupthable or how to recover the lookuptable and use after that to 
> change
> my image.
> thak you!
>
> _______________________________________________
> vtk-developers mailing list
> vtk-developers at vtk.org
> http://www.vtk.org/mailman/listinfo/vtk-developers
>
>
> -- 
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.385 / Virus Database: 268.5.1/328 - Release Date: 01/05/2006
>
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20060503/4847cd67/attachment.htm>


More information about the vtkusers mailing list