[vtkusers] large datasets getscalarpointer

C Heinzl C.Heinzl at fh-wels.at
Thu Apr 7 09:51:26 EDT 2005


Hi VTK grandmasters,

I recently experienced a problem which occured on reading large datasets. The sample code attached is the way I normally read CT data files. It's workin fine but when I try to load a dataset which exeeds ~1,5gigs the getscalarpointer function just returns 0x00000000 and so fread returns false. The Dimensions of my datasets are: 1005*1005*748 or even bigger...

	// 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;

I think for you that's a pretty simple problem but I'm a newbie to vtk hoping that a VTK guru can give me a clue.
Thanx in advance! 
Chris




More information about the vtkusers mailing list