<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=Windows-1252">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.0.6487.1">
<TITLE>RE: [vtkusers] Re: .raw Can't See Any Color</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<P><FONT SIZE=2>Thanks for all of your help. It work...!!<BR>
<BR>
<BR>
-----Original Message-----<BR>
From: vtkusers-bounces@vtk.org on behalf of Goodwin Lawlor<BR>
Sent: Wed 10/20/2004 1:22 PM<BR>
To: vtkusers@public.kitware.com<BR>
Cc: <BR>
Subject: [vtkusers] Re: .raw Can't See Any Color<BR>
Hi Nathaniel,<BR>
<BR>
The VHP images are raw planar... not interlaced the way vtkImageReader<BR>
expects. You are seeing a grayscale image because you are only reading in<BR>
the first (monochrome) channel out of three.<BR>
<BR>
I have a tcl script to read in a raw vhp image and display it in colour. You<BR>
can get it here:<BR>
<BR>
<A HREF="http://www.bioengineering-research.com/vtk/vhpreader.tcl">http://www.bioengineering-research.com/vtk/vhpreader.tcl</A><BR>
<BR>
You can get some test images to play with here:<BR>
<A HREF="ftp://ftp.nlm.nih.gov/visible/bitmaps/color24/">ftp://ftp.nlm.nih.gov/visible/bitmaps/color24/</A><BR>
Decompress them first!<BR>
<BR>
I was going to write a small vtk/tcl app to read/view/crop/write vhp raw<BR>
images but time doesn't permit. This script was an initial test. There are<BR>
shareware apps out there that can batch convert raw planar images to bmp/png<BR>
that vtk can read directly.<BR>
<BR>
<BR>
hth<BR>
<BR>
Goodwin<BR>
<BR>
<BR>
"Mathieu Malaterre" <mathieu.malaterre@kitware.com> wrote in message<BR>
<A HREF="news:41768797.8050400@kitware.com">news:41768797.8050400@kitware.com</A>...<BR>
> Nathaniel,<BR>
><BR>
> If the raw image is RGB, use:<BR>
><BR>
> SetNumberOfScalarComponents 3<BR>
><BR>
> <A HREF="http://www.vtk.org/doc/nightly/html/classvtkImageReader2.html#z2829_0">http://www.vtk.org/doc/nightly/html/classvtkImageReader2.html#z2829_0</A><BR>
><BR>
> HTH<BR>
> Mathieu<BR>
><BR>
> Nathaniel Gonzalez wrote:<BR>
> > Hi:<BR>
> > I'm reading a raw image, this image is part of the human visible<BR>
> > project. When I display it I only see gray image. When I open the image<BR>
> > in photoshop with the following raw parameter Header 0, Width 2048,<BR>
> > Height 1216, Count 3, Bits 8, Interlaced No I get a full color image. If<BR>
> > any one knows what can be my error please let me know. This is how I'm<BR>
> > doing it.<BR>
> ><BR>
> > vtkImageReader part<BR>
> > part SetFileName "a_vm1002.raw"<BR>
> > part SetDataSpacing 0.33 0.33 1.0<BR>
> > part SetDataExtent 0 2047 0 1215 0 0<BR>
> > part SetDataScalarTypeToUnsignedChar<BR>
> ><BR>
> > vtkImageActor imageActor<BR>
> > imageActor SetInput [ part GetOutput ]<BR>
> ><BR>
> > I don't know how to add the parameter Count or Interlaced.<BR>
> ><BR>
> > Thanks for any help.<BR>
> ><BR>
> > Nathaniel Gonzalez<BR>
> > Programmer<BR>
> > University of Puerto Rico<BR>
> > Medical Science Campus<BR>
> ><BR>
> ><BR>
> > _______________________________________________<BR>
> > This is the private VTK discussion list.<BR>
> > Please keep messages on-topic. Check the FAQ at:<BR>
<<A HREF="http://public.kitware.com/cgi-bin/vtkfaq">http://public.kitware.com/cgi-bin/vtkfaq</A>><BR>
> > Follow this link to subscribe/unsubscribe:<BR>
> > <A HREF="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</A><BR>
> ><BR>
><BR>
><BR>
><BR>
> _______________________________________________<BR>
> This is the private VTK discussion list.<BR>
> Please keep messages on-topic. Check the FAQ at:<BR>
<<A HREF="http://public.kitware.com/cgi-bin/vtkfaq">http://public.kitware.com/cgi-bin/vtkfaq</A>><BR>
> Follow this link to subscribe/unsubscribe:<BR>
> <A HREF="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</A><BR>
><BR>
<BR>
<BR>
<BR>
_______________________________________________<BR>
This is the private VTK discussion list.<BR>
Please keep messages on-topic. Check the FAQ at: <<A HREF="http://public.kitware.com/cgi-bin/vtkfaq">http://public.kitware.com/cgi-bin/vtkfaq</A>><BR>
Follow this link to subscribe/unsubscribe:<BR>
<A HREF="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</A><BR>
<BR>
<BR>
</FONT>
</P>
</BODY>
</HTML>