<div>hi to all..</div>
<div>&nbsp;</div>
<div>i'am haviing problem in in reading tha data from the specified location....The program is compling properly,but while run time is show the followinf error:</div>
<div>&nbsp;</div>
<div>1) ERROR: In C:\martink\vtk42\VTK\IO\vtkVolume16Reader.cxx, line 334<br>vtkVolume16Reader (0x055F0D80): Can't find file: c:/VTK_DATA_ROOT/Data/headsq/quarter.1
<p>2) ERROR: In C:\martink\vtk42\VTK\Graphics\vtkPolyDataNormals.cxx, line 88<br>vtkPolyDataNormals (0x055F2128): No data to generate normals for!</p>
<p>I have tried using \ / \\ // but result is same....</p>
<p>I'am using Visual studio 6.0 as IDE.... the following is my code...</p>
<p><br>// This example reads a volume dataset, extracts an isosurface that<br>// represents the skin and displays it.<br></p>
<p>#include &quot;vtkRenderer.h&quot;<br>#include &quot;vtkRenderWindow.h&quot;<br>#include &quot;vtkRenderWindowInteractor.h&quot;<br>#include &quot;vtkVolume16Reader.h&quot;<br>#include &quot;vtkPolyDataMapper.h&quot;<br>
#include &quot;vtkActor.h&quot;<br>#include &quot;vtkOutlineFilter.h&quot;<br>#include &quot;vtkCamera.h&quot;<br>#include &quot;vtkProperty.h&quot;<br>#include &quot;vtkPolyDataNormals.h&quot;<br>#include &quot;vtkContourFilter.h
&quot;</p>
<p>int main ()<br>{<br>&nbsp; </p>
<p>&nbsp; // Create the renderer, the render window, and the interactor. The renderer<br>&nbsp; // draws into the render window, the interactor enables mouse- and <br>&nbsp; // keyboard-based interaction with the data within the render window.
<br>&nbsp; //<br>&nbsp; vtkRenderer *aRenderer = vtkRenderer::New();<br>&nbsp; vtkRenderWindow *renWin = vtkRenderWindow::New();<br>&nbsp;&nbsp;&nbsp; renWin-&gt;AddRenderer(aRenderer);<br>&nbsp; vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
<br>&nbsp;&nbsp;&nbsp; iren-&gt;SetRenderWindow(renWin);</p>
<p>&nbsp; // The following reader is used to read a series of 2D slices (images)<br>&nbsp; // that compose the volume. The slice dimensions are set, and the<br>&nbsp; // pixel spacing. The data Endianness must also be specified. The reader
<br>&nbsp; // usese the FilePrefix in combination with the slice number to construct<br>&nbsp; // filenames using the format FilePrefix.%d. (In this case the FilePrefix<br>&nbsp; // is the root name of the file: quarter.)<br>&nbsp; vtkVolume16Reader *v16 = vtkVolume16Reader::New();
<br>&nbsp;&nbsp;&nbsp; v16-&gt;SetDataDimensions (512,512);<br>&nbsp;&nbsp;&nbsp; v16-&gt;SetImageRange (1,40);<br>&nbsp;&nbsp;&nbsp; v16-&gt;SetDataByteOrderToLittleEndian();<br>&nbsp;&nbsp;&nbsp; v16-&gt;SetFilePrefix(&quot;c:/VTK_DATA_ROOT/Data/headsq/quarter&quot;);<br>&nbsp;&nbsp;&nbsp; v16-&gt;SetDataSpacing (
3.2, 3.2, 1.5);</p>
<p>&nbsp; // An isosurface, or contour value of 500 is known to correspond to the<br>&nbsp; // skin of the patient. Once generated, a vtkPolyDataNormals filter is<br>&nbsp; // is used to create normals for smooth surface shading during rendering.
<br>&nbsp; vtkContourFilter *skinExtractor = vtkContourFilter::New();<br>&nbsp;&nbsp;&nbsp; skinExtractor-&gt;SetInput((vtkDataSet *) v16-&gt;GetOutput());<br>&nbsp;&nbsp;&nbsp; skinExtractor-&gt;SetValue(0, 500);<br>&nbsp; vtkPolyDataNormals *skinNormals = vtkPolyDataNormals::New();
<br>&nbsp;&nbsp;&nbsp; skinNormals-&gt;SetInput(skinExtractor-&gt;GetOutput());<br>&nbsp;&nbsp;&nbsp; skinNormals-&gt;SetFeatureAngle(60.0);<br>&nbsp; vtkPolyDataMapper *skinMapper = vtkPolyDataMapper::New();<br>&nbsp;&nbsp;&nbsp; skinMapper-&gt;SetInput(skinNormals-&gt;GetOutput());
<br>&nbsp;&nbsp;&nbsp; skinMapper-&gt;ScalarVisibilityOff();<br>&nbsp; vtkActor *skin = vtkActor::New();<br>&nbsp;&nbsp;&nbsp; skin-&gt;SetMapper(skinMapper);</p>
<p>&nbsp; // An outline provides context around the data.<br>&nbsp; //<br>&nbsp; vtkOutlineFilter *outlineData = vtkOutlineFilter::New();<br>&nbsp;&nbsp;&nbsp; outlineData-&gt;SetInput((vtkDataSet *) v16-&gt;GetOutput());<br>&nbsp; vtkPolyDataMapper *mapOutline = vtkPolyDataMapper::New();
<br>&nbsp;&nbsp;&nbsp; mapOutline-&gt;SetInput(outlineData-&gt;GetOutput());<br>&nbsp; vtkActor *outline = vtkActor::New();<br>&nbsp;&nbsp;&nbsp; outline-&gt;SetMapper(mapOutline);<br>&nbsp;&nbsp;&nbsp; outline-&gt;GetProperty()-&gt;SetColor(0,0,0);</p>
<p>&nbsp; // It is convenient to create an initial view of the data. The FocalPoint<br>&nbsp; // and Position form a vector direction. Later on (ResetCamera() method)<br>&nbsp; // this vector is used to position the camera to look at the data in
<br>&nbsp; // this direction.<br>&nbsp; vtkCamera *aCamera = vtkCamera::New();<br>&nbsp;&nbsp;&nbsp; aCamera-&gt;SetViewUp (0, 0, -1);<br>&nbsp;&nbsp;&nbsp; aCamera-&gt;SetPosition (0, 1, 0);<br>&nbsp;&nbsp;&nbsp; aCamera-&gt;SetFocalPoint (0, 0, 0);<br>&nbsp;&nbsp;&nbsp; aCamera-&gt;ComputeViewPlaneNormal();
</p>
<p>&nbsp; // Actors are added to the renderer. An initial camera view is created.<br>&nbsp; // The Dolly() method moves the camera towards the FocalPoint,<br>&nbsp; // thereby enlarging the image.<br>&nbsp; aRenderer-&gt;AddActor(outline);<br>
&nbsp; aRenderer-&gt;AddActor(skin);<br>&nbsp; aRenderer-&gt;SetActiveCamera(aCamera);<br>&nbsp; aRenderer-&gt;ResetCamera ();<br>&nbsp; aCamera-&gt;Dolly(1.5);</p>
<p>&nbsp; // Set a background color for the renderer and set the size of the<br>&nbsp; // render window (expressed in pixels).<br>&nbsp; aRenderer-&gt;SetBackground(1,1,1);<br>&nbsp; renWin-&gt;SetSize(640, 480);</p>
<p>&nbsp; // Note that when camera movement occurs (as it does in the Dolly()<br>&nbsp; // method), the clipping planes often need adjusting. Clipping planes<br>&nbsp; // consist of two planes: near and far along the view direction. The 
<br>&nbsp; // near plane clips out objects in front of the plane; the far plane<br>&nbsp; // clips out objects behind the plane. This way only what is drawn<br>&nbsp; // between the planes is actually rendered.<br>&nbsp; aRenderer-&gt;ResetCameraClippingRange ();
</p>
<p>&nbsp; // Initialize the event loop and then start it.<br>&nbsp; iren-&gt;Initialize();<br>&nbsp; iren-&gt;Start(); </p>
<p>&nbsp; // It is important to delete all objects created previously to prevent<br>&nbsp; // memory leaks. In this case, since the program is on its way to<br>&nbsp; // exiting, it is not so important. But in applications it is<br>&nbsp; // essential.
<br>&nbsp; v16-&gt;Delete();<br>&nbsp; skinExtractor-&gt;Delete();<br>&nbsp; skinNormals-&gt;Delete();<br>&nbsp; skinMapper-&gt;Delete();<br>&nbsp; skin-&gt;Delete();<br>&nbsp; outlineData-&gt;Delete();<br>&nbsp; mapOutline-&gt;Delete();<br>&nbsp; outline-&gt;Delete();
<br>&nbsp; aCamera-&gt;Delete();<br>&nbsp; iren-&gt;Delete();<br>&nbsp; renWin-&gt;Delete();<br>&nbsp; aRenderer-&gt;Delete();</p>
<p>&nbsp; return 0;<br>}<br></p>
<p>Please anyone can hel me out....????</p>
<p>&nbsp;</p>
<p><br>&nbsp;</p></div>