[vtkusers] Large datasets with vtkImageReader file seek error

Sean Larkin sean.larkin at lickenbrocktech.com
Wed Apr 9 12:03:55 EDT 2014


Hello,
I am using vtkImageReader along with vtkImageReslice and
vtkImageDataStreamer to load a large dataset into my application.  I am
running vtk 6.2 with Windows 6 64-bit.  I have not figured out what exact
size data file causes the file seek error messages, but the data I am
working with is 604x2275x2467 of uchar.  When I try to read the entire file,
I get a "file operation failed" message from the "int
vtkImageReader::OpenAndSeekFile(int dataExtent[6], int idx)"  function at
line 181 in vtkImageReader.cxx.  It appears as though it is calculating the
header size incorrectly.  This data is just a raw data file with no header.
If I manually set the header size to 0 I can get it to read an extent of the
data.  For instance I can read an extent of [0 603 0 2274 0 999] and the
volume reads correctly and displays correctly.  If I attemp to read [0 603 0
2274 0 1999], i.e. twice as much data, I get a number of file operation
error messages, and a portion of the data is read correctly.  And some of
the data is completely mangled in the display.   
I have a theory about the problem.  I see that vtkImageReader uses unsigned
long data type to a number of file position and data increment variables.
On my machine this data type is 32 bits.  So, potentially I could be seeing
wrap around or something to that effect.  I could go around vtkImageReader
and vtkImageReader2 and change these variables to unsigned long long, but I
want to see if anyone else has seen this issue before I try it.  Does anyone
know of a problem similar to this or have any suggestions to help me
diagnose it?

Thanks,
Sean




More information about the vtkusers mailing list