[vtkusers] large datasets
C Heinzl
C.Heinzl at fh-wels.at
Mon Apr 18 02:13:43 EDT 2005
Hi VTK users,
I still have a problem reading large datasets. The sample code attached is the way I normally read CT data files. It's working fine but when I try to load datasets exeeding ~1,5gigs the getscalarpointer function just returns 0x00000000 and so fread returns false. The Dimensions of my datasets of our industrial CT are: 1005*1005*748 or even bigger. You can try the sample code and enter the dimensions 1000*1000*1000 manually.
// dataset
pDataSet = vtkImageData::New();
pDataSet->SetDimensions(m_Size.SX, m_Size.SY, m_Size.SZ);
pDataSet->SetScalarType(VTK_UNSIGNED_SHORT);
pDataSet->SetNumberOfScalarComponents(1);
pDataSet->AllocateScalars();
pDataSet->SetSpacing(1.0, 1.0, 1.0);
ptr = (unsigned short*)m_pDataSet->GetScalarPointer();
// and read it...
if (!fread(ptr, m_Size.SX*m_Size.SY*m_Size.SZ*sizeof(unsigned short), 1, file))
return FALSE;
Is there a better way to read large datasets? I would appreciate any clue.
Thanx in advance!
Chris
More information about the vtkusers
mailing list