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

roi.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <ctype.h>
#include <time.h>
#include "include/ecat63.h"
#include "include/petc99.h"
#include "include/roi.h"

Defines

#define SUPPORT_LEGACY

Functions

const char * libpet_roi_version (void)
void roi_empty (ROI_list *rl)
void roiInit (ROI_list *rl)
void roi_delete_n (ROI_list *rl, int ind)
void roi_delete (ROI_list *rl, ROI *roi)
void roiDel (ROI_list *rl, int ind)
int roi_read (const char *fname, ROI_list *rl)
int roiRead (const char *fname, ROI_list *rl)
int roi_compute_rect (ROI *roi)
int roiComputeRect (ROI *roi)
int roi_compute_circle (ROI *roi)
int roiComputeCirc (ROI *roi)
int roi_compute_ellipse (ROI *roi)
int roiComputeElli (ROI *roi)
void roi_print (ROI *roi)
int roiFillGaps (int *x, int *y, int nr, int **ffx, int **ffy)
int roiOnOff (ROI *roi, int dimx, int dimy, float zoom, char **m)
static void fill_traceroi (char **m, int dimx, int dimy, float f, int pos_x, int pos_y, int *roix, int *roiy, int point_nr)
int roi_onoff (ROI *roi, int dimx, int dimy, float zoom, char **m)
int roi_save (char *fname, ROI_list *rl)
int roiSave (char *fname, ROI_list *rl)
int roi_append (FILE *fp, ROI *roi)
int roi_append_n (FILE *fp, ROI_list *rl, int ind)
int roiAppend (char *fname, ROI_list *rl, int ind)
int jsqrt (int n)
int roi_mplane (int matnum)
int roi_mframe (int matnum)

Variables

char roierrmsg [128]

Define Documentation

#define SUPPORT_LEGACY
 


Function Documentation

static void fill_traceroi char **  m,
int  dimx,
int  dimy,
float  f,
int  pos_x,
int  pos_y,
int *  roix,
int *  roiy,
int  point_nr
[static]
 

int jsqrt int  n  ) 
 

const char* libpet_roi_version void   ) 
 

int roi_append FILE *  fp,
ROI roi
 

int roi_append_n FILE *  fp,
ROI_list rl,
int  ind
 

int roi_compute_circle ROI roi  ) 
 

int roi_compute_ellipse ROI roi  ) 
 

int roi_compute_rect ROI roi  ) 
 

void roi_delete ROI_list rl,
ROI roi
 

Deletes ROI from roilist

void roi_delete_n ROI_list rl,
int  ind
 

Deletes the index:th ROI

void roi_empty ROI_list rl  ) 
 

Allocated memory is freed, all data is cleared.

int roi_mframe int  matnum  ) 
 

Returns the frame number of specified matrix

int roi_mplane int  matnum  ) 
 

Returns the plane number of specified matrix

int roi_onoff ROI roi,
int  dimx,
int  dimy,
float  zoom,
char **  m
 

The matrix is filled with 0's (outside of ROI) and 1's (inside the ROI border). If ROI extends outside image borders, those points are ignored. Matrix coordinates are up-to-bottom and left-to-right.

Returns:
Function returns 0, if everything is OK.
Parameters:
roi  Definitions for one region-of-interest
dimx  Image matrix x dimension
dimy  Image matrix y dimension
zoom  Image reconstruction zoom
m  Allocated memory for output matrix[dimx][dimy]

void roi_print ROI roi  ) 
 

Prints the contents of (individual) roi data structure.

int roi_read const char *  fname,
ROI_list rl
 

Adds ROI file contents (all ROIs) to specified data structure.

Returns:
Returns 0, if OK.

int roi_save char *  fname,
ROI_list rl
 

int roiAppend char *  fname,
ROI_list rl,
int  ind
 

int roiComputeCirc ROI roi  ) 
 

int roiComputeElli ROI roi  ) 
 

int roiComputeRect ROI roi  ) 
 

void roiDel ROI_list rl,
int  ind
 

If ind=0, all ROIs in list are deleted keeping memory allocated, else only one ROI is deleted (ind=1, first ROI) keeping memory allocated.

int roiFillGaps int *  x,
int *  y,
int  nr,
int **  ffx,
int **  ffy
 

Fills the gaps between ROI points; join them with new points. Allocates memory for new point data in fx and fy.

Returns:
Returns the number of new points or =< 0, if error.

void roiInit ROI_list rl  ) 
 

Before any use, this should be called, but not later. Note. Rename to roi_init() when the old functions are removed

int roiOnOff ROI roi,
int  dimx,
int  dimy,
float  zoom,
char **  m
 

The matrix is filled with 0's (outside of ROI), 1's (on the ROI border), and 2's (inside the ROI border). If ROI extends outside image borders, those points are ignored. Matrix coordinates are up-to-bottom and left-to-right.

Returns:
Function returns 0, if everything is OK.
Parameters:
roi  Definitions for one region-of-interest
dimx  Image matrix x dimension
dimy  Image matrix y dimension
zoom  Image reconstruction zoom
m  Allocated memory for output matrix[dimx][dimy]

int roiRead const char *  fname,
ROI_list rl
 

Adds ROI file contents (all ROIs) to specified data structure.

Returns:
Returns 0, if OK.

int roiSave char *  fname,
ROI_list rl
 


Variable Documentation

char roierrmsg[128]
 

The ROI library error message


Generated on Fri Jan 21 16:17:42 2005 for libPET by  doxygen 1.4.1