TPCCLIB
Loading...
Searching...
No Matches
imgscanner.c File Reference

Scanner specific parameters for IMG data. More...

#include "libtpcimgp.h"

Go to the source code of this file.

Functions

int imgSetScanner (IMG *img, int scanner_type)

Detailed Description

Scanner specific parameters for IMG data.

Author
Vesa Oikonen

Definition in file imgscanner.c.

Function Documentation

◆ imgSetScanner()

int imgSetScanner ( IMG * img,
int scanner_type )

Sets scanner specific parameters in IMG data. If possible, set image zoom before calling this.

Returns
Returns 0, if ok.
Parameters
imgIMG data which is filled with scanner specific information
scanner_typeSCANNER_ECAT931, SCANNER_ADVANCE, SCANNER_HRPLUS, SCANNER_HRRT, SCANNER_STEVCT_PET, as defined in libtpcimgio.h

Definition at line 14 of file imgscanner.c.

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}
#define SCANNER_ADVANCE
#define IMG_STATUS_OCCUPIED
#define SCANNER_HRRT
#define SCANNER_HRPLUS
#define SCANNER_STEVCT_PET
#define SCANNER_ECAT931
#define IMG_TYPE_IMAGE
float sizex
unsigned short int dimx
char type
float sampleDistance
float transaxialFOV
char status
int scanner
float sizey
float zoom
float axialFOV
float sizez

Referenced by imgAnalyzeToEcat(), and imgNiftiToEcat().