vtkVoxelModeller and vtkStructuredPointsWriter

Bill Lorensen wlorens1 at nycap.rr.com
Sat Feb 19 16:14:00 EST 2000


Thanks for the bug report.

This was badly broken after 2.4. I have checked in changes for both
vtkDataReader and vtkDataWriter. To repair your 2.4, try the following:

vtkDataWriter:
  change s = ((vtkBitArray *)data)->GetValue(i);
to s = ((vtkBitArray *)data)->GetValue(idx);

Add the else clause below:
if ( !((idx+1)%8) )
{
*fp << "\n";
}
   else
  {
*fp << " ";
}

vtkDataReader
     if ( ! strncmp(type, "int", 3) ) -> if ( ! strncmp(type, "bit", 3) )
in ReadArray handling for bit arrays.

I've modified a test script to check for this.

Bill



At 10:43 AM 2/18/00 +0100, Miguel Angel Martin Fernandez wrote:
>Hello vtk  users,
>
>         I'm trying to write the output of the filter vtkVoxelModeller and
>I only obtain 0's. I'm using VTK 2.4 (with VTK 2.0 it worked properly).
>
>The tcl program is basically the next:
>
>------------------------------
>vtkSphereSource sphereModel
>
>vtkVoxelModeller voxelModel
>   voxelModel SetInput [sphereModel GetOutput]
>   voxelModel SetSampleDimensions 21 21 21
>
>vtkStructuredPointsWriter writer
>   writer SetFileName prueba.vtk
>   writer SetInput [voxelModel GetOutput]
>   writer Write
>------------------------------
>
>The file obtained is the next:
>
># vtk DataFile Version 2.0
>vtk output
>ASCII
>DATASET STRUCTURED_POINTS
>DIMENSIONS 21 21 21
>SPACING 0.14924 0.14683 0.15
>ORIGIN -1.4924 -1.4683 -1.5
>POINT_DATA 9261
>SCALARS scalars int 1
>LOOKUP_TABLE default
>0 0 0 0 0 0 
>0 0 0 0 0 0 
>... (skip)
>0 0 0 0 0 0
>
>         Do you know what is wrong?
>
>         Thanx in advance.
>
>         Miguel.
>
>             ________________________________________________________
>   _________(_                                                      _)_________
>   \········(_   Miguel Ángel Martín Fernández                      _)········/
>    \·······(_   ETSI Telecomunicación, Universidad de Valladolid   _)·······/
>     \······(_   Campus Miguel Delibes, Camino del Cementerio, s/n  _)······/
>      )·····(_   e-mail: miguel at atenea.tel.uva.es                   _)·····(
>     /······(_   Tfno: +34-983-423000 Ext. 25548                    _)······\
>    /·······(________________________________________________________)·······\
>   /__________)                                                 (_____________\
>                                                         
>


--------------------------------------------------------------------
This is the private VTK discussion list. Please keep messages on-topic.
Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at public.kitware.com>. For help, send message body containing
"info vtkusers" to the same address.
--------------------------------------------------------------------



More information about the vtkusers mailing list