[vtkusers] BMPReader

Luke Hetrick lhetrick at nnu.edu
Tue Jun 19 15:33:00 EDT 2012


Hello,

    I am trying to figure out how to get the vtkBMPReader to bring in
multiple bmp 2D images all at once. My plan is to create something very
similar to the program in the Examples/Medical/Cxx/Medical1.cxx but instead
of using the vtkVolume16Reader, I need to use the vtkBMPReader
instead...here is a bit of code from the example I mentioned that I need to
alter:

  // The following reader is used to read a series of 2D slices (images)
  // that compose the volume. The slice dimensions are set, and the
  // pixel spacing. The data Endianness must also be specified. The reader
  // uses the FilePrefix in combination with the slice number to construct
  // filenames using the format FilePrefix.%d. (In this case the FilePrefix
  // is the root name of the file: quarter.)
  vtkSmartPointer<vtkVolume16Reader> v16 =
    vtkSmartPointer<vtkVolume16Reader>::New();
  v16->SetDataDimensions (64,64);
  v16->SetImageRange (1,93);
  v16->SetDataByteOrderToLittleEndian();
  v16->SetFilePrefix (argv[1]);
  v16->SetDataSpacing (3.2, 3.2, 1.5);

If I could read in all the files, I could feed the output into  a contour
filter and extract some isosurfaces to view and process. Can someone help
me figure this outt?

Thank you for your help and time,
Luke H
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120619/86acd398/attachment.htm>


More information about the vtkusers mailing list