[vtkusers] vtkstructuredpoints

cheby wow cheby20 at yahoo.com
Sat Mar 17 06:01:13 EST 2001


Hi,

I'm newbie to vtk.

I'm having assignment to read multiple frame files of raw files.

And I'm using vtkStructuredPoints instead of vtkVolume16Reader, as it caused me a lot of trouble when using vtkVolume16Reader in mfc. Anybody had ever used vtkStructuredPoints only to read multiple frame files? If yes, How to append the data from next file to the previous structuredpoints that had stored the data from the first file?Because I only can get data from one file, it seems the new data overwrite the prev data.

I include part of the function that handle that, could somebody find what cause the  the prob?I really need this urgently, I hope somebody can help me. The function below I repeat it for number of read files times. "Number" is for indicating which slice I read.

 fread(Image,1,datainfo.m_XDim*datainfo.m_YDim,fin);
   fclose(fin);
 
   vtkScalars *scalars=(*StructuredPoints)->GetPointData()->GetScalars();
   scalars->SetDataType(VTK_UNSIGNED_CHAR);

   int i,j,k;

   for(k=Number-1;k<Number;k++)
    for(j=0;j<datainfo.m_YDim;j++)
     for(i=0;i<datainfo.m_XDim;i++)
     {
      scalars->SetScalar(k*(datainfo.m_YDim*datainfo.m_XDim)+j*(datainfo.m_XDim)+i,Image[k*(datainfo.m_YDim*datainfo.m_XDim)+j*(datainfo.m_XDim)+i]);
     }

Thanks a lot,

Cheby



---------------------------------
Do You Yahoo!?
Yahoo! Mail Personal Address - Get email at your own domain with Yahoo! Mail.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20010317/d7dc6796/attachment.htm>


More information about the vtkusers mailing list