<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1106" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Dear VTK-users,</FONT></DIV>
<DIV><FONT size=2><FONT face=Arial> </DIV></FONT></FONT>
<DIV><FONT face=Arial size=2>I have a series of RAW images I wish to render. I
know their sizes, how they are laid out, and can open them in Paintshop Pro, but
I can not get them to render in VTK. I think that this may have something to do
with the vtkImageReader I am using.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>The pictures are color bit mapped, RGB 24 bit
planar images, with a pixel size of 0.33.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I have used the code below to read in images
before, and successfully rendered them, but this format seems to be causing some
difficulty as all that is rendering is a black rectangle.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Any help you can provide would be greatly
appreciated,</FONT></DIV>
<DIV><FONT face=Arial size=2>Stephen</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Please find the code attached:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial
size=2>--------------------------------------------------------------------------------------------------------------------</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>#Set the origins to the corners - since we are
setting the </FONT></DIV>
<DIV><FONT face=Arial size=2>set origin_x [expr ( 1216 / 2.0 ) *
$PIXEL_SIZE * -1.0]<BR>set origin_y [expr ( 2048 / 2.0 ) * $PIXEL_SIZE *
-1.0]</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>vtkImageReader reader<BR> reader
SetDataExtent 0 1215 0 2048 1 5<BR> reader
SetDataVOI 0 1215 0 2048 1 5</FONT></DIV>
<DIV><FONT face=Arial size=2> reader SetFilePrefix
$BASENAME<BR> reader SetDataSpacing 0.33 0.33
1.0<BR> reader SetDataOrigin $origin_x
$origin_y 0</FONT></DIV>
<DIV><FONT face=Arial size=2> reader SetHeaderSize
0</FONT></DIV>
<DIV><FONT face=Arial size=2> reader
SetDataByteOrderToBigEndian<BR> reader
SetDataScalarTypeToUnsignedShort<BR> reader SetDataMask
0x7fff<BR> [reader GetOutput]
GlobalReleaseDataFlagOn;</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>vtkImageCast cast<BR> cast
SetInput [reader GetOutput]<BR> cast
SetOutputScalarTypeToUnsignedChar<BR>
<BR>vtkVolumeRayCastCompositeFunction compositeFunction</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>vtkVolumeRayCastMapper
volumeMapper<BR> volumeMapper SetVolumeRayCastFunction
compositeFunction<BR> volumeMapper SetInput [cast
GetOutput]</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>vtkVolume volume<BR> volume
SetMapper volumeMapper</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I then go on to render it as normal.</FONT></DIV>
<DIV><FONT face=Arial size=2>I have also tried setting the reader as
UnsignedChar to no avail.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thanks for reading this far,</FONT></DIV>
<DIV><FONT face=Arial size=2>Stephen</FONT></DIV></BODY></HTML>