<br><font size=2 face="sans-serif">Yasser, you didn't supply the filename in the prefix so its trying to read a filename that is really the directory name</font>
<br>
<br><font size=2 face="Courier New">D:/ex/headsq.1</font>
<br>
<br><font size=2 face="sans-serif">I think what you want is</font>
<br>
<br><font size=2 face="Courier New">D:/ex/headsq/quarter.1 etc.</font>
<br>
<br><font size=2 face="Courier New">so the prefix should be</font>
<br>
<br><font size=2 face="Courier New">v16->SetFilePrefix ("D:/ex/headsq/quarter");</font>
<br>
<br><font size=2 face="Courier New">I'm assuming you are using the vtkdata from version 4 (my headsq folder has the quarter data in it). If your filename is different just substitute the right one in...john</font>
<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: </font>
<td></table>
<br>
<table width=100%>
<tr valign=top>
<td>
<td><font size=1 face="sans-serif"><b>yasser salman <yass@uscx.net></b></font>
<br><font size=1 face="sans-serif"> Sent by: vtkusers-admin@public.kitware.com</font>
<p><font size=1 face="sans-serif">02/20/2003 02:06 PM</font>
<br><font size=1 face="sans-serif">Please respond to yass</font>
<br>
<td><font size=1 face="Arial"> </font>
<br><font size=1 face="sans-serif"> To: Jeremy Winston <winston@cat.rpi.edu>, vtk users <vtkusers@public.kitware.com></font>
<br><font size=1 face="sans-serif"> cc: (bcc: John Anast-JM/PGI)</font>
<br><font size=1 face="sans-serif"> Subject: [vtkusers] NO DATA WHY?? medical2 again!!</font></table>
<br>
<br><font size=2 face="Courier New"><br>
<br>
Hi Jeremy.,<br>
<br>
i did As u told me but it seems no hope!!!<br>
i changed the path to v16->SetFilePrefix ("D:/ex/headsq");<br>
and the data in the directory (D:ex\headsq) but the same problem( empty rectangle can be rendered with no data inside it <br>
and error message :<br>
<br>
":ERROR: In C:\martink\vtk40\VTK\IO\vtkVolume16Reader.cxx, line 390"<br>
"vtkVolume16Reader (0x00EC4B20): Can't find file: D:/ex/headsq.1"<br>
<br>
<br>
may be the problem with somthing else like FilePatter or somthing like that?<br>
i'll attach u the Medical2.cxx and u can test it if u plz.. thanx jeremy any way..<br>
yasser..<br>
<br>
<br>
_____________________________________________________________<br>
Free shareware + free products & services at U.S. Computer Corporation - http://www.uscomputer.net/portal.htm<br>
<br>
_____________________________________________________________<br>
Select your own custom email address for FREE! Get you@yourchoice.com w/No Ads, 6MB, POP & more! http://www.everyone.net/selectmail?campaign=tag<br>
/*=========================================================================<br>
<br>
Program: Visualization Toolkit<br>
Module: $RCSfile: Medical2.cxx,v $<br>
Language: C++<br>
Date: $Date: 2002/11/27 16:06:38 $<br>
Version: $Revision: 1.2 $<br>
<br>
Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen <br>
All rights reserved.<br>
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.<br>
</font>
<br><font size=2 face="Courier New"> This software is distributed WITHOUT ANY WARRANTY; without even <br>
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR <br>
PURPOSE. See the above copyright notice for more information.<br>
<br>
=========================================================================*/<br>
//<br>
// This example reads a volume dataset, extracts two isosurfaces that<br>
// represent the skin and bone, and then displays them.<br>
//<br>
<br>
#include "vtkRenderer.h"<br>
#include "vtkRenderWindow.h"<br>
#include "vtkRenderWindowInteractor.h"<br>
#include "vtkVolume16Reader.h"<br>
#include "vtkPolyDataMapper.h"<br>
#include "vtkActor.h"<br>
#include "vtkProperty.h"<br>
#include "vtkOutlineFilter.h"<br>
#include "vtkCamera.h"<br>
#include "vtkPolyDataMapper.h"<br>
#include "vtkStripper.h"<br>
#include "vtkPolyDataNormals.h"<br>
#include "vtkContourFilter.h"<br>
<br>
int main (int argc, char **argv)<br>
{<br>
<br>
<br>
// Create the renderer, the render window, and the interactor. The renderer<br>
// draws into the render window, the interactor enables mouse- and <br>
// keyboard-based interaction with the data within the render window.<br>
//<br>
vtkRenderer *aRenderer = vtkRenderer::New();<br>
vtkRenderWindow *renWin = vtkRenderWindow::New();<br>
renWin->AddRenderer(aRenderer);<br>
vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();<br>
iren->SetRenderWindow(renWin);<br>
<br>
// The following reader is used to read a series of 2D slices (images)<br>
// that compose the volume. The slice dimensions are set, and the<br>
// pixel spacing. The data Endianness must also be specified. The reader<br>
// usese the FilePrefix in combination with the slice number to construct<br>
// filenames using the format FilePrefix.%d. (In this case the FilePrefix<br>
// is the root name of the file: quarter.)<br>
vtkVolume16Reader *v16 = vtkVolume16Reader::New();<br>
v16->SetDataDimensions(64,64);<br>
v16->SetDataByteOrderToLittleEndian();<br>
v16->SetFilePrefix ("D:/ex/headsq");<br>
v16->SetImageRange(1, 93);<br>
v16->SetDataSpacing (3.2, 3.2, 1.5);<br>
<br>
// An isosurface, or contour value of 500 is known to correspond to the<br>
// skin of the patient. Once generated, a vtkPolyDataNormals filter is<br>
// is used to create normals for smooth surface shading during rendering.<br>
// The triangle stripper is used to create triangle strips from the<br>
// isosurface; these render much faster on may systems.<br>
vtkContourFilter *skinExtractor = vtkContourFilter::New();<br>
skinExtractor->SetInput((vtkDataSet *) v16->GetOutput());<br>
skinExtractor->SetValue(0, 500);<br>
vtkPolyDataNormals *skinNormals = vtkPolyDataNormals::New();<br>
skinNormals->SetInput(skinExtractor->GetOutput());<br>
skinNormals->SetFeatureAngle(60.0);<br>
vtkStripper *skinStripper = vtkStripper::New();<br>
skinStripper->SetInput(skinNormals->GetOutput());<br>
vtkPolyDataMapper *skinMapper = vtkPolyDataMapper::New();<br>
skinMapper->SetInput(skinStripper->GetOutput());<br>
skinMapper->ScalarVisibilityOff();<br>
vtkActor *skin = vtkActor::New();<br>
skin->SetMapper(skinMapper);<br>
skin->GetProperty()->SetDiffuseColor(1, .49, .25);<br>
skin->GetProperty()->SetSpecular(.3);<br>
skin->GetProperty()->SetSpecularPower(20);<br>
skin->GetProperty()->SetOpacity(1.0);<br>
<br>
// An isosurface, or contour value of 1150 is known to correspond to the<br>
// skin of the patient. Once generated, a vtkPolyDataNormals filter is<br>
// is used to create normals for smooth surface shading during rendering.<br>
// The triangle stripper is used to create triangle strips from the<br>
// isosurface; these render much faster on may systems.<br>
vtkContourFilter *boneExtractor = vtkContourFilter::New();<br>
boneExtractor->SetInput((vtkDataSet *) v16->GetOutput());<br>
boneExtractor->SetValue(0, 1150);<br>
vtkPolyDataNormals *boneNormals = vtkPolyDataNormals::New();<br>
boneNormals->SetInput(boneExtractor->GetOutput());<br>
boneNormals->SetFeatureAngle(60.0);<br>
vtkStripper *boneStripper = vtkStripper::New();<br>
boneStripper->SetInput(boneNormals->GetOutput());<br>
vtkPolyDataMapper *boneMapper = vtkPolyDataMapper::New();<br>
boneMapper->SetInput(boneStripper->GetOutput());<br>
boneMapper->ScalarVisibilityOff();<br>
vtkActor *bone = vtkActor::New();<br>
bone->SetMapper(boneMapper);<br>
bone->GetProperty()->SetDiffuseColor(1, 1, .9412);<br>
<br>
// An outline provides context around the data.<br>
//<br>
vtkOutlineFilter *outlineData = vtkOutlineFilter::New();<br>
outlineData->SetInput((vtkDataSet *) v16->GetOutput());<br>
vtkPolyDataMapper *mapOutline = vtkPolyDataMapper::New();<br>
mapOutline->SetInput(outlineData->GetOutput());<br>
vtkActor *outline = vtkActor::New();<br>
outline->SetMapper(mapOutline);<br>
outline->GetProperty()->SetColor(0,0,0);<br>
<br>
// It is convenient to create an initial view of the data. The FocalPoint<br>
// and Position form a vector direction. Later on (ResetCamera() method)<br>
// this vector is used to position the camera to look at the data in</font>
<br><font size=2 face="Courier New"> // this direction.<br>
vtkCamera *aCamera = vtkCamera::New();<br>
aCamera->SetViewUp (0, 0, -1);<br>
aCamera->SetPosition (0, 1, 0);<br>
aCamera->SetFocalPoint (0, 0, 0);<br>
aCamera->ComputeViewPlaneNormal();<br>
<br>
// Actors are added to the renderer. An initial camera view is created.<br>
// The Dolly() method moves the camera towards the FocalPoint,<br>
// thereby enlarging the image.<br>
aRenderer->AddActor(outline);<br>
aRenderer->AddActor(skin);<br>
aRenderer->AddActor(bone);<br>
aRenderer->SetActiveCamera(aCamera);<br>
aRenderer->ResetCamera ();<br>
aCamera->Dolly(1.5);<br>
<br>
// Set a background color for the renderer and set the size of the<br>
// render window (expressed in pixels).<br>
aRenderer->SetBackground(1,1,1);<br>
renWin->SetSize(640, 480);<br>
<br>
// Note that when camera movement occurs (as it does in the Dolly()<br>
// method), the clipping planes often need adjusting. Clipping planes<br>
// consist of two planes: near and far along the view direction. The <br>
// near plane clips out objects in front of the plane; the far plane<br>
// clips out objects behind the plane. This way only what is drawn<br>
// between the planes is actually rendered.<br>
aRenderer->ResetCameraClippingRange ();<br>
<br>
// Set a background color for the renderer and set the size of the<br>
// render window (expressed in pixels).<br>
iren->Initialize();<br>
iren->Start(); <br>
<br>
// It is important to delete all objects created previously to prevent<br>
// memory leaks. In this case, since the program is on its way to<br>
// exiting, it is not so important. But in applications it is<br>
// essential.<br>
v16->Delete();<br>
skinExtractor->Delete();<br>
skinNormals->Delete();<br>
skinStripper->Delete();<br>
skinMapper->Delete();<br>
skin->Delete();<br>
boneExtractor->Delete();<br>
boneNormals->Delete();<br>
boneStripper->Delete();<br>
boneMapper->Delete();<br>
bone->Delete();<br>
outlineData->Delete();<br>
mapOutline->Delete();<br>
outline->Delete();<br>
aCamera->Delete();<br>
aRenderer->Delete();<br>
renWin->Delete();<br>
iren->Delete();<br>
<br>
return 0;<br>
}<br>
<br>
<br>
</font>
<br>
<br>