[vtkusers] Weird problems with my volume reader...

Charles Boivin Charles.Boivin at rwdiwest.com
Thu Oct 14 17:49:25 EDT 2004


Hello,

I am currently in the process of writing a volume reader for my own
type of data. The data is on a structured cartesian grid, and is all
stored in one file. I decided to base my reader on the vtkVolume16Reader
so I, too, derived a class from vtkVolumeReader.

Now, this is my first try with 3D structured data, so I am still not
too familiar with the process. I have previously written readers for
vtkPolyData data structures, and things went well there. First thing I
noticed is that, for my previous reader, most of the work was done in
the Execute() member function. For the volume reader, there seems to be
both a ExecuteInformation() and a ExecuteData() functions. I read the
description of my file and data is ExecuteInformation() and read the
actual data from disk in ExecuteData(). Is this what should be done?

I believe the data gets read properly because I am somehow able to
display some of it, and it looks alright. However, there is some strange
behavior that I am not quite sure how to fix. First of all, the data
seems to be read *several* times before it is displayed. ExecuteData()
is called about 2-3 times before the first display, and then, if I
change the array I want displayed, the data is read once more. Should I
be setting some flag saying that the data has been read? That seemed to
be taken care of automatically in the vtkPolyData reader I wrote before
(I derived that one from vtkPolyDataSource).. is this a case where the
volume reader behave differently?

There is also one last strange behavior: I load 7 different scalars in
my data, and stored them the same way I would store point data in the
vtkPolyData reader. The *order* of the scalars seems to change once I
pass the output to my filters, however. The last array now seems to be
the first one, with all other arrays being shifted on spot. As anyone
seen such a behavior before, and if so, could they provide some hints as
to where things might be going wrong? I can provide some sample code if
necessary, but I figured this email was already long enough as it is...
I am trying to see if some of you have experienced these problems before
and if so, what you did to fix them.

Many thanks in advance,

Charles Boivin




More information about the vtkusers mailing list