I'm trying to get my head around how the Volume module is working.  I saw in
the documentation that the module requires the scalar data to be either
chars or shorts (Is that right?  What is the reason for this restriction?).

So in the interest of just getting something pretty on my screen, I create
some data with the following script:

-- <mkdata.py> --
#! /usr/bin/env python

import vtk

points = vtk.vtkPoints()
for z in xrange(3):
    for y in xrange(3):
        for x in xrange(3):
            points.InsertNextPoint(x, y, z)

vals = vtk.vtkShortArray()
vals.SetName('simple')
for i in xrange(27):
    vals.InsertNextValue(i + 1)

sg = vtk.vtkStructuredGrid()
sg.SetPoints(points)
sg.GetPointData().SetScalars(vals)

w = vtk.vtkXMLStructuredGridWriter()
w.SetFileName('simple_cube.vts')
w.SetInput(sg)

w.Write()
-- </mkdata.py> --

I run the script and I get the following ".vts" file:

-- <simple_cube.vts> --
<?xml version="1.0"?>
<VTKFile type="StructuredGrid" version="0.1" byte_order="LittleEndian"
compressor="vtkZLibDataCompressor">
  <StructuredGrid WholeExtent="0 -1 0 -1 0 -1">
    <Piece Extent="0 -1 0 -1 0 -1">
      <PointData Scalars="simple">
        <DataArray type="Int16" Name="simple" format="appended"
offset="0"                   />
      </PointData>
      <CellData>
      </CellData>
      <Points>
        <DataArray type="Float32" NumberOfComponents="3" format="appended"
offset="88"                  />
      </Points>
    </Piece>
  </StructuredGrid>
  <AppendedData encoding="base64">
 
_AQAAAACAAAA2AAAALwAAAA==eJwFwYcBQDAAALCYpWZR8/8/JYVSpdZoBZ1eNBhNZotVstkdstPl9nh9fhzCAXs=AQAAAACAAABEAQAARAAAAA==eJxjYEAGDfZIHAcGrHIgGq7OAbsesJgDkhgWs5DNQ9GHJI+MYXah240sB7ML3U3IelDcxYDFbGQz0PyALI/AAJqqGuY=
  </AppendedData>
</VTKFile>
-- </simple_cube.vts> --

I apologize for including this inline.  I know it's a mess, but I couldn't
remember if this list accepts attachments or not.

So anyway, I use the following command to bring up MayaVi:

mayavi -d simple_cube.vts -m Volume

and I get the following garbage printed to my shell screen (along with a
very empty MayaVi visualization window):

-- <run.log> --
ERROR:
In /volume80/ror/swl-mini/x86_64-linux/tmp/vtk-5.0.1/Common/vtkLookupTable.cxx,
line 84
vtkLookupTable (0xaec8d0): Bad table range: [1e+299, -1e+299]

ERROR:
In 
/volume80/ror/swl-mini/x86_64-linux/tmp/vtk-5.0.1/VolumeRendering/vtkVolumeMapper.cxx,
line 83
vtkVolumeRayCastMapper (0xb33090): The SetInput method of this mapper
requires vtkImageData as input

ERROR:
In 
/volume80/ror/swl-mini/x86_64-linux/tmp/vtk-5.0.1/VolumeRendering/vtkVolumeMapper.cxx,
line 83
vtkVolumeRayCastMapper (0xb33090): The SetInput method of this mapper
requires vtkImageData as input

ERROR:
In /volume80/ror/swl-mini/x86_64-linux/tmp/vtk-5.0.1/Common/vtkLookupTable.cxx,
line 84
vtkLookupTable (0xb4e670): Bad table range: [1e+299, -1e+299]

ERROR:
In 
/volume80/ror/swl-mini/x86_64-linux/tmp/vtk-5.0.1/Filtering/vtkDemandDrivenPipeline.cxx,
line 710
vtkStreamingDemandDrivenPipeline (0xb4f870): Input port 0 of algorithm
vtkVolumeRayCastMapper(0xb33090) has 0 connections but is not optional.

ERROR:
In 
/volume80/ror/swl-mini/x86_64-linux/tmp/vtk-5.0.1/Filtering/vtkDemandDrivenPipeline.cxx,
line 710
vtkStreamingDemandDrivenPipeline (0xb4f870): Input port 0 of algorithm
vtkVolumeRayCastMapper(0xb33090) has 0 connections but is not optional.

ERROR:
In 
/volume80/ror/swl-mini/x86_64-linux/tmp/vtk-5.0.1/Filtering/vtkDemandDrivenPipeline.cxx,
line 710
vtkStreamingDemandDrivenPipeline (0xb4f870): Input port 0 of algorithm
vtkVolumeRayCastMapper(0xb33090) has 0 connections but is not optional.

ERROR:
In 
/volume80/ror/swl-mini/x86_64-linux/tmp/vtk-5.0.1/Filtering/vtkDemandDrivenPipeline.cxx,
line 710
vtkStreamingDemandDrivenPipeline (0xb4f870): Input port 0 of algorithm
vtkVolumeRayCastMapper(0xb33090) has 0 connections but is not optional.

ERROR:
In 
/volume80/ror/swl-mini/x86_64-linux/tmp/vtk-5.0.1/Filtering/vtkDemandDrivenPipeline.cxx,
line 710
vtkStreamingDemandDrivenPipeline (0xb4f870): Input port 0 of algorithm
vtkVolumeRayCastMapper(0xb33090) has 0 connections but is not optional.

ERROR:
In 
/volume80/ror/swl-mini/x86_64-linux/tmp/vtk-5.0.1/Filtering/vtkDemandDrivenPipeline.cxx,
line 710
vtkStreamingDemandDrivenPipeline (0xb4f870): Input port 0 of algorithm
vtkVolumeRayCastMapper(0xb33090) has 0 connections but is not optional.

ERROR:
In 
/volume80/ror/swl-mini/x86_64-linux/tmp/vtk-5.0.1/Filtering/vtkDemandDrivenPipeline.cxx,
line 710
vtkStreamingDemandDrivenPipeline (0xb4f870): Input port 0 of algorithm
vtkVolumeRayCastMapper(0xb33090) has 0 connections but is not optional.

ERROR:
In 
/volume80/ror/swl-mini/x86_64-linux/tmp/vtk-5.0.1/Filtering/vtkDemandDrivenPipeline.cxx,
line 710
vtkStreamingDemandDrivenPipeline (0xb4f870): Input port 0 of algorithm
vtkVolumeRayCastMapper(0xb33090) has 0 connections but is not optional.

ERROR:
In 
/volume80/ror/swl-mini/x86_64-linux/tmp/vtk-5.0.1/Filtering/vtkDemandDrivenPipeline.cxx,
line 710
vtkStreamingDemandDrivenPipeline (0xb4f870): Input port 0 of algorithm
vtkVolumeRayCastMapper(0xb33090) has 0 connections but is not optional.
-- </run.log>

So can anybody tell me what I'm doing wrong?  Like I said, my visualization
window is blank, so something is definitely going awry.  I just don't have
enough experience with MayaVi's volume visualization to diagnose this
problem.

Many thanks in advance.

-- 
Steve Juranich
Tucson, AZ
USA


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
MayaVi-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mayavi-users

Reply via email to