[vtkusers] Visualising 3D RGB data

Mark Wyszomierski markww at gmail.com
Thu Mar 6 10:19:01 EST 2008


Hi Steven,

This looks like the same problem as another post from yesterday:

"[vtkusers] how to display RGB array/image using vtkImageImport"

You need to set a lookup table on the vtkImageMapToWIndowLevelColors
(viewer->GetWindowLevel()) to get colors to show up.

  // Something like the following should do...
 imageviewer2->GetWindowLevel()->SetOutputFormatToRGB();
 vtkLookupTable *lut = vtkLookupTable::New();
 lut->SetHueRange(0.66667, 0.0);
 lut->SetSaturationRange(1, 1);
 lut->SetValueRange(1, 1);
 lut->SetAlphaRange(1, 1);
 lut->SetNumberOfColors(256);
 lut->Build();
 imageviweer2->GetWindowLevel()->SetLookupTable(lut);

-----
Or a hack to avoid settting the lookup table is...

    this->ImageViewer[0]->SetColorLevel(127.50001); // minor offset from 127.5

If you dig into the sources, you'll find out why the hack works :)


bye
--
karthik




Does that do it?

Mark




On Thu, Mar 6, 2008 at 8:45 AM, Steven Kenny <S.D.Kenny at lboro.ac.uk> wrote:
> Mark,
>
> Thank you for your suggestion, that is very much what I am trying to
> do. The only remaining problem I have now is that I get a greyscale
> image rather than a colour one. Do you have any suggestions as to how
> I solve that problem.
>
> Thanks,
>
> Steven
>
>
> On 5 Mar 2008, at 17:50, Mark Wyszomierski wrote:
>
> > Not sure if vtkCutter and vtkPlane do the same thing as
> > vtkImageReslice, but I'm using that class to stick a plane through my
> > RGB volume and I direct the output to a vtkImageViewer2 - is that what
> > you're trying to do?
> >
> > Mark
> >
> > On Wed, Mar 5, 2008 at 4:56 AM, Steven Kenny
> > <S.D.Kenny at lboro.ac.uk> wrote:
> >> I have a set of data that consists of RGB values at a set of uniform
> >> points. I can create either a vtkStructuredGrid or a vtkImageData
> >> object out of this. What I then want to do is to take slices through
> >> this and visualise these. I have tried playing vtkCutter and vtkPlane
> >> to take slices through the data and visualise these. It seems to me
> >> that I can only visualise vector data either by magnitude or by the
> >> value of one of the components using this technique. Can anyone
> >> suggest a technique that will allow me to view the RGB data on a
> >> slice through the object instead.
> >>
> >> Thanks,
> >>
> >> Steven
> >> _______________________________________________
> >> This is the private VTK discussion list.
> >> Please keep messages on-topic. Check the FAQ at: http://
> >> www.vtk.org/Wiki/VTK_FAQ
> >> Follow this link to subscribe/unsubscribe:
> >> http://www.vtk.org/mailman/listinfo/vtkusers
> >>
>
>



More information about the vtkusers mailing list