<br><font size=2 face="sans-serif">Paul, you can use vtkImageReader but its definitely more work and you have to manually &quot;parse&quot; the file</font>
<br>
<br><font size=2 face="sans-serif">vtkStructuredPointsReader reader</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; reader SetFileName &quot;$env(VTK_DATA)/data/ironProt.vtk&quot;</font>
<br>
<br><font size=2 face="sans-serif">or </font>
<br>
<br><font size=2 face="sans-serif">vtkImageReader reader1</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; reader1 SetFileName &quot;$env(VTK_DATA)/data/ironProt.vtk&quot;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; reader1 SetFileDimensionality 3</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; reader1 SetHeaderSize 210</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; reader1 SetDataSpacing 1 1 1</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; reader1 SetDataExtent 0 67 0 67 1 68</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; reader1 SetDataScalarTypeToUnsignedChar &nbsp;</font>
<br>
<br>
<br><font size=1 color=#800080 face="sans-serif">----- Forwarded by John Anast-JM/PGI on 07/08/2003 04:55 PM -----</font>
<br>
<table width=100%>
<tr valign=top>
<td>
<td><font size=1 face="sans-serif"><b>John Anast-JM</b></font>
<p>
<br>
<td>
<br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; To: &nbsp; &nbsp; &nbsp; &nbsp;Paul McGuinness &lt;mcguinpg@maths.tcd.ie&gt;</font>
<br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; cc: &nbsp; &nbsp; &nbsp; &nbsp;</font>
<br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; Subject: &nbsp; &nbsp; &nbsp; &nbsp;Re: [vtkusers] volume rendering problem!</font><a href=Notes:///85256553007682E7/1C70127D4A3BC6BC8525675C00138CE0/9423DCC17683B4C685256D5D006C1D00>Link</a></table>
<br>
<br><font size=2 face="sans-serif">Paul, yes but vtkImageReader is expecting image files not VTK format files. I have a fairly recent CVS build of VTK4.2.x and vtkStructuredPointsReader has not been replaced to my knowledge, where did you see this? &nbsp;I imagine you could use vtkImageReader if you told it the &quot;header&quot; was all the info up till the image data but then you would have to set all the parameters manually, while vtkStructuredPointsReader does it for you...why fight it?? Also ascii data would not work because vtkImageReader is expecting binary. When I use vtkStructuredPointsReader there is no deprecation warning (nor does the man page suggest this). vtkStructuredPointsReader can feed a vtkVolumeRayCastMapper just fine. Maybe the list has some insight here?? ...john</font>
<br>
<br>
<br>
<br>
<br>
<table>
<tr valign=top>
<td><font size=6 color=red face="Times New Roman"><b>Internet Mail Message</b></font>
<br><font size=2 color=red face="sans-serif">Received from host: &nbsp; &nbsp; &nbsp; &nbsp;</font><font size=2 face="sans-serif"><b>public.kitware.com [24.97.130.19]</b></font>
<td></table>
<br>
<table width=100%>
<tr valign=top>
<td>
<td><font size=1 face="sans-serif"><b>Paul McGuinness &lt;mcguinpg@maths.tcd.ie&gt;</b></font>
<br><font size=1 face="sans-serif">Sent by: vtkusers-admin@vtk.org</font>
<p><font size=1 face="sans-serif">07/08/2003 06:53 AM</font>
<br>
<td><font size=1 face="Arial">&nbsp; &nbsp; &nbsp; &nbsp; </font>
<br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; To: &nbsp; &nbsp; &nbsp; &nbsp;John Anast-JM/PGI@PGI</font>
<br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; cc: &nbsp; &nbsp; &nbsp; &nbsp;vtkusers@vtk.org</font>
<br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; Subject: &nbsp; &nbsp; &nbsp; &nbsp;Re: [vtkusers] volume rendering problem!</font></table>
<br>
<br>
<br><font size=2 face="Courier New"><br>
John,<br>
<br>
In more recent versions of the visualization toolkit<br>
vtkStructuredPointsReader has been replaced with vtkImageReader. For<br>
example vtkVolumeRayCastMapper use to take vtkStructuredPointsData<br>
objects as input, but in the current version of vtk vtkVolumeRayCastMapper<br>
takes vtkImageData as the input. Using vtkImageReader instead of<br>
vtkStructuredPointsReader is causing some problems because I cannot find a<br>
similar example where vtkImageReader has been used for volume rendering.<br>
<br>
Paul<br>
<br>
<br>
On Mon, 7 Jul 2003 anast.jm@pg.com wrote:<br>
<br>
&gt; Paul, &nbsp;vtkImageReader doesn't read VTK format data files....try using<br>
&gt; vtkStructurePointsReader ....john<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Internet Mail Message<br>
&gt; Received from host: &nbsp; &nbsp; public.kitware.com [24.97.130.19]<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Paul McGuinness &lt;mcguinpg@maths.tcd.ie&gt;<br>
&gt; Sent by: vtkusers-admin@vtk.org<br>
&gt; 07/04/2003 10:10 AM<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; To: &nbsp; &nbsp; vtkusers@vtk.org<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; cc: &nbsp; &nbsp; (bcc: John Anast-JM/PGI)<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; Subject: &nbsp; &nbsp; &nbsp; &nbsp;[vtkusers] volume rendering problem!<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Hi All,<br>
&gt;<br>
&gt; I am having a problem displaying the volume rendering of ironProt.vtk. The<br>
&gt; code compiles, and the display window appears but there is no rendering in<br>
&gt; the window, the window is just empty. Can someone please help me, I am<br>
&gt; reading in the file using vtkImageReader and using vtkImageCast to convert<br>
&gt; it to unsigned-short. Then vtkVolumeRayCastMapper sets its input to the<br>
&gt; vtkImageCast object's output, see below. I am using vtk4.2.2.<br>
&gt; Please can someone help,<br>
&gt; Happy 4th July,<br>
&gt; Paul.<br>
&gt;<br>
&gt;<br>
&gt; int main( int argc, char *argv[] )<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br>
&gt; vtkRenderer *ren1 =vtkRenderer::New();<br>
&gt; vtkRenderWindow *renWin=vtkRenderWindow::New();<br>
&gt; &nbsp; &nbsp; renWin-&gt;AddRenderer(ren1);<br>
&gt; vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();<br>
&gt; &nbsp; &nbsp; iren-&gt;SetRenderWindow(renWin);<br>
&gt;<br>
&gt; vtkImageReader *reader =vtkImageReader::New();<br>
&gt; reader-&gt;SetFileName(&quot;ironProt.vtk&quot;);<br>
&gt;<br>
&gt;<br>
&gt; vtkImageCast *imgcas = vtkImageCast::New();<br>
&gt; imgcas-&gt;SetInput(reader-&gt;GetOutput());<br>
&gt; imgcas-&gt;SetOutputScalarTypeToUnsignedShort();<br>
&gt;<br>
&gt;<br>
&gt; vtkPiecewiseFunction *opacityTransferFunction =<br>
&gt; vtkPiecewiseFunction::New();<br>
&gt; &nbsp; &nbsp; opacityTransferFunction-&gt;AddPoint(20, &nbsp; 0.0);<br>
&gt; &nbsp; &nbsp; opacityTransferFunction-&gt;AddPoint(255, &nbsp;0.2);<br>
&gt;<br>
&gt; vtkColorTransferFunction *colorTransferFunction =<br>
&gt; vtkColorTransferFunction::New();<br>
&gt; &nbsp; &nbsp; colorTransferFunction-&gt;AddRGBPoint( 0.0, 0.0, 0.0, 0.0);<br>
&gt; &nbsp; &nbsp; colorTransferFunction-&gt;AddRGBPoint(64.0, 1.0, 0.0, 0.0);<br>
&gt; &nbsp; &nbsp; colorTransferFunction-&gt;AddRGBPoint(128.0, 0.0, 0.0, 1.0);<br>
&gt; &nbsp; &nbsp; colorTransferFunction-&gt;AddRGBPoint(192.0, 0.0, 1.0, 0.0);<br>
&gt; &nbsp; &nbsp; colorTransferFunction-&gt;AddRGBPoint(255.0, 0.0, 0.2, 0.0);<br>
&gt;<br>
&gt; vtkVolumeProperty *volumeProperty = vtkVolumeProperty::New();<br>
&gt; &nbsp; &nbsp; volumeProperty-&gt;SetColor(colorTransferFunction);<br>
&gt; &nbsp; &nbsp; volumeProperty-&gt;SetScalarOpacity(opacityTransferFunction);<br>
&gt; &nbsp; &nbsp; volumeProperty-&gt;ShadeOn();<br>
&gt; &nbsp; &nbsp; volumeProperty-&gt;SetInterpolationTypeToLinear();<br>
&gt;<br>
&gt; vtkVolumeRayCastCompositeFunction &nbsp;*compositeFunction=<br>
&gt; vtkVolumeRayCastCompositeFunction::New();<br>
&gt; vtkVolumeRayCastMapper *volumeMapper = vtkVolumeRayCastMapper::New();<br>
&gt; &nbsp; &nbsp; volumeMapper-&gt;SetVolumeRayCastFunction(compositeFunction);<br>
&gt; &nbsp; &nbsp; volumeMapper-&gt;SetInput(imgcas-&gt;GetOutput());<br>
&gt;<br>
&gt; vtkVolume *volume = vtkVolume::New();<br>
&gt; &nbsp; &nbsp; volume-&gt;SetMapper(volumeMapper);<br>
&gt; &nbsp; &nbsp; volume-&gt;SetProperty(volumeProperty);<br>
&gt;<br>
&gt; ren1-&gt;AddVolume(volume);<br>
&gt; ren1-&gt;SetBackground(1, 1 ,1);<br>
&gt; renWin-&gt;SetSize(600, 600);<br>
&gt; renWin-&gt;Render();<br>
&gt; iren-&gt;Start();<br>
&gt;<br>
&gt; }</font>
<br><font size=2 face="Courier New">&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; This is the private VTK discussion list.<br>
&gt; Please keep messages on-topic. Check the FAQ at:<br>
&gt; &lt;http://public.kitware.com/cgi-bin/vtkfaq&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; http://www.vtk.org/mailman/listinfo/vtkusers<br>
&gt;<br>
&gt;<br>
&gt;<br>
<br>
_______________________________________________<br>
This is the private VTK discussion list. <br>
Please keep messages on-topic. Check the FAQ at: &lt;http://public.kitware.com/cgi-bin/vtkfaq&gt;<br>
Follow this link to subscribe/unsubscribe:<br>
http://www.vtk.org/mailman/listinfo/vtkusers<br>
</font>
<br>
<br>
<br>