Good that you were able to build it :)<br>The error message (essentially a suggestion) says that you need to supply the data directory as the 2nd argument.<br><br>your_dir>Medical1.exe <full_path_to_data_dir><br><br>
where, full_path_to_data_dir is say, C:\vtkdata\headsq<br>also, add the constant part in the filenames.. xxx.1, xxx.2, xxx.3 then add 'xxx'<br><br>from your screenshot, I suggest this:<br><br><b>D:\Test\cxx\OUT\Debug\Medica1.exe C:\vtkdata\headsq\quarter</b><br>
<br>In the 2nd argument, C:\vtkdata\headsq\ is the directory and quarter.1, quarter.2, quarter.3 etc are files in it.<br><br>Hope that helps!<br><br>- Divya Rathore<br><br><div class="gmail_quote">On Tue, Apr 21, 2009 at 2:26 PM, JOHN ATKINSON <span dir="ltr"><<a href="mailto:johnimager@gmail.com">johnimager@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi,<br>
<br>
As per your instruction I built Medical1.cxx again with the sample<br>
data set headquarter.I have attached the screen shot of the output<br>
whcih is mere a command prompt .I am not able to view the rendered<br>
output.Please Help.<br>
<br>
Code.<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 "vtkOutlineFilter.h"<br>
#include "vtkCamera.h"<br>
#include "vtkProperty.h"<br>
#include "vtkPolyDataNormals.h"<br>
#include "vtkContourFilter.h"<br>
<br>
int main (int argc, char **argv)<br>
{<br>
if (argc < 2)<br>
{<br>
cout << "Usage: " << argv[0] << " DATADIR/headsq/quarter" << endl;<br>
return 1;<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->SetImageRange (1,93);<br>
v16->SetDataByteOrderToLittleEndian();<br>
v16->SetFilePrefix (argv[1]);<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>
vtkContourFilter *skinExtractor = vtkContourFilter::New();<br>
skinExtractor->SetInputConnection(v16->GetOutputPort());<br>
skinExtractor->SetValue(0, 500);<br>
vtkPolyDataNormals *skinNormals = vtkPolyDataNormals::New();<br>
skinNormals->SetInputConnection(skinExtractor->GetOutputPort());<br>
skinNormals->SetFeatureAngle(60.0);<br>
vtkPolyDataMapper *skinMapper = vtkPolyDataMapper::New();<br>
skinMapper->SetInputConnection(skinNormals->GetOutputPort());<br>
skinMapper->ScalarVisibilityOff();<br>
vtkActor *skin = vtkActor::New();<br>
skin->SetMapper(skinMapper);<br>
<br>
// An outline provides context around the data.<br>
//<br>
vtkOutlineFilter *outlineData = vtkOutlineFilter::New();<br>
outlineData->SetInputConnection(v16->GetOutputPort());<br>
vtkPolyDataMapper *mapOutline = vtkPolyDataMapper::New();<br>
mapOutline->SetInputConnection(outlineData->GetOutputPort());<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<br>
// 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->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>
// Initialize the event loop and then start it.<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>
skinMapper->Delete();<br>
skin->Delete();<br>
outlineData->Delete();<br>
mapOutline->Delete();<br>
outline->Delete();<br>
aCamera->Delete();<br>
iren->Delete();<br>
renWin->Delete();<br>
aRenderer->Delete();<br>
<br>
return 0;<br>
}<br>
<br>
<br>
Regards<br>
<font color="#888888">John<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>"The difference between school and life? In school, you're taught a lesson and then given a test. In life, you're given a test that teaches you a lesson."<br>