[vtkusers] CT image scalars
X. Chi
vtk_chi at hotmail.com
Tue Sep 30 11:25:02 EDT 2003
Hi, all
I have a question on CT image scalars. I was trying to get the scalars from
image data once I read it in my program. The following is the code:
vtkVolume16Reader *v16 = vtkVolume16Reader::New();
v16->SetDataDimensions (64,64);
v16->SetImageRange (1,93);
v16->SetDataByteOrderToLittleEndian();
v16->SetFilePrefix ("headsq/quarter");
v16->SetDataSpacing (3.2, 3.2, 1.5);
vtkImageData *id = vtkImageData::New();
id=v16->GetOutput();
for(int i=0; i<64; i++)
for(int j=0; j<64; j++)
printf("show scalars:%f\n", id->GetScalarComponentAsFloat(j, i, 32, 0));
After the testing, the program printed out all the scalars are zero.
Could anybody tell me what the problem is? Thank you for your help.
Chi
_________________________________________________________________
Instant message during games with MSN Messenger 6.0. Download it now FREE!
http://msnmessenger-download.com
More information about the vtkusers
mailing list