<!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>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=172503302-06042004>I noticed in VTK we 
can&nbsp;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>&nbsp;</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>&nbsp;</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>&nbsp;</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 &#8211; one for each slice) consists of zero&#8217;s and one&#8217;s where the one&#8217;s 
    indicate there is an object in that particular cell of the cube, zero&#8217;s 
    indicate the cell is empty.&nbsp; I want to render the cube/object using the 
    marching cubes algorithm.<BR>&nbsp;</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>&nbsp;<BR>&nbsp;<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">&nbsp;<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>&nbsp;<BR>ERROR: In C:\Program 
    Files\vtk42\IO\vtkVolume16Reader.cxx, line 375<BR>vtkVolume16Reader 
    (0x022B5400): Error reaading raw pgm data!<BR>&nbsp;<BR>So, I thought I 
    would try vtkVolumeReader.<BR>&nbsp;<BR>Vetria<BR>&nbsp;<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>&nbsp;<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>&nbsp;<BR>Here&#8217;s 
    the entire file:<BR>&nbsp;<BR>//<BR>// This example reads a volume dataset, 
    extracts an isosurface and displays it.<BR>//<BR>&nbsp;<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>&nbsp;<BR>int 
    main (int argc, char **argv)<BR>{<BR>&nbsp; if (argc &lt; 
    2)<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cout &lt;&lt; 
    "Usage: " &lt;&lt; argv[0] &lt;&lt; " DATADIR/cube/slice" &lt;&lt; 
    endl;<BR>&nbsp;&nbsp;&nbsp; return 1;<BR>&nbsp;&nbsp;&nbsp; 
    }<BR>&nbsp;<BR>&nbsp;<BR>&nbsp; vtkRenderer *ren = 
    vtkRenderer::New();<BR>&nbsp; vtkRenderWindow *renWin = 
    vtkRenderWindow::New();<BR>&nbsp;&nbsp;&nbsp; 
    renWin-&gt;AddRenderer(ren);<BR>&nbsp; vtkRenderWindowInteractor *iren = 
    vtkRenderWindowInteractor::New();<BR>&nbsp;&nbsp;&nbsp; 
    iren-&gt;SetRenderWindow(renWin);<BR>&nbsp; <BR>&nbsp;*vtkVolumeReader 
    *volReader = vtkVolumeReader::New();<BR>&nbsp;&nbsp;&nbsp; 
    volReader-&gt;SetImageRange (1,5);<BR>&nbsp;&nbsp;&nbsp; 
    volReader-&gt;SetFilePrefix (argv[1]);<BR>&nbsp;&nbsp;&nbsp; 
    volReader-&gt;SetDataSpacing (1,1,1);<BR>&nbsp;&nbsp;&nbsp; 
    volReader-&gt;Update();<BR>&nbsp;<BR>&nbsp; // An isosurface, or contour 
    value of 1 is known to correspond to the object. <BR>&nbsp; vtkMarchingCubes 
    *iso =vtkMarchingCubes::New();<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
    iso-&gt;SetInput(volReader-&gt;GetOutput() );<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
    iso-&gt;SetValue(0,1);&nbsp; <BR>&nbsp;<BR>&nbsp; vtkPolyDataMapper 
    *isoMapper = vtkPolyDataMapper::New();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    isoMapper-&gt;SetInput(iso-&gt;GetOutput() 
    );<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    isoMapper-&gt;ScalarVisibilityOff();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    <BR>&nbsp; vtkActor *isoActor = 
    vtkActor::New();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    isoActor-&gt;SetMapper(isoMapper);<BR>&nbsp; <BR>&nbsp; vtkOutlineFilter 
    *outline = vtkOutlineFilter::New();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    outline-&gt;SetInput( (vtkDataSet *) volReader-&gt;GetOutput() 
    );<BR>&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp; vtkPolyDataMapper 
    *outlineMapper = vtkPolyDataMapper::New();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    outlineMapper-&gt;SetInput(outline-&gt;GetOutput() );<BR>&nbsp;&nbsp; 
    <BR>&nbsp;&nbsp; vtkActor *outlineActor = 
    vtkActor::New();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    outlineActor-&gt;SetMapper(outlineMapper);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    outlineActor-&gt;VisibilityOff();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    <BR>&nbsp;&nbsp; //<BR>&nbsp;&nbsp; // Add the actors to the renderer, set 
    the background and size<BR>&nbsp;&nbsp; //<BR>&nbsp;&nbsp; 
    ren-&gt;AddActor(outlineActor);<BR>&nbsp;&nbsp; 
    ren-&gt;AddActor(isoActor);<BR>&nbsp;&nbsp; 
    ren-&gt;SetBackground(0.2,0.3,0.4);<BR>&nbsp;&nbsp; 
    renWin-&gt;SetSize(450,450);<BR>&nbsp;&nbsp; 
    ren-&gt;GetActiveCamera()-&gt;Elevation(90);<BR>&nbsp;&nbsp; 
    ren-&gt;GetActiveCamera()-&gt;SetViewUp(0,0,-1);<BR>&nbsp;&nbsp; 
    <BR>&nbsp;&nbsp; iren-&gt;Initialize();<BR>&nbsp;&nbsp; <BR>&nbsp;&nbsp; // 
    render the image<BR>&nbsp;&nbsp; iren-&gt;Start();<BR>&nbsp;&nbsp; 
    <BR>&nbsp;<BR>&nbsp;&nbsp; return 0;<BR>}<BR>&nbsp;<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>&nbsp;<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&#8217;s and one&#8217;s 
    (no header info) to resemble a (5x5x5) 3D cube.<BR>There are 5 data 
    files.&nbsp; When I try to use vtkVolumeReader I get the following error 
    message:<BR>&nbsp;<BR>error C2440: 'initializing' : cannot convert from 
    'class vtkObject *' to 'class vtkVolumeReader 
    *'<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Types pointed to are 
    unrelated; conversion requires reinterpret_cast, C-style cast or 
    function-style cast<BR>&nbsp;<BR>This is where the error 
    occurs:<BR>:<BR>:<BR>&nbsp;<BR>&nbsp; vtkVolumeReader *volReader = 
    vtkVolumeReader::New();<BR>&nbsp;&nbsp;&nbsp; volReader-&gt;SetImageRange 
    (1,5);<BR>&nbsp;&nbsp;&nbsp; volReader-&gt;SetFilePrefix 
    (argv[1]);<BR>&nbsp;&nbsp;&nbsp; volReader-&gt;SetDataSpacing 
    (1,1,1);<BR>&nbsp;&nbsp;&nbsp; volReader-&gt;Update();<BR>&nbsp;<BR>Any 
    assistance will be greatly 
    appreciated.<BR>Thanks,<BR>_______________<BR>Vetria L. 
    Byrd<BR></FONT>&nbsp;<BR>&nbsp;</BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>