@@ -42,7 +42,7 @@ ForwardProjectorByBinParallelproj::registered_name =
42
42
" Parallelproj" ;
43
43
44
44
ForwardProjectorByBinParallelproj::ForwardProjectorByBinParallelproj () :
45
- _cuda_verbosity(true ), _use_truncation (true ), _num_gpu_chunks(1 )
45
+ _cuda_verbosity(true ), _restrict_to_cylindrical_FOV (true ), _num_gpu_chunks(1 )
46
46
{
47
47
this ->_already_set_up = false ;
48
48
this ->_do_not_setup_helper = false ;
@@ -59,6 +59,7 @@ initialise_keymap()
59
59
parser.add_start_key (" Forward Projector Using Parallelproj Parameters" );
60
60
parser.add_stop_key (" End Forward Projector Using Parallelproj Parameters" );
61
61
parser.add_key (" verbosity" , &_cuda_verbosity);
62
+ parser.add_key (" restrict to cylindrical FOV" , &_restrict_to_cylindrical_FOV);
62
63
parser.add_key (" num_gpu_chunks" , &_num_gpu_chunks);
63
64
}
64
65
@@ -67,10 +68,24 @@ ForwardProjectorByBinParallelproj::
67
68
set_defaults ()
68
69
{
69
70
_cuda_verbosity = true ;
70
- _use_truncation = true ;
71
+ _restrict_to_cylindrical_FOV = true ;
71
72
_num_gpu_chunks = 1 ;
72
73
}
73
74
75
+ bool
76
+ ForwardProjectorByBinParallelproj::
77
+ get_restrict_to_cylindrical_FOV () const
78
+ {
79
+ return this ->_restrict_to_cylindrical_FOV ;
80
+ }
81
+
82
+ void
83
+ ForwardProjectorByBinParallelproj::
84
+ set_restrict_to_cylindrical_FOV (bool val)
85
+ {
86
+ this ->_restrict_to_cylindrical_FOV = val;
87
+ }
88
+
74
89
75
90
void
76
91
ForwardProjectorByBinParallelproj::set_helper (shared_ptr<detail::ParallelprojHelper> helper)
@@ -84,6 +99,10 @@ ForwardProjectorByBinParallelproj::
84
99
set_up (const shared_ptr<const ProjDataInfo>& proj_data_info_sptr,
85
100
const shared_ptr<const DiscretisedDensity<3 ,float > >& density_info_sptr)
86
101
{
102
+ #ifdef STIR_TOF
103
+ if (proj_data_info_sptr->get_num_tof_poss () > 1 )
104
+ error (" STIR-ParallelProj interface does not support TOF data yet. Sorry!" );
105
+ #endif
87
106
ForwardProjectorByBin::set_up (proj_data_info_sptr,density_info_sptr);
88
107
check (*proj_data_info_sptr, *_density_sptr);
89
108
_symmetries_sptr.reset (new TrivialDataSymmetriesForBins (proj_data_info_sptr));
@@ -135,10 +154,7 @@ set_input(const DiscretisedDensity<3,float> & density)
135
154
{
136
155
ForwardProjectorByBin::set_input (density);
137
156
138
- // Before forward projection, we enforce a truncation outside of the FOV.
139
- // This is because the parallelproj projector seems to have some trouble at the edges and this
140
- // could cause some voxel values to spiral out of control.
141
- // if (_use_truncation)
157
+ if (this ->_restrict_to_cylindrical_FOV )
142
158
{
143
159
const float radius = this ->_proj_data_info_sptr ->get_scanner_sptr ()->get_inner_ring_radius ();
144
160
const float image_radius = _helper->voxsize [2 ]*_helper->imgdim [2 ]/2 ;
0 commit comments