TPCCLIB
Loading...
Searching...
No Matches
libtpcimgp
imgscanner.c
Go to the documentation of this file.
1
5
/*****************************************************************************/
6
#include "
libtpcimgp.h
"
7
/*****************************************************************************/
8
9
/*****************************************************************************/
14
int
imgSetScanner
(
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
/*****************************************************************************/
imgSetScanner
int imgSetScanner(IMG *img, int scanner_type)
Definition
imgscanner.c:14
SCANNER_ADVANCE
#define SCANNER_ADVANCE
Definition
libtpcimgio.h:1551
IMG_STATUS_OCCUPIED
#define IMG_STATUS_OCCUPIED
Definition
libtpcimgio.h:1479
SCANNER_HRRT
#define SCANNER_HRRT
Definition
libtpcimgio.h:1555
SCANNER_HRPLUS
#define SCANNER_HRPLUS
Definition
libtpcimgio.h:1553
SCANNER_STEVCT_PET
#define SCANNER_STEVCT_PET
Definition
libtpcimgio.h:1560
SCANNER_ECAT931
#define SCANNER_ECAT931
Definition
libtpcimgio.h:1549
IMG_TYPE_IMAGE
#define IMG_TYPE_IMAGE
Definition
libtpcimgio.h:1493
libtpcimgp.h
Header file for libtpcimgp.
IMG
Definition
libtpcimgio.h:1657
IMG::sizex
float sizex
Definition
libtpcimgio.h:1714
IMG::dimx
unsigned short int dimx
Definition
libtpcimgio.h:1780
IMG::type
char type
Definition
libtpcimgio.h:1704
IMG::sampleDistance
float sampleDistance
Definition
libtpcimgio.h:1712
IMG::transaxialFOV
float transaxialFOV
Definition
libtpcimgio.h:1710
IMG::status
char status
Definition
libtpcimgio.h:1665
IMG::scanner
int scanner
Definition
libtpcimgio.h:1737
IMG::sizey
float sizey
Definition
libtpcimgio.h:1716
IMG::zoom
float zoom
Definition
libtpcimgio.h:1706
IMG::axialFOV
float axialFOV
Definition
libtpcimgio.h:1708
IMG::sizez
float sizez
Definition
libtpcimgio.h:1718
Generated on Fri Sep 19 2025 13:32:05 for TPCCLIB by
1.12.0