[vtkusers] Re: .raw Can't See Any Color
Goodwin Lawlor
goodwin.lawlor at ucd.ie
Wed Oct 20 13:22:25 EDT 2004
Hi Nathaniel,
The VHP images are raw planar... not interlaced the way vtkImageReader
expects. You are seeing a grayscale image because you are only reading in
the first (monochrome) channel out of three.
I have a tcl script to read in a raw vhp image and display it in colour. You
can get it here:
http://www.bioengineering-research.com/vtk/vhpreader.tcl
You can get some test images to play with here:
ftp://ftp.nlm.nih.gov/visible/bitmaps/color24/
Decompress them first!
I was going to write a small vtk/tcl app to read/view/crop/write vhp raw
images but time doesn't permit. This script was an initial test. There are
shareware apps out there that can batch convert raw planar images to bmp/png
that vtk can read directly.
hth
Goodwin
"Mathieu Malaterre" <mathieu.malaterre at kitware.com> wrote in message
news:41768797.8050400 at kitware.com...
> Nathaniel,
>
> If the raw image is RGB, use:
>
> SetNumberOfScalarComponents 3
>
> http://www.vtk.org/doc/nightly/html/classvtkImageReader2.html#z2829_0
>
> HTH
> Mathieu
>
> Nathaniel Gonzalez wrote:
> > Hi:
> > I'm reading a raw image, this image is part of the human visible
> > project. When I display it I only see gray image. When I open the image
> > in photoshop with the following raw parameter Header 0, Width 2048,
> > Height 1216, Count 3, Bits 8, Interlaced No I get a full color image. If
> > any one knows what can be my error please let me know. This is how I'm
> > doing it.
> >
> > vtkImageReader part
> > part SetFileName "a_vm1002.raw"
> > part SetDataSpacing 0.33 0.33 1.0
> > part SetDataExtent 0 2047 0 1215 0 0
> > part SetDataScalarTypeToUnsignedChar
> >
> > vtkImageActor imageActor
> > imageActor SetInput [ part GetOutput ]
> >
> > I don't know how to add the parameter Count or Interlaced.
> >
> > Thanks for any help.
> >
> > Nathaniel Gonzalez
> > Programmer
> > University of Puerto Rico
> > Medical Science Campus
> >
> >
> > _______________________________________________
> > This is the private VTK discussion list.
> > Please keep messages on-topic. Check the FAQ at:
<http://public.kitware.com/cgi-bin/vtkfaq>
> > Follow this link to subscribe/unsubscribe:
> > http://www.vtk.org/mailman/listinfo/vtkusers
> >
>
>
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
<http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
More information about the vtkusers
mailing list