Main Page | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

prmat.h File Reference

#include "ellipse.h"

Go to the source code of this file.

Defines

#define PRMAT_STATUS_UNINITIALIZED   0
 Structure status uninitialized. Value 0.
#define PRMAT_STATUS_INITIALIZED   1
 Stucture status initialized. Value 1.
#define PRMAT_STATUS_BS_OCCUPIED   2
 Base set of projection matrix status initialized and set. Value 2.
#define PRMAT_STATUS_LU_OCCUPIED   3
 Look up table status initialized and set. Value 3.
#define PRMAT_STATUS_PR_OCCUPIED   4
 The whole projection matrix status initialized and set. Value 4.
#define PRMAT_STATUS_ERROR   5
 Stucture status error. Value 5.
#define PRMAT_TYPE_ECAT931   0
 Projection matrix is based on scanner dimensions 192*256 (ECAT). Value 0.
#define PRMAT_TYPE_GE   1
 Projection matrix is based on scanner dimensions 281*336 (GE). Value 1.
#define PRMAT_TYPE_NA   2
 Projection matrix is based on unknown scanner geometrics. Value 2.
#define PRMAT_DMODE_01   0
 Discretization model in discrete Radon transform is "0/1". Value 0.
#define PRMAT_DMODE_LOI   1
 Discretization model in discrete Radon transform is "length of intersection". Value 1.
#define PRMAT_DMODE_EA   2
 Discretization model in discrete Radon transform is "exact area". Value 2.
#define PRMAT_DMODE_LI   3
 Discretization model in discrete Radon transform is "linear interpolation". Value 3.
#define PRMAT_DMODE_NN   4
 Discretization model in discrete Radon transform is "nearest neighbour". Value 4.

Functions

void prmatInit (PRMAT *mat)
void prmatEmpty (PRMAT *mat)
int prmatAllocate (PRMAT *mat, int set, int rows, int *coords)
int prmatGetNV (PRMAT *mat)
int prmatGetNB (PRMAT *mat)
int prmatGetID (PRMAT *mat)
int prmatGetPIX (PRMAT *mat)
int prmatGetPixCoord (PRMAT *mat, int row)
int prmatGetRays (PRMAT *mat, int row)
int prmatGetBinView (PRMAT *mat, int row, int ind)
int prmatGetRows (PRMAT *mat)
int prmatGetPixels (PRMAT *mat, int row)
int prmatGetCoord (PRMAT *mat, int row, int pix)
int prmatGetXCoord (PRMAT *mat, int row, int pix)
int prmatGetYCoord (PRMAT *mat, int row, int pix)
float prmatGetFactor (PRMAT *mat, int row, int pix)
float prmatGetMajor (PRMAT *mat)
float prmatGetMinor (PRMAT *mat)
float prmatGetMin (PRMAT *mat)
float prmatGetMax (PRMAT *mat)
float prmatGetFactorSum (PRMAT *mat)
float prmatGetFactorSqrSum (PRMAT *mat, int row)
int prmatReadMatrix (char *fname, PRMAT *mat)
int prmatSaveMatrix (PRMAT *mat)

Variables

int PRMAT_TEST
 If not 0 drive in test mode.
int PRMAT_VERBOSE
 If not 0 drive in verbose mode.


Define Documentation

#define PRMAT_DMODE_01   0
 

Discretization model in discrete Radon transform is "0/1". Value 0.

#define PRMAT_DMODE_EA   2
 

Discretization model in discrete Radon transform is "exact area". Value 2.

#define PRMAT_DMODE_LI   3
 

Discretization model in discrete Radon transform is "linear interpolation". Value 3.

#define PRMAT_DMODE_LOI   1
 

Discretization model in discrete Radon transform is "length of intersection". Value 1.

#define PRMAT_DMODE_NN   4
 

Discretization model in discrete Radon transform is "nearest neighbour". Value 4.

#define PRMAT_STATUS_BS_OCCUPIED   2
 

Base set of projection matrix status initialized and set. Value 2.

#define PRMAT_STATUS_ERROR   5
 

Stucture status error. Value 5.

#define PRMAT_STATUS_INITIALIZED   1
 

Stucture status initialized. Value 1.

#define PRMAT_STATUS_LU_OCCUPIED   3
 

Look up table status initialized and set. Value 3.

#define PRMAT_STATUS_PR_OCCUPIED   4
 

The whole projection matrix status initialized and set. Value 4.

#define PRMAT_STATUS_UNINITIALIZED   0
 

Structure status uninitialized. Value 0.

#define PRMAT_TYPE_ECAT931   0
 

Projection matrix is based on scanner dimensions 192*256 (ECAT). Value 0.

#define PRMAT_TYPE_GE   1
 

Projection matrix is based on scanner dimensions 281*336 (GE). Value 1.

#define PRMAT_TYPE_NA   2
 

Projection matrix is based on unknown scanner geometrics. Value 2.


Function Documentation

int prmatAllocate PRMAT mat,
int  set,
int  rows,
int *  coords
 

Allocates memory for PRMAT data. Normally used only in SET-functions. Allocates memory for look-up table if set = 0 and for projection matrix otherwise. *mat is initialized && rows is positive && *coords list contains as many positive integers as there are rows. memory is allocated for PRMAT structure mat.

Parameters:
PRMAT *mat pointer to projection matrix for which the allocation is done.
int set tells for which part of the structure allocation is to be done.
int rows number of rows in a matrix.
int *coords list of number of entries in each row.
Returns:
0 if ok.

void prmatEmpty PRMAT mat  ) 
 

Frees the memory allocated for mat. All data is cleared.

Parameters:
PRMAT *mat pointer to projection matrix to be emptied.

int prmatGetBinView PRMAT mat,
int  row,
int  ind
 

Returns coordinates of a line of response in place (row,ind) in the look-up table. 0<=row<=prmatGetPIX(*mat) && 0<=ind<=prmatGetRays(*mat,row) && mat is initialized. .

Parameters:
PRMAT *mat pointer to a projection matrix.
int row the row index.
int ind the (non-zero) lor index.
Returns:
int coordinates (view*binNr + bin) of the referred line of response, some negative value if ERROR.

int prmatGetCoord PRMAT mat,
int  row,
int  pix
 

Returns coordinate of a pixel in place (row,pix) in the given projection matrix. 0<=row<=prmatGetLORS(*mat) && 0<=pix<=prmatGetPixels(row,*mat) && mat is initialized. .

Parameters:
PRMAT *mat pointer to a projection matrix.
int row the row index.
int pix the (non-zero) pixel index.
Returns:
coordinate of the referred pixel, some negative value if ERROR.

float prmatGetFactor PRMAT mat,
int  row,
int  pix
 

Returns factor (weighting coefficient) for a pixel in place (row,pix) in given projection matrix. 0<=row<=prmatGetLORS(*mat) && 0<=pix<=prmatGetPixels(row,*mat) && mat is initialized. .

Parameters:
PRMAT *mat pointer to a projection matrix.
int row the row index.
int pix the (non-zero) pixel index.
Returns:
factor for the referred pixel, some negative value if ERROR.

float prmatGetFactorSqrSum PRMAT mat,
int  row
 

Returns square sum of all factors in given projection matrix in given row. mat is initialized && 0<=row<=prmatGetLORS(*mat). .

Parameters:
PRMAT *mat pointer to a projection matrix.
int row row index for accessing factors.
Returns:
square sum of all factors in given projection matrix in given row.

float prmatGetFactorSum PRMAT mat  ) 
 

Returns sum of all factors in given projection matrix. For initializing image matrix. mat is initialized. .

Parameters:
PRMAT *mat pointer to a projection matrix.
Returns:
sum of all factors in given projection matrix.

int prmatGetID PRMAT mat  ) 
 

Returns the image dimension in the geometrics. mat is initialized. .

Parameters:
PRMAT *mat pointer to a projection matrix.
Returns:
the image dimension in the geometrics.

float prmatGetMajor PRMAT mat  ) 
 

Returns major semiaxe of the FOV in given projection matrix. mat is initialized. .

Parameters:
PRMAT *mat pointer to a projection matrix.
Returns:
major semiaxe of the FOV in given projection matrix

float prmatGetMax PRMAT mat  ) 
 

Returns greatest value in given projection matrix. mat is initialized. .

Parameters:
PRMAT *mat pointer to a projection matrix.
Returns:
maximal value in given projection matrix.

float prmatGetMin PRMAT mat  ) 
 

Returns minimal value in given projection matrix. mat is initialized. .

Parameters:
PRMAT *mat pointer to a projection matrix.
Returns:
minimal value in given projection matrix.

float prmatGetMinor PRMAT mat  ) 
 

Returns minor semiaxe of the FOV in given projection matrix. mat is initialized. .

Parameters:
PRMAT *mat pointer to a projection matrix.
Returns:
minor semiaxe of the FOV in given projection matrix

int prmatGetNB PRMAT mat  ) 
 

Returns the number of bins (distances) in the geometrics. mat is initialized. .

Parameters:
PRMAT *mat pointer to a projection matrix.
Returns:
the number of bins in the geometrics.

int prmatGetNV PRMAT mat  ) 
 

Returns the number of views (angles) in the geometrics. mat is initialized. .

Parameters:
PRMAT *mat pointer to a projection matrix.
Returns:
the number of views in the geometrics.

int prmatGetPIX PRMAT mat  ) 
 

Returns number of rows (pixels) in the look-up table. mat is initialized. .

Parameters:
PRMAT *mat pointer to a projection matrix.
Returns:
number of pixels in look-up table, some negative value if ERROR.

int prmatGetPixCoord PRMAT mat,
int  row
 

Returns coordinates of a pixel in place 'row' in the look-up table. 0<=row<=prmatGetPIX(*mat) && mat is initialized. END .

Parameters:
PRMAT *mat pointer to a projection matrix.
int row index of the pixel whose coordinates are to be returned.
Returns:
coordinates of a pixel in the look-up table, some negative value if ERROR.

int prmatGetPixels PRMAT mat,
int  row
 

Returns number of pixels intersected by the given line of response. 0<=row<=prmatGetLORS(*mat) && mat is initialized. END .

Parameters:
PRMAT *mat pointer to the projection matrix.
int row index of the line of response for which the number of pixels is returned.
Returns:
number of pixels intersected by given line of response, some negative value if ERROR.

int prmatGetRays PRMAT mat,
int  row
 

Returns the number of lines of response (rays) intersecting the pixel in place 'row'. 0<=row<=prmatGetPIX(*mat) && mat is initialized. END .

Parameters:
PRMAT *mat pointer to a projection matrix.
int row index of the pixel for which the number of lors is returned.
Returns:
number of lines of response intersecting the pixel, some negative value if ERROR.

int prmatGetRows PRMAT mat  ) 
 

Returns number of rows (lines of response) in the given projection matrix. mat is initialized. .

Parameters:
PRMAT *mat pointer to the projection matrix.
Returns:
number of rows in the given projection matrix, some negative value if ERROR.

int prmatGetXCoord PRMAT mat,
int  row,
int  pix
 

Returns the x-coordinate of a pixel in place (row,pix) in the given projection matrix. 0<=row<=prmatGetLORS(*mat) && 0<=pix<=prmatGetPixels(row,*mat) && mat is initialized. .

Parameters:
PRMAT *mat pointer to a projection matrix.
int row the row index.
int pix the (non-zero) pixel index.
Returns:
coordinate of the referred pixel, some negative value if ERROR.

int prmatGetYCoord PRMAT mat,
int  row,
int  pix
 

Returns the y-coordinate of a pixel in place (row,pix) in the given projection matrix. 0<=row<=prmatGetLORS(*mat) && 0<=pix<=prmatGetPixels(row,*mat) && mat is initialized. .

Parameters:
PRMAT *mat pointer to a projection matrix.
int row the row index.
int pix the (non-zero) pixel index.
Returns:
coordinate of the referred pixel, some negative value if ERROR.

void prmatInit PRMAT mat  ) 
 

Initializes PRMAT datatype for use. To be utilised before any use of PRMAT type variables.

Parameters:
PRMAT *mat pointer to projection matrix to be initialized.

int prmatReadMatrix char *  fname,
PRMAT mat
 

Reads one projection matrix from the given file to the given PRMAT structure mat. mat is initialized. a projection matrix is read from the file fname.

Parameters:
char *fname file name to read.
PRMAT *mat pointer to the projection matrix datatype.
Returns:
0 if OK.

int prmatSaveMatrix PRMAT mat  ) 
 

Adds the given projection matrix to the file called prTDXXYY.prm. Where T is the type of the scanner (E=ECAT931 and G=GE Advance), D is the type of discretisation (0='0/1', 1='length of intersection' and 2='exact area'), XX is the major semiaxe of the FOV, and YY the minor semiaxe. If file already exists it is NOT created or rewritten. mat is initialized (contains a projection matrix). mat is saved in the file prTDXXYY.prm.

Parameters:
PRMAT *mat pointer to the projection matrix to be saved.
Returns:
0 if OK.


Variable Documentation

int PRMAT_TEST
 

If not 0 drive in test mode.

int PRMAT_VERBOSE
 

If not 0 drive in verbose mode.


Generated on Tue Nov 29 15:16:10 2005 by  doxygen 1.4.1