VolHeader Class Reference

Header for the Vol format file. More...

#include <VolHeader.H>

List of all members.

Public Member Functions

 VolHeader (const size_t width, const size_t height, const size_t depth)
 Everything accept dimensions set to defaults.
 VolHeader (const size_t width, const size_t height, const size_t depth, const size_t bitsPerVoxel, const float scaleX, const float scaleY, const float scaleZ, const float rotX, const float rotY, const float rotZ)
 VolHeader (const std::string filename, bool &ok)
 Read a volume header from a file.
size_t write (FILE *outFile)
 Use fwrite to put out the header.
uint32_t getMagicNumber () const
 Return value in host byte order.
uint32_t getHeaderLength () const
 Return value in host byte order.
uint32_t getWidth () const
 Return in host byte order.
uint32_t getHeight () const
 Return in host byte order.
uint32_t getImages () const
 Return in host byte order.
uint32_t getBitsPerVoxel () const
 Return in host byte order.
uint32_t getIndexBits () const
 Return in host byte order.
float getScaleX () const
 Return in host byte order.
float getScaleY () const
 Return in host byte order.
float getScaleZ () const
 Return in host byte order.
float getRotX () const
 Return in host byte order.
float getRotY () const
 Return in host byte order.
float getRotZ () const
 Return in host byte order.
size_t getDataSize () const
 How many bytes do we expect of data in the vol file?
void setMagicNumber (const size_t v)
 DANGER DANGER.
void setHeaderLength (const size_t v)
 DANGER DANGER DANGER.
void setWidth (const size_t v)
 Do you really know what you are doing here?
void setHeight (const size_t v)
 I hope your data is the right size!
void setImages (const size_t v)
 How many do you want?
void setBitsPerVoxel (const size_t v)
 True??? FIX: this plus index bits should be a multiple of 8.
void setIndexBits (const size_t v)
 True??? FIX: this plus bpv bits should be a multiple of 8.
void setScaleX (const float v)
 Should be safe to do this.
void setScaleY (const float v)
 Should be safe to do this.
void setScaleZ (const float v)
 Should be safe to do this.
void setRotX (const float v)
 Should be safe to do this. Value in radians.
void setRotY (const float v)
 Should be safe to do this. Value in radians.
void setRotZ (const float v)
 Should be safe to do this. Value in radians.

Static Public Member Functions

static size_t requiredSize ()
 This is the expected size of the header.
static uint32_t hMagicNum ()
 Host byte order magic number.
static uint32_t nMagicNum ()
 Network byte order magic number - what goes in the file.

Private Attributes

uint32_t magic_number
 hton_uint32(0x0b7e7759)
uint32_t header_length
 This had better be the same as sizeof(VolHeader).
uint32_t width
 Width in cells/pixels in the x direction. How many cells wide?
uint32_t height
 Height in cells/pixels in the y direction.
uint32_t images
 Depth in cells/pixels in the z direction.
uint32_t bits_per_voxel
uint32_t index_bits
 FIX does the bug tag not work? bug Do not know what to do with index bits.
float scaleX
 Scale the model in the x-axis. Usually 1.0.
float scaleY
float scaleZ
float rotX
 You could rotate this model here.
float rotY
float rotZ


Detailed Description

Header for the Vol format file.

Same definition as in raw2vol.C

http://doc.coin3d.org/SIMVoleon/classSoVRVolFileReader.html

This is kind of close:

http://www.cs.purdue.edu/homes/sun/Teach/530_01S/Assignments/Data/FORMAT.TXT/// Stores data internally in host byte order


Constructor & Destructor Documentation

VolHeader::VolHeader const size_t  width,
const size_t  height,
const size_t  depth
 

Everything accept dimensions set to defaults.

VolHeader::VolHeader const size_t  width,
const size_t  height,
const size_t  depth,
const size_t  bitsPerVoxel,
const float  scaleX,
const float  scaleY,
const float  scaleZ,
const float  rotX,
const float  rotY,
const float  rotZ
 

VolHeader::VolHeader const std::string  filename,
bool &  ok
 

Read a volume header from a file.

Parameters:
filename File to read from
ok Passes back true if file read ok


Member Function Documentation

uint32_t VolHeader::getBitsPerVoxel  )  const
 

Return in host byte order.

size_t VolHeader::getDataSize  )  const
 

How many bytes do we expect of data in the vol file?

uint32_t VolHeader::getHeaderLength  )  const
 

Return value in host byte order.

uint32_t VolHeader::getHeight  )  const
 

Return in host byte order.

uint32_t VolHeader::getImages  )  const
 

Return in host byte order.

uint32_t VolHeader::getIndexBits  )  const
 

Return in host byte order.

uint32_t VolHeader::getMagicNumber  )  const
 

Return value in host byte order.

float VolHeader::getRotX  )  const
 

Return in host byte order.

float VolHeader::getRotY  )  const
 

Return in host byte order.

float VolHeader::getRotZ  )  const
 

Return in host byte order.

float VolHeader::getScaleX  )  const
 

Return in host byte order.

float VolHeader::getScaleY  )  const
 

Return in host byte order.

float VolHeader::getScaleZ  )  const
 

Return in host byte order.

uint32_t VolHeader::getWidth  )  const
 

Return in host byte order.

static uint32_t VolHeader::hMagicNum  )  [inline, static]
 

Host byte order magic number.

static uint32_t VolHeader::nMagicNum  )  [inline, static]
 

Network byte order magic number - what goes in the file.

static size_t VolHeader::requiredSize  )  [inline, static]
 

This is the expected size of the header.

void VolHeader::setBitsPerVoxel const size_t  v  )  [inline]
 

True??? FIX: this plus index bits should be a multiple of 8.

void VolHeader::setHeaderLength const size_t  v  )  [inline]
 

DANGER DANGER DANGER.

void VolHeader::setHeight const size_t  v  )  [inline]
 

I hope your data is the right size!

void VolHeader::setImages const size_t  v  )  [inline]
 

How many do you want?

void VolHeader::setIndexBits const size_t  v  )  [inline]
 

True??? FIX: this plus bpv bits should be a multiple of 8.

void VolHeader::setMagicNumber const size_t  v  )  [inline]
 

DANGER DANGER.

void VolHeader::setRotX const float  v  )  [inline]
 

Should be safe to do this. Value in radians.

void VolHeader::setRotY const float  v  )  [inline]
 

Should be safe to do this. Value in radians.

void VolHeader::setRotZ const float  v  )  [inline]
 

Should be safe to do this. Value in radians.

void VolHeader::setScaleX const float  v  )  [inline]
 

Should be safe to do this.

void VolHeader::setScaleY const float  v  )  [inline]
 

Should be safe to do this.

void VolHeader::setScaleZ const float  v  )  [inline]
 

Should be safe to do this.

void VolHeader::setWidth const size_t  v  )  [inline]
 

Do you really know what you are doing here?

size_t VolHeader::write FILE *  outFile  ) 
 

Use fwrite to put out the header.

Returns:
Returns the number of bytes written


Member Data Documentation

uint32_t VolHeader::bits_per_voxel [private]
 

We are only going to support 8 for now!

uint32_t VolHeader::header_length [private]
 

This had better be the same as sizeof(VolHeader).

uint32_t VolHeader::height [private]
 

Height in cells/pixels in the y direction.

uint32_t VolHeader::images [private]
 

Depth in cells/pixels in the z direction.

uint32_t VolHeader::index_bits [private]
 

FIX does the bug tag not work? bug Do not know what to do with index bits.

What are index bits for?

uint32_t VolHeader::magic_number [private]
 

hton_uint32(0x0b7e7759)

float VolHeader::rotX [private]
 

You could rotate this model here.

float VolHeader::rotY [private]
 

float VolHeader::rotZ [private]
 

float VolHeader::scaleX [private]
 

Scale the model in the x-axis. Usually 1.0.

float VolHeader::scaleY [private]
 

float VolHeader::scaleZ [private]
 

uint32_t VolHeader::width [private]
 

Width in cells/pixels in the x direction. How many cells wide?


The documentation for this class was generated from the following files:
Generated on Thu Mar 2 17:55:26 2006 for density by  doxygen 1.4.6