TPCCLIB
Loading...
Searching...
No Matches
imgscanner.c
Go to the documentation of this file.
1
5/*****************************************************************************/
6#include "libtpcimgp.h"
7/*****************************************************************************/
8
9/*****************************************************************************/
16 IMG *img,
19 int scanner_type
20) {
21 int rayNr;
22
23 if(img->status<IMG_STATUS_OCCUPIED) return(1);
24 img->scanner=scanner_type;
25 /* Set zoom to 1.0, if it is not set */
26 if(img->zoom<=0.0) img->zoom=1.0;
27 /* Then the others */
28 if(scanner_type==SCANNER_ECAT931) {
29 // dimz 15
30 rayNr=192;
31 img->axialFOV=108.;
32 img->transaxialFOV=600.826;
33 img->sampleDistance=3.12932;
34 img->sizez=6.75;
35 } else if(scanner_type==SCANNER_ADVANCE) {
36 // dimz 35
37 rayNr=281;
38 img->axialFOV=153.;
39 img->transaxialFOV=550.;
40 img->sampleDistance=1.970177;
41 img->sizez=4.25;
42 } else if(scanner_type==SCANNER_HRPLUS) {
43 rayNr=288;
44 img->axialFOV=155.2;
45 img->transaxialFOV=583.;
46 img->sampleDistance=2.25; /* bin size */
47 img->sizez=2.425;
48 } else if(scanner_type==SCANNER_HRRT) {
49 rayNr=256;
50 img->axialFOV=252.28;
51 img->transaxialFOV=312.;
52 img->sampleDistance=1.08; /* bin size */
53 img->sizez=img->sizex=img->sizey=1.218750;
54 } else if(scanner_type==SCANNER_STEVCT_PET) {
55 // dimz 47
56 rayNr=0;
57 img->sizez=3.27;
58 img->sizex=img->sizey=5.46875;
59/*} else if(scanner_type==SCANNER_DMI_PET) { // Aino
60 rayNr=544;
61 img->axialFOV=200.;
62 img->transaxialFOV=700.;
63 img->sizez=nan("");
64 img->sizex=img->sizey=nan("");
65*/
66 } else
67 return(2);
68 /* If this is image, then set also pixel sizes */
69 if(img->type==IMG_TYPE_IMAGE) {
70 if(scanner_type!=SCANNER_HRRT && scanner_type!=SCANNER_STEVCT_PET) {
71 img->sizex=img->sizey=
72 img->sampleDistance*(float)rayNr / ( (float)img->dimx*img->zoom );
73 } else {
74 img->sizex=img->sizey=
75 img->transaxialFOV / ( (float)img->dimx*img->zoom );
76 }
77 }
78
79 return(0);
80}
81/*****************************************************************************/
82
83/*****************************************************************************/
int imgSetScanner(IMG *img, int scanner_type)
Definition imgscanner.c:14
#define SCANNER_ADVANCE
#define IMG_STATUS_OCCUPIED
#define SCANNER_HRRT
#define SCANNER_HRPLUS
#define SCANNER_STEVCT_PET
#define SCANNER_ECAT931
#define IMG_TYPE_IMAGE
Header file for libtpcimgp.
float sizex
unsigned short int dimx
char type
float sampleDistance
float transaxialFOV
char status
int scanner
float sizey
float zoom
float axialFOV
float sizez