bild16 Class Reference

#include <imgclass.hpp>

Inheritance diagram for bild16:

Inheritance graph
base refererrect $classimgbase.html 40,109 125,133rect $classimgbase.html 7,19 158,43
[legend]

List of all members.


Detailed Description

Class that deals with 16bit grayscale images from the X-ray device.

This class does everything you should ever need for operation with sampled 16bit images from the X-ray device. It features basic I/O operation (can read and write HIS files), reads and writes PGM grayscale images (8bit as well as 16bit) and has functions for drawing vertical and horizontal lines (drawx(), drawy()). However, it is not meant mainly for processing the image. Use bildfloat for this purpose.

Definition at line 353 of file imgclass.hpp.


Public Types

typedef unsigned short data_t
 The base data type, for convenience.

Public Member Functions

 bild16 (const char *fname=NULL) THROWSPEC
 bild16 (unsigned short *data) THROWSPEC
 ~bild16 ()
void write_pgm16 (const char *name) const
 Write image as PGM 16 bit file.
void write_pgm8 (const char *name) const
 Write image as PGM 8 bit file.
void write_pgm8_bounds (const char *name, bild16::data_t low, bild16::data_t high) const
 Write image as PGM 8 bit file, determine contrast.
bild16read_his (const char *name) THROWSPEC
 Read HIS file (single image).
void write_his (const char *name) const
 Write image as HIS file.
bild16read_pgm (const char *name) THROWSPEC
 Read PGM file. Must match dimension and be either 8bit or 16bit.
bild16og_correct (const bild16 &offset, const bild16 &gain)
 Do integer offset-gain correction. Deprecated.
bild16drawx (int x, int y1, int y2) THROWSPEC
 Draw a vertical line.
bild16drawy (int y, int x1, int x2) THROWSPEC
 Draw a horizontal line.
bild16kreuz (int x, int y) THROWSPEC
 Draw a cross centered at (x,y).
void fromfloat (const bildfloat &bf, float max=1.0)
 Convert from bildfloat.
bild16operator= (const bild16 &b)
 Assignemnt copy operator.
unsigned short & operator() (int y, int x)
 Element extraction operator.
const unsigned short & operator() (int y, int x) const
 Constant element extraction operator.
imgbase< s_x, s_y, unsigned
short > & 
operator/= (const imgbase< s_x, s_y, unsigned short > &what)
 Arithmetic operator.
imgbase< s_x, s_y, unsigned
short > & 
operator/= (const unsigned short &what)
 Arithmetic operator.
imgbase< s_x, s_y, unsigned
short > & 
operator*= (const imgbase< s_x, s_y, unsigned short > &what)
 Arithmetic operator.
imgbase< s_x, s_y, unsigned
short > & 
operator*= (const unsigned short &what)
 Arithmetic operator.
imgbase< s_x, s_y, unsigned
short > & 
operator-= (const imgbase< s_x, s_y, unsigned short > &what)
 Arithmetic operator.
imgbase< s_x, s_y, unsigned
short > & 
operator-= (const unsigned short &what)
 Arithmetic operator.
imgbase< s_x, s_y, unsigned
short > & 
operator+= (const imgbase< s_x, s_y, unsigned short > &what)
 Arithmetic operator.
imgbase< s_x, s_y, unsigned
short > & 
operator+= (const unsigned short &what)
 Arithmetic operator.

Public Attributes

header_tfile_header
const int SIZEX
 save the s_x template parameter
const int SIZEY
 save the s_y template parameter

Static Public Attributes

static const data_t intensity_max = 0xFFFF
 Maximum possible intensity, representing white.
static const data_t intensity_min = 0x0000
 Minimum possible intensity, representing black.

Protected Attributes

data_t ** bild

Static Private Attributes

static const std::streamoff HIS_START = 100

Classes

struct  header_t
 Header data structure of HIS files. More...

Member Typedef Documentation

typedef unsigned short imgbase< s_x, s_y, unsigned short >::data_t [inherited]

The base data type, for convenience.

You can use this typedef to extract the type of the elements from the derived classes.

Example:

Definition at line 123 of file imgclass.hpp.


Constructor & Destructor Documentation

bild16::bild16 ( const char *  fname = NULL  ) 

Definition at line 35 of file imgclass.cpp.

bild16::bild16 ( unsigned short *  data  ) 

Definition at line 60 of file imgclass.cpp.

References MAP.

bild16::~bild16 (  ) 

Definition at line 84 of file imgclass.cpp.

References file_header.


Member Function Documentation

void bild16::write_pgm16 ( const char *  name  )  const

void bild16::write_pgm8 ( const char *  name  )  const

void bild16::write_pgm8_bounds ( const char *  name,
bild16::data_t  low,
bild16::data_t  high 
) const

Write image as PGM 8 bit file, determine contrast.

Definition at line 122 of file imgclass.cpp.

References imgbase< 512, 512, unsigned short >::SIZEX, imgbase< 512, 512, unsigned short >::SIZEY, and STHROW.

bild16 & bild16::read_his ( const char *  name  ) 

void bild16::write_his ( const char *  name  )  const

bild16 & bild16::read_pgm ( const char *  name  ) 

Read PGM file. Must match dimension and be either 8bit or 16bit.

Definition at line 242 of file imgclass.cpp.

References imgbase< 512, 512, unsigned short >::SIZEX, imgbase< 512, 512, unsigned short >::SIZEY, and STHROW.

bild16 & bild16::og_correct ( const bild16 offset,
const bild16 gain 
)

bild16 & bild16::drawx ( int  x,
int  y1,
int  y2 
)

bild16 & bild16::drawy ( int  y,
int  x1,
int  x2 
)

bild16 & bild16::kreuz ( int  x,
int  y 
)

Draw a cross centered at (x,y).

Definition at line 355 of file imgclass.cpp.

References drawx(), drawy(), imgbase< 512, 512, unsigned short >::SIZEX, imgbase< 512, 512, unsigned short >::SIZEY, and STHROW.

void bild16::fromfloat ( const bildfloat bf,
float  max = 1.0 
)

Convert from bildfloat.

Definition at line 297 of file imgclass.cpp.

References intensity_max, intensity_min, and MAP.

bild16& bild16::operator= ( const bild16 b  )  [inline]

Assignemnt copy operator.

Definition at line 408 of file imgclass.hpp.

References imgbase< 512, 512, unsigned short >::operator=().

unsigned short & imgbase< s_x, s_y, unsigned short >::operator() ( int  y,
int  x 
) [inline, inherited]

Element extraction operator.

Parenthesis are used to index a pixel of the image. This idea is borrowed from the octave C++ interface. The order of the arguments is y, x. This order should imitate the old C way in order not to confuse people from EP~V

Definition at line 138 of file imgclass.hpp.

References imgbase< s_x, s_y, T >::bild.

const unsigned short & imgbase< s_x, s_y, unsigned short >::operator() ( int  y,
int  x 
) const [inline, inherited]

Constant element extraction operator.

Definition at line 140 of file imgclass.hpp.

References imgbase< s_x, s_y, T >::bild.

imgbase<s_x, s_y, unsigned short >& imgbase< s_x, s_y, unsigned short >::operator/= ( const imgbase< s_x, s_y, unsigned short > &  what  )  [inherited]

Arithmetic operator.

This operator divides every pixel of the image by the corresponding value in what. It leaves the value unchanged if the denominator is zero, thus avoiding division by zero

imgbase<s_x, s_y, unsigned short >& imgbase< s_x, s_y, unsigned short >::operator/= ( const unsigned short &  what  )  [inherited]

Arithmetic operator.

This operator divides every pixel by the constant value what

imgbase<s_x, s_y, unsigned short >& imgbase< s_x, s_y, unsigned short >::operator*= ( const imgbase< s_x, s_y, unsigned short > &  what  )  [inherited]

Arithmetic operator.

This operator multiplies every pixel of the image by the corresponding value in what.

imgbase<s_x, s_y, unsigned short >& imgbase< s_x, s_y, unsigned short >::operator*= ( const unsigned short &  what  )  [inherited]

Arithmetic operator.

This operator multiplies every pixel by the constant value what

imgbase<s_x, s_y, unsigned short >& imgbase< s_x, s_y, unsigned short >::operator-= ( const imgbase< s_x, s_y, unsigned short > &  what  )  [inherited]

Arithmetic operator.

This operator subtracts every pixel of what from the corresponding value in the image.

imgbase<s_x, s_y, unsigned short >& imgbase< s_x, s_y, unsigned short >::operator-= ( const unsigned short &  what  )  [inherited]

Arithmetic operator.

This operator subtracts the constant value what from every pixel in the image

imgbase<s_x, s_y, unsigned short >& imgbase< s_x, s_y, unsigned short >::operator+= ( const imgbase< s_x, s_y, unsigned short > &  what  )  [inherited]

Arithmetic operator.

This operator adds every pixel in what to the corresponding pixel value in the image

imgbase<s_x, s_y, unsigned short >& imgbase< s_x, s_y, unsigned short >::operator+= ( const unsigned short &  what  )  [inherited]

Arithmetic operator.

This operator adds the constant value what to every pixel in the image


Member Data Documentation

const streamoff bild16::HIS_START = 100 [static, private]

Definition at line 354 of file imgclass.hpp.

Referenced by read_his(), and write_his().

const bild16::data_t bild16::intensity_max = 0xFFFF [static]

const bild16::data_t bild16::intensity_min = 0x0000 [static]

Minimum possible intensity, representing black.

Definition at line 359 of file imgclass.hpp.

Referenced by bildfloat::apply_eichkurve(), flatkurve::flatkurve(), and fromfloat().

Definition at line 384 of file imgclass.hpp.

Referenced by read_his(), write_his(), and ~bild16().

const int imgbase< s_x, s_y, unsigned short >::SIZEX [inherited]

save the s_x template parameter

Definition at line 126 of file imgclass.hpp.

Referenced by drawx(), drawy(), kreuz(), og_correct(), read_his(), read_pgm(), write_his(), write_pgm16(), write_pgm8(), and write_pgm8_bounds().

const int imgbase< s_x, s_y, unsigned short >::SIZEY [inherited]

save the s_y template parameter

Definition at line 129 of file imgclass.hpp.

Referenced by drawx(), drawy(), kreuz(), og_correct(), read_his(), read_pgm(), write_his(), write_pgm16(), write_pgm8(), and write_pgm8_bounds().

data_t** imgbase< s_x, s_y, unsigned short >::bild [protected, inherited]

The real data storage. Should not be used by derived classes

Definition at line 161 of file imgclass.hpp.

Referenced by drawx(), drawy(), og_correct(), read_his(), write_his(), write_pgm16(), and write_pgm8().


The documentation for this class was generated from the following files:

Generated on Fri Jul 24 12:49:18 2009 for Xgrayimg Library by  doxygen 1.5.5