My Project
vol.h
Go to the documentation of this file.
1 /******************************************************************************
2  Copyright (c) 2003,2004 by Turku PET Centre
3 
4  vol.h - definitions for vol.c
5 
6  Version:
7  2003-12-18 Vesa Oikonen
8  Added 3D structures VOL and SVOL and related functions.
9  2004-01-29 VO
10  Added functions vol2img() and svol2img.
11  2004-08-23 VO
12  Some Doxygen style comments.
13 
14 
15 
16 ******************************************************************************/
17 #ifndef _VOL_H
18 #define _VOL_H
19 /*****************************************************************************/
21 /*****************************************************************************/
22 
23 /*****************************************************************************/
24 typedef struct {
25  int x; /* [1..dimx] */
26  int y; /* [1..dimy] */
27  int z; /* [1..dimz] */
28 } VOL_PIXEL;
29 typedef struct {
30  int x1, x2; /* [1..dimx] */
31  int y1, y2; /* [1..dimy] */
32  int z1, z2; /* [1..dimz] */
33 } VOL_RANGE;
34 /*****************************************************************************/
35 
36 /*****************************************************************************/
37 /*
38  * 3D volume data structure - 4-byte float voxels
39  */
40 typedef struct {
41 
43  char status;
45  char *statmsg;
49  float sizex, sizey, sizez;
51  unsigned short int dimx, dimy, dimz;
53  float *_vxl, *_col, **_row, ***_pln;
55  float ***v, ***plane, **row, *column, *voxel;
56 
57 } VOL;
58 /*****************************************************************************/
59 /*
60  * 3D volume data structure - 2-byte short int voxels
61  */
62 typedef struct {
63 
65  char status;
67  char *statmsg;
71  float sizex, sizey, sizez;
73  unsigned short int dimx, dimy, dimz;
75  float scale_factor;
77  short int *_vxl, *_col, **_row, ***_pln;
79  short int ***v, ***plane, **row, *column, *voxel;
80 
81 } SVOL;
82 /*****************************************************************************/
83 
84 /*****************************************************************************/
85 /*
86  * Function definitions
87  */
88 /* 4-byte floats */
89 extern void volInit(VOL *vol);
90 extern void volEmpty(VOL *vol);
91 extern int volAllocate(VOL *vol, int planes, int rows, int columns);
92 extern int img2vol(IMG *img, VOL *vol, int frame);
93 extern int vol2img(VOL *vol, IMG *img, int frame);
94 extern void volInfo(VOL *vol, FILE *fp);
95 extern void volContents(VOL *vol, VOL_RANGE r, FILE *fp);
96 extern int volMax(VOL *vol, VOL_RANGE r, VOL_PIXEL *p, float *maxv);
97 extern int volAvg(VOL *vol, VOL_RANGE r, float *avg);
98 /* 2-byte short ints */
99 extern void svolInit(SVOL *svol);
100 extern void svolEmpty(SVOL *svol);
101 extern int svolAllocate(SVOL *svol, int planes, int rows, int columns);
102 extern int img2svol(IMG *img, SVOL *svol, int frame);
103 extern int svol2img(SVOL *svol, IMG *img, int frame);
104 extern void svolInfo(SVOL *svol, FILE *fp);
105 /*****************************************************************************/
106 
107 /*****************************************************************************/
108 #endif /* _VOL_H */
109 
VOL_RANGE
Definition: vol.h:29
volAvg
int volAvg(VOL *vol, VOL_RANGE r, float *avg)
Definition: vol.c:545
SVOL::voxel
short int * voxel
Definition: vol.h:79
volAllocate
int volAllocate(VOL *vol, int planes, int rows, int columns)
Definition: vol.c:156
VOL_TEST
int VOL_TEST
Definition: vol.h:20
VOL_PIXEL::y
int y
Definition: vol.h:26
svol2img
int svol2img(SVOL *svol, IMG *img, int frame)
Definition: vol.c:401
SVOL::sizez
float sizez
Definition: vol.h:71
volInit
void volInit(VOL *vol)
Definition: vol.c:45
SVOL::status
char status
Definition: vol.h:65
volMax
int volMax(VOL *vol, VOL_RANGE r, VOL_PIXEL *p, float *maxv)
Definition: vol.c:513
VOL_PIXEL
Definition: vol.h:24
VOL::orientation
int orientation
Definition: vol.h:47
img2svol
int img2svol(IMG *img, SVOL *svol, int frame)
Definition: vol.c:322
svolInit
void svolInit(SVOL *svol)
Definition: vol.c:68
VOL::voxel
float * voxel
Definition: vol.h:55
volContents
void volContents(VOL *vol, VOL_RANGE r, FILE *fp)
Definition: vol.c:480
VOL
Definition: vol.h:40
SVOL::_vxl
short int * _vxl
Definition: vol.h:77
svolInfo
void svolInfo(SVOL *svol, FILE *fp)
Definition: vol.c:455
SVOL::orientation
int orientation
Definition: vol.h:69
VOL::status
char status
Definition: vol.h:43
VOL_RANGE::x2
int x2
Definition: vol.h:30
VOL::dimz
unsigned short int dimz
Definition: vol.h:51
SVOL::scale_factor
float scale_factor
Definition: vol.h:75
VOL::statmsg
char * statmsg
Definition: vol.h:45
svolAllocate
int svolAllocate(SVOL *svol, int planes, int rows, int columns)
Definition: vol.c:221
vol2img
int vol2img(VOL *vol, IMG *img, int frame)
Definition: vol.c:367
IMG
Definition: img.h:156
volInfo
void volInfo(VOL *vol, FILE *fp)
Definition: vol.c:431
VOL_PIXEL::z
int z
Definition: vol.h:27
SVOL
Definition: vol.h:62
VOL_RANGE::y2
int y2
Definition: vol.h:31
VOL::sizez
float sizez
Definition: vol.h:49
VOL_RANGE::z2
int z2
Definition: vol.h:32
volEmpty
void volEmpty(VOL *vol)
Definition: vol.c:91
svolEmpty
void svolEmpty(SVOL *svol)
Definition: vol.c:120
SVOL::statmsg
char * statmsg
Definition: vol.h:67
img2vol
int img2vol(IMG *img, VOL *vol, int frame)
Definition: vol.c:284
VOL::_vxl
float * _vxl
Definition: vol.h:53
VOL_PIXEL::x
int x
Definition: vol.h:25
SVOL::dimz
unsigned short int dimz
Definition: vol.h:73