<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Message</TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial size=2><SPAN
class=172503302-06042004>Hi,</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=172503302-06042004></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=172503302-06042004>I noticed in VTK we
can get volume data by reading a series of 2D slices. But my problem is I
have my volume data in one file which can be raw or Analyse format. Then how to
load it into VTK? Shall I split the volume into 2D slice files
first?</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=172503302-06042004></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=172503302-06042004>Thanks!</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=172503302-06042004></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=172503302-06042004>Pingkun</SPAN></FONT></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><FONT
face=Tahoma size=2>-----Original Message-----<BR><B>From:</B>
vtkusers-admin@vtk.org [mailto:vtkusers-admin@vtk.org] <B>On Behalf Of </B>Amy
Henderson<BR><B>Sent:</B> Tuesday, April 06, 2004 3:01 AM<BR><B>To:</B>
byrdv@cis.uab.edu<BR><B>Cc:</B> vtkusers@vtk.org<BR><B>Subject:</B> RE:
[vtkusers] vtkVolumeReader<BR><BR></FONT></DIV>At 02:55 PM 4/5/2004, Vetria
Byrd wrote:<BR>
<BLOCKQUOTE class=cite cite="" type="cite"><FONT face=arial color=#000080
size=2>Sorry about the reply, I was hitting the reply to and not reply to
all.<BR> </FONT></BLOCKQUOTE><BR>No problem.<BR><BR>
<BLOCKQUOTE class=cite cite="" type="cite"><FONT face=arial color=#000080
size=2>I am trying to create a 3D volume (a 5x5x5 cube).<BR>The data files
(5 files – one for each slice) consists of zero’s and one’s where the one’s
indicate there is an object in that particular cell of the cube, zero’s
indicate the cell is empty. I want to render the cube/object using the
marching cubes algorithm.<BR> </FONT></BLOCKQUOTE><BR>Try using
vtkImageReader or vtkImageReader2. They allow you to specify the data type of
the data you are trying to load.<BR><BR>- Amy<BR><BR>
<BLOCKQUOTE class=cite cite="" type="cite"><FONT face=arial color=#000080
size=2>Vetria<BR> <BR> <BR></FONT><FONT face=tahoma
size=2>-----Original Message-----<BR><B>From:</B> Amy Henderson [<A
href="mailto:amy.henderson@kitware.com"
eudora="autourl">mailto:amy.henderson@kitware.com</A>] <BR><B>Sent:</B>
Monday, April 05, 2004 1:42 PM<BR><B>To:</B> byrdv@cis.uab.edu; 'Amy
Henderson'<BR><B>Subject:</B> RE: [vtkusers] vtkVolumeReader<BR></FONT><FONT
face="Times New Roman, Times"> <BR>Vetria,<BR><BR>I just noticed the
you replied only to me and not the the </FONT>vtkusers list. Please keep the
discussion on the list so other people can help if necessary and so there is
a record of the solution to this problem if other people encounter the same
thing.<BR><BR>What kind of data are you trying to load? Depending on the
type of your data, you might want to try loading it using one of the
subclasses of vtkImageReader2. These readers can handle 3D data by reading
in a series of 2D slices.<BR><BR>- Amy<BR><BR>At 02:32 PM 4/5/2004, Vetria
Byrd wrote:<BR><BR><FONT face=arial color=#000080 size=2>When I try creating
an instance of vtkVolume16Reader the code complies with no errors but when I
try to run it I get:<BR> <BR>ERROR: In C:\Program
Files\vtk42\IO\vtkVolume16Reader.cxx, line 375<BR>vtkVolume16Reader
(0x022B5400): Error reaading raw pgm data!<BR> <BR>So, I thought I
would try vtkVolumeReader.<BR> <BR>Vetria<BR> <BR></FONT><FONT
face=tahoma size=2>-----Original Message-----<BR><B>From:</B> Amy Henderson
[<A href="mailto:amy.henderson@kitware.com"
eudora="autourl">mailto:amy.henderson@kitware.com</A>] <BR><B>Sent:</B>
Monday, April 05, 2004 12:14 PM<BR><B>To:</B> byrdv@cis.uab.edu; 'Amy
Henderson'<BR><B>Subject:</B> RE: [vtkusers]
vtkVolumeReader<BR></FONT> <BR>Did you intend to create an instance of
vtkVolume16Reader? vtkVolumeReader has a pure virtual method, so you can't
instantiate it; you have to create an instance of one of its concrete
subclasses (e.g., vtkVolume16Reader, which I see in your list of include
files).<BR><BR>- Amy<BR><BR>At 01:08 PM 4/5/2004, Vetria Byrd
wrote:<BR><BR><FONT face=arial color=#000080 size=2>Yes.<BR> <BR>Here’s
the entire file:<BR> <BR>//<BR>// This example reads a volume dataset,
extracts an isosurface and displays it.<BR>//<BR> <BR>#include
"vtkRenderer.h"<BR>#include "vtkRenderWindow.h"<BR>#include
"vtkRenderWindowInteractor.h"<BR>#include "vtkVolume16Reader.h"<BR>#include
"vtkVolumeReader.h"<BR>#include "vtkObject.h"<BR>#include
"vtkMarchingCubes.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/cube/slice" <<
endl;<BR> return 1;<BR>
}<BR> <BR> <BR> vtkRenderer *ren =
vtkRenderer::New();<BR> vtkRenderWindow *renWin =
vtkRenderWindow::New();<BR>
renWin->AddRenderer(ren);<BR> vtkRenderWindowInteractor *iren =
vtkRenderWindowInteractor::New();<BR>
iren->SetRenderWindow(renWin);<BR> <BR> *vtkVolumeReader
*volReader = vtkVolumeReader::New();<BR>
volReader->SetImageRange (1,5);<BR>
volReader->SetFilePrefix (argv[1]);<BR>
volReader->SetDataSpacing (1,1,1);<BR>
volReader->Update();<BR> <BR> // An isosurface, or contour
value of 1 is known to correspond to the object. <BR> vtkMarchingCubes
*iso =vtkMarchingCubes::New();<BR>
iso->SetInput(volReader->GetOutput() );<BR>
iso->SetValue(0,1); <BR> <BR> vtkPolyDataMapper
*isoMapper = vtkPolyDataMapper::New();<BR>
isoMapper->SetInput(iso->GetOutput()
);<BR>
isoMapper->ScalarVisibilityOff();<BR>
<BR> vtkActor *isoActor =
vtkActor::New();<BR>
isoActor->SetMapper(isoMapper);<BR> <BR> vtkOutlineFilter
*outline = vtkOutlineFilter::New();<BR>
outline->SetInput( (vtkDataSet *) volReader->GetOutput()
);<BR> <BR> vtkPolyDataMapper
*outlineMapper = vtkPolyDataMapper::New();<BR>
outlineMapper->SetInput(outline->GetOutput() );<BR>
<BR> vtkActor *outlineActor =
vtkActor::New();<BR>
outlineActor->SetMapper(outlineMapper);<BR>
outlineActor->VisibilityOff();<BR>
<BR> //<BR> // Add the actors to the renderer, set
the background and size<BR> //<BR>
ren->AddActor(outlineActor);<BR>
ren->AddActor(isoActor);<BR>
ren->SetBackground(0.2,0.3,0.4);<BR>
renWin->SetSize(450,450);<BR>
ren->GetActiveCamera()->Elevation(90);<BR>
ren->GetActiveCamera()->SetViewUp(0,0,-1);<BR>
<BR> iren->Initialize();<BR> <BR> //
render the image<BR> iren->Start();<BR>
<BR> <BR> return 0;<BR>}<BR> <BR></FONT><FONT
face=tahoma size=2>-----Original Message-----<BR><B>From:</B> Amy Henderson
[<A href="mailto:amy.henderson@kitware.com"
eudora="autourl">mailto:amy.henderson@kitware.com</A>] <BR><B>Sent:</B>
Monday, April 05, 2004 11:59 AM<BR><B>To:</B> byrdv@cis.uab.edu;
'vtkusers'<BR><B>Subject:</B> Re: [vtkusers]
vtkVolumeReader<BR></FONT> <BR>Vetria,<BR><BR>Did you include the
vtkVolumeReader header file (#include "vtkVolumeReader.h")?<BR><BR>-
Amy<BR><BR>At 12:47 PM 4/5/2004, Vetria Byrd wrote:<BR><BR><FONT face=arial
size=2>I have manually created data files that consists of zero’s and one’s
(no header info) to resemble a (5x5x5) 3D cube.<BR>There are 5 data
files. When I try to use vtkVolumeReader I get the following error
message:<BR> <BR>error C2440: 'initializing' : cannot convert from
'class vtkObject *' to 'class vtkVolumeReader
*'<BR> Types pointed to are
unrelated; conversion requires reinterpret_cast, C-style cast or
function-style cast<BR> <BR>This is where the error
occurs:<BR>:<BR>:<BR> <BR> vtkVolumeReader *volReader =
vtkVolumeReader::New();<BR> volReader->SetImageRange
(1,5);<BR> volReader->SetFilePrefix
(argv[1]);<BR> volReader->SetDataSpacing
(1,1,1);<BR> volReader->Update();<BR> <BR>Any
assistance will be greatly
appreciated.<BR>Thanks,<BR>_______________<BR>Vetria L.
Byrd<BR></FONT> <BR> </BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>