Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

BitImage3D< FieldType, bitsPerValue, ValueType > Class Template Reference

Image whose values are a predefined number of bits. More...

#include <BitImage3D.hpp>

Inheritance diagram for BitImage3D< FieldType, bitsPerValue, ValueType >:

Inheritance graph
[legend]
Collaboration diagram for BitImage3D< FieldType, bitsPerValue, ValueType >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef BitImage3DValue< FieldType,
bitsPerValue, ValueType > 
BitValue
typedef BitValue value_type
 So that other templates know.
typedef ValueType Value
typedef BIM3D_iteratorFast<
BitImage3D, BitValue > 
iteratorFast
typedef BIM3D_iteratorXYZ<
BitImage3D, BitValue > 
iteratorXYZ
typedef BIM3D_iteratorZone<
BitImage3D, BitValue > 
iteratorZone
typedef BIM3D_iteratorFast<
const BitImage3D, const BitValue > 
const_iterator
typedef BIM3D_iteratorFast<
const BitImage3D, const BitValue > 
const_iteratorFast
typedef BIM3D_iteratorXYZ<
const BitImage3D, const BitValue > 
const_iteratorXYZ
typedef BIM3D_iteratorZone<
const BitImage3D, const BitValue > 
const_iteratorZone
typedef iterator iteratorFastMasked
typedef const_iterator const_iteratorFastMasked
typedef reverse_iterator<
const_iterator
const_reverse_iterator
typedef reverse_iterator<
iterator > 
reverse_iterator

Public Member Functions

name Begin and end iterating
through an image iteratorFast 
begin ()
 (stl-like) get an iterator positioned at the begining of this container
const_iteratorFast begin () const
iteratorFast end ()
 (stl-like) get an iterator positioned at the end of this container
const_iteratorFast end () const
reverse_iterator rbegin ()
const_reverse_iterator rbegin () const
reverse_iterator rend ()
const_reverse_iterator rend () const
name Accesors to Properties
RectZone3Df
AddSupport (const Vect3Df &p0, const Vect3Df &p1)
RectZone3DfSupport ()
RectZone3Df const & Support () const
name BitImage3D Accesors FieldImage GetData ()
 avoid using this directly :-(
const FieldImage GetData () const
BitValue operator() (int pos)
BitValue operator() (int pos) const
BitValue operator() (int x, int y, int z)
BitValue operator() (int x, int y, int z) const
BitValue operator() (const Vect3Di &v)
BitValue operator() (const Vect3Di &v) const
virtual float FloatValue (int x, int y, int z) const
 This is a way to retreive values when only the base class is known.
name Operators _Self & operator+= (const _Self &im)
 Add voxel by voxel.
_Self & operator+= (const FieldType &scalarValue)
 Add a scalar value to each voxel.
_Self & operator-= (const _Self &im)
 Substract voxel from voxel.
_Self & operator-= (const FieldType &scalarValue)
 Subtract a scalar value from each voxel.
_Self & operator *= (const _Self &im)
 Multiply voxel by voxel.
_Self & operator *= (double scalarValue)
 Multiply each voxel by the same scalar value.
_Self & operator/= (const _Self &im)
 Multiply voxel by voxel.
void Fill (const ValueType &value)
 Sets all elements of the container to this value.
virtual string GetTypeName () const
 Type information, this should always return the result to a call of the TypeName function.
virtual void Read (ImLib3DFile *file, xmlpp::Element *parentNode=NULL, xmlpp::Element *node=NULL)
 This is where all the information is written.
virtual void Write (ImLib3DFile *file, xmlpp::Element *parentNode=NULL, xmlpp::Element *node=NULL) const
 Write this object, either to a current node, a parent node, or the root node of the file.
virtual void WriteToFile (const string &fname) const
 Write the image to file fname: This is the fct the end user should call.
void Resize (const Size3D &newSize)
name Copy and compare operators
_Self & 
operator= (const _Self &other)
template<class OtherImageType>
_Self & operator= (const OtherImageType &other)
bool operator== (const _Self &other) const
bool operator!= (const _Self &other) const
template<class OtherImage>
bool operator== (const OtherImage &other)
template<class OtherImage>
bool operator!= (const OtherImage &other)
BitValue SafeValue (int pos) const
BitValue SafeValue (int x, int y, int z) const
BitValue SafeValue (const Vect3Di &v) const
Constructors and destructors
virtual ~BitImage3D ()
 Destructor.
 BitImage3D (int _width, int _height, int _depth)
 BitImage3D (const string &fname)
 BitImage3D (const char *fname)
 BitImage3D (char *fname)
 BitImage3D (const Size3D &size)
 BitImage3D (const BitImage3D &origCont)

Public Attributes

name Iterator Typedefs typedef
BIM3D_iteratorFast< BitImage3D,
BitValue > 
iterator
iterator imageDataEnd
 one past the last data element (used for iterator end check)
const_iterator const_imageDataEnd

Private Types

typedef BitImage3D< FieldType,
bitsPerValue, ValueType > 
_Self
typedef Container3D< FieldType > FieldImage

Private Member Functions

void Set (size_t vpos, ValueType v)
ValueType Get (size_t vpos) const

Private Attributes

FieldImage imageData
 The actual contained data.
int widthXheight
 Speedup.

Friends

class BitImage3DValue< FieldType, bitsPerValue, ValueType >

Detailed Description

template<class FieldType, int bitsPerValue, class ValueType = FieldType>
class BitImage3D< FieldType, bitsPerValue, ValueType >

Image whose values are a predefined number of bits.

Number of bits of each value can be any number less then the biggest machine storable number (ie.32 bits). The value type returned by accessors is not not directly an integer type. It is a class called "BitValue" that "looks" like an (unsigned)int but when a value is assigned to it, it can write it into the correct place in the image

Definition at line 118 of file BitImage3D.hpp.


Constructor & Destructor Documentation

template<class FieldType, int bitsPerValue, class ValueType>
BitImage3D< FieldType, bitsPerValue, ValueType >::BitImage3D const Size3D size  ) 
 

Copy constructor

Definition at line 138 of file BitImage3D.hxx.


Member Function Documentation

template<class FieldType, int bitsPerValue, class ValueType = FieldType>
virtual float BitImage3D< FieldType, bitsPerValue, ValueType >::FloatValue int  x,
int  y,
int  z
const [inline, virtual]
 

This is a way to retreive values when only the base class is known.

WARNING: this is NOT the normal way of retreiving values of an image. Use () operators of subclasses, or better, iterators. This is a virtual function, so it is slow. Furthermore it casts results into float, which is not good in many situations. Many containers contain types that are not castable to float.

Reimplemented from Image3D.

Definition at line 286 of file BitImage3D.hpp.

template<class FieldType, int bitsPerValue, class ValueType>
string BitImage3D< FieldType, bitsPerValue, ValueType >::GetTypeName  )  const [virtual]
 

Type information, this should always return the result to a call of the TypeName function.

subclasses should override this by using : virtual string GetTypeName() const {return TypeName<_Self>();}

Reimplemented from Image3D.

Definition at line 32 of file BitImage3D.hxx.

Referenced by BitImage3D< FieldType, bitsPerValue, ValueType >::Read(), and BitImage3D< FieldType, bitsPerValue, ValueType >::Write().

template<class FieldType, int bitsPerValue, class ValueType>
void BitImage3D< FieldType, bitsPerValue, ValueType >::Read ImLib3DFile file,
xmlpp::Element *  parentNode = NULL,
xmlpp::Element *  node = NULL
[virtual]
 

This is where all the information is written.

This virtual function writes xml/bin of any unset/unwritten information (type,image size,image data,,...) If you override it in a child class, you should still call it (using _Base::Write...), you can even call it several times...

Reimplemented from Image3D.

Definition at line 53 of file BitImage3D.hxx.

References Image3D::CreateReadNode(), XMLBinaryFile::GetAttribute(), BitImage3D< FieldType, bitsPerValue, ValueType >::GetTypeName(), BitImage3D< FieldType, bitsPerValue, ValueType >::imageData, Container3D< Im3DValue >::Read(), and Image3D::Read().

Referenced by SparseStructure3D::Read().


The documentation for this class was generated from the following files:
Generated on Fri Jun 17 13:36:18 2005 for ImLib3D by  doxygen 1.4.2