8 #include "iProjectorJoseph.hh" 9 #include "sOutputManager.hh" 100 if (
ReadStringOption(a_optionsList, option, 1,
",",
"Tolerance factor for plane index computation "))
102 Cerr(
"***** iProjectorJoseph::ReadConfigurationFile() -> Failed to correctly read the list of options !" << endl);
109 Cerr(
"***** iProjectorJoseph::ReadOptionsList() -> Tolerance factor parameter must be >2 (tolerance factor < 10^-2)" << endl);
110 Cerr(
" -> Provided parameter: "<< option[0] << endl);
127 cout <<
"This projector is a line projector that uses linear interpolation between pixels." << endl;
128 cout <<
"It is implemented from the following published paper:" << endl;
129 cout <<
"P. M. Joseph, \"An improved algorithm for reprojecting rays through pixel images\", IEEE Trans. Med. Imaging, vol. 1, pp. 192-6, 1982." << endl;
130 cout <<
"There is 1 optional parameter for this projector:" << endl;
131 cout <<
" tolerance_factor: x. -> 'x' must be an unsigned integer, and represent the tolerance precision factor for plane index computation (10^(-x))." << endl;
132 cout <<
" -> Default: 'x' = 6" << endl;
147 Cerr(
"***** iProjectorJoseph::CheckSpecificParameters() -> Tolerance factor must be defined in the specific interval : ]0 ; 1.e-2]" << endl);
148 Cerr(
"***** -> Default value is 1.e-6" << endl);
165 if (
m_verbose>=2)
Cout(
"iProjectorJoseph::InitializeSpecific() -> Use Joseph projector" << endl);
176 INTNB nElts = ( mp_nbVox[ 0 ] + 2 ) * ( mp_nbVox[ 1 ] + 2 ) * ( mp_nbVox[ 2 ] + 2 );
178 ::memset(
mp_maskPad, 0,
sizeof( uint8_t ) * nElts );
179 for(
INTNB k = 1; k < mp_nbVox[ 2 ] + 1; ++k )
181 for(
INTNB j = 1; j < mp_nbVox[ 1 ] + 1; ++j )
183 for(
INTNB i = 1; i < mp_nbVox[ 0 ] + 1; ++i )
185 mp_maskPad[ i + j * ( ( mp_nbVox[ 0 ] + 2 ) ) + k * ( mp_nbVox[ 0 ] + 2 ) * ( mp_nbVox[ 1 ] + 2 ) ] = 1;
216 max_nb_voxels_in_dimension *= 4;
218 return max_nb_voxels_in_dimension;
231 Cerr(
"***** iProjectorJoseph::ProjectWithoutTOF() -> Called while not initialized !" << endl);
236 #ifdef CASTOR_VERBOSE 239 string direction =
"";
240 if (a_direction==
FORWARD) direction =
"forward";
241 else direction =
"backward";
242 Cout(
"iProjectorJoseph::Project without TOF -> Project line '" << ap_ProjectionLine <<
"' in " << direction <<
" direction" << endl);
252 event2[ 0 ] - event1[ 0 ],
253 event2[ 1 ] - event1[ 1 ],
254 event2[ 2 ] - event1[ 2 ]
266 HPFLTNB alphaMin = 0.0, alphaMax = 1.0;
269 HPFLTNB pos[ 3 ] = { 0.0, 0.0, 0.0 };
270 HPFLTNB wfl[ 2 ] = { 0.0, 0.0 };
271 HPFLTNB wcl[ 2 ] = { 0.0, 0.0 };
272 HPFLTNB w[ 4 ] = { 0.0, 0.0, 0.0, 0.0 };
273 int16_t index[ 2 ] = { 0, 0 };
274 int32_t finalIdx = 0;
275 int8_t limitX1 = 1; int8_t limitX2 = 1;
276 int8_t limitY1 = 1; int8_t limitY2 = 1;
277 int8_t limitZ1 = 1; int8_t limitZ2 = 1;
280 if( ::fabs( r[ 0 ] ) > ::fabs( r[ 1 ] ) )
287 alphaMin = std::max( alphaMin, std::min( alphaX_0, alphaX_1 ) );
288 alphaMax = std::min( alphaMax, std::max( alphaX_0, alphaX_1 ) );
299 alphaMin = std::max( alphaMin, std::min( alphaY_0, alphaY_1 ) );
300 alphaMax = std::min( alphaMax, std::max( alphaY_0, alphaY_1 ) );
312 alphaMin = std::max( alphaMin, std::min( alphaZ_0, alphaZ_1 ) );
313 alphaMax = std::min( alphaMax, std::max( alphaZ_0, alphaZ_1 ) );
316 if( alphaMax <= alphaMin )
return 0;
318 if( r[ 1 ] == 0.0 )
if( event1[ 1 ] < -
mp_halfFOV[ 1 ] || event1[ 1 ] >
mp_halfFOV[ 1 ] )
return 0;
319 if( r[ 2 ] == 0.0 )
if( event1[ 2 ] < -
mp_halfFOV[ 2 ] || event1[ 2 ] >
mp_halfFOV[ 2 ] )
return 0;
322 HPFLTNB const factor( ::fabs( r[ 0 ] )
323 / ::sqrt( r2[ 0 ] + r2[ 1 ] + r2[ 2 ] ) );
334 int iMin = 0, iMax = 0;
340 else if( r[ 0 ] < 0.0 )
350 for(
int i = iMin; i < iMax; ++i )
354 pos[ 1 ] = event1[ 1 ] + step * ri[ 1 ];
355 pos[ 2 ] = event1[ 2 ] + step * ri[ 2 ];
362 if( index[ 0 ] <= 0 ) limitY1 = 0;
363 if( index[ 0 ] >= mp_nbVox[ 1 ] ) limitY2 = 0;
366 if( index[ 1 ] <= 0 ) limitZ1 = 0;
367 if( index[ 1 ] >= mp_nbVox[ 2 ] ) limitZ2 = 0;
370 finalIdx = i + ( index[ 0 ] - 1 ) * mp_nbVox[ 0 ] + ( index[ 1 ] - 1 ) *
m_nbVoxXY;
375 if ( limitY1 && limitZ1 && limitY2 && limitZ2 &&
382 wfl[ 0 ] = pos[ 1 ] - (
m_boundY + index[ 0 ] * mp_sizeVox[ 1 ] );
383 wfl[ 1 ] = pos[ 2 ] - (
m_boundZ + index[ 1 ] * mp_sizeVox[ 2 ] );
384 wfl[ 0 ] /= mp_sizeVox[ 1 ];
385 wfl[ 1 ] /= mp_sizeVox[ 2 ];
388 wcl[ 0 ] = 1.0 - wfl[ 0 ];
389 wcl[ 1 ] = 1.0 - wfl[ 1 ];
392 w[ 0 ] = wcl[ 0 ] * wcl[ 1 ];
393 w[ 1 ] = wcl[ 0 ] * wfl[ 1 ];
394 w[ 2 ] = wfl[ 0 ] * wfl[ 1 ];
395 w[ 3 ] = wfl[ 0 ] * wcl[ 1 ];
398 ap_ProjectionLine->
AddVoxel(a_direction, finalIdx * limitY1 * limitZ1, w[ 0 ] * weight * limitY1 * limitZ1);
399 ap_ProjectionLine->
AddVoxel(a_direction, ( finalIdx +
m_nbVoxXY ) * limitY1 * limitZ2, w[ 1 ] * weight * limitY1 * limitZ2);
400 ap_ProjectionLine->
AddVoxel(a_direction, ( finalIdx + mp_nbVox[ 0 ] +
m_nbVoxXY ) * limitY2 * limitZ2, w[ 2 ] * weight * limitY2 * limitZ2);
401 ap_ProjectionLine->
AddVoxel(a_direction, ( finalIdx + mp_nbVox[ 0 ] ) * limitY2 * limitZ1, w[ 3 ] * weight * limitY2 * limitZ1);
403 limitY1 = 1; limitY2 = 1;
404 limitZ1 = 1; limitZ2 = 1;
414 HPFLTNB const alphaX_0 = ( -
mp_halfFOV[ 0 ] - mp_sizeVox[ 0 ] * 0.5 - event1[ 0 ] )
416 HPFLTNB const alphaX_1 = (
mp_halfFOV[ 0 ] + mp_sizeVox[ 0 ] * 0.5 - event1[ 0 ] )
418 alphaMin = std::max( alphaMin, std::min( alphaX_0, alphaX_1 ) );
419 alphaMax = std::min( alphaMax, std::max( alphaX_0, alphaX_1 ) );
427 alphaMin = std::max( alphaMin, std::min( alphaY_0, alphaY_1 ) );
428 alphaMax = std::min( alphaMax, std::max( alphaY_0, alphaY_1 ) );
435 HPFLTNB const alphaZ_0 = ( -
mp_halfFOV[ 2 ] - mp_sizeVox[ 2 ] * 0.5 - event1[ 2 ] )
437 HPFLTNB const alphaZ_1 = (
mp_halfFOV[ 2 ] + mp_sizeVox[ 2 ] * 0.5 - event1[ 2 ] )
439 alphaMin = std::max( alphaMin, std::min( alphaZ_0, alphaZ_1 ) );
440 alphaMax = std::min( alphaMax, std::max( alphaZ_0, alphaZ_1 ) );
443 if( alphaMax <= alphaMin )
return 0;
445 if( r[ 0 ] == 0.0 )
if( event1[ 0 ] < -
mp_halfFOV[ 0 ] || event1[ 0 ] >
mp_halfFOV[ 0 ] )
return 0;
446 if( r[ 2 ] == 0.0 )
if( event1[ 2 ] < -
mp_halfFOV[ 2 ] || event1[ 2 ] >
mp_halfFOV[ 2 ] )
return 0;
449 HPFLTNB const factor( ::fabs( r[ 1 ] ) / ::sqrt( r2[ 0 ] + r2[ 1 ] + r2[ 2 ] ) );
450 HPFLTNB const weight( mp_sizeVox[ 1 ] / factor );
460 int jMin = 0, jMax = 0;
463 jMin = ::ceil( mp_nbVox[ 1 ] -
m_toleranceY - (
mp_halfFOV[ 1 ] - alphaMin * r[ 1 ] - event1[ 1 ] ) / mp_sizeVox[ 1 ] );
464 jMax = ::floor(
m_toleranceY + ( event1[ 1 ] + alphaMax * r[ 1 ] - (-
mp_halfFOV[ 1 ]) ) / mp_sizeVox[ 1 ] );
466 else if( r[ 1 ] < 0.0 )
468 jMin = ::ceil( mp_nbVox[ 1 ] -
m_toleranceY - (
mp_halfFOV[ 1 ] - alphaMax * r[ 1 ] - event1[ 1 ] ) / mp_sizeVox[ 1 ] );
469 jMax = ::floor(
m_toleranceY + ( event1[ 1 ] + alphaMin * r[ 1 ] - (-
mp_halfFOV[ 1 ]) ) / mp_sizeVox[ 1 ] );
473 HPFLTNB const offset = -
mp_halfFOV[ 1 ] + ( mp_sizeVox[ 1 ] * 0.5 ) - event1[ 1 ];
476 for(
int j = jMin; j < jMax; ++j )
479 HPFLTNB const step = offset + j * mp_sizeVox[ 1 ];
480 pos[ 0 ] = event1[ 0 ] + step * ri[ 0 ];
481 pos[ 2 ] = event1[ 2 ] + step * ri[ 2 ];
488 finalIdx = ( index[ 0 ] - 1 ) + j * mp_nbVox[ 0 ] + ( index[ 1 ] - 1 ) *
m_nbVoxXY;
491 if( index[ 0 ] <= 0 ) limitX1 = 0;
492 if( index[ 0 ] >= mp_nbVox[ 0 ] ) limitX2 = 0;
495 if( index[ 1 ] <= 0 ) limitZ1 = 0;
496 if( index[ 1 ] >= mp_nbVox[ 2 ] ) limitZ2 = 0;
501 if ( limitX1 && limitZ1 && limitX2 && limitZ2 &&
508 wfl[ 0 ] = pos[ 0 ] - (
m_boundX + index[ 0 ] * mp_sizeVox[ 0 ] );
509 wfl[ 1 ] = pos[ 2 ] - (
m_boundZ + index[ 1 ] * mp_sizeVox[ 2 ] );
510 wfl[ 0 ] /= mp_sizeVox[ 0 ];
511 wfl[ 1 ] /= mp_sizeVox[ 2 ];
514 wcl[ 0 ] = 1.0 - wfl[ 0 ];
515 wcl[ 1 ] = 1.0 - wfl[ 1 ];
518 w[ 0 ] = wcl[ 0 ] * wcl[ 1 ];
519 w[ 1 ] = wcl[ 0 ] * wfl[ 1 ];
520 w[ 2 ] = wfl[ 0 ] * wfl[ 1 ];
521 w[ 3 ] = wfl[ 0 ] * wcl[ 1 ];
523 ap_ProjectionLine->
AddVoxel(a_direction, finalIdx * limitX1 * limitZ1, w[ 0 ] * weight * limitX1 * limitZ1);
524 ap_ProjectionLine->
AddVoxel(a_direction, ( finalIdx +
m_nbVoxXY ) * limitX1 * limitZ2, w[ 1 ] * weight * limitX1 * limitZ2);
525 ap_ProjectionLine->
AddVoxel(a_direction, ( finalIdx + 1 +
m_nbVoxXY ) * limitX2 * limitZ2, w[ 2 ] * weight * limitX2 * limitZ2);
526 ap_ProjectionLine->
AddVoxel(a_direction, ( finalIdx + 1 ) * limitX2 * limitZ1, w[ 3 ] * weight * limitX2 * limitZ1);
528 limitX1 = 1; limitX2 = 1;
529 limitZ1 = 1; limitZ2 = 1;
547 Cerr(
"***** iProjectorJoseph::ProjectTOFListmode() -> Called while not initialized !" << endl);
552 #ifdef CASTOR_VERBOSE 555 string direction =
"";
556 if (a_direction==
FORWARD) direction =
"forward";
557 else direction =
"backward";
558 Cout(
"iProjectorJoseph::Project with TOF measurement -> Project line '" << ap_ProjectionLine <<
"' in " << direction <<
" direction" << endl);
568 event2[ 0 ] - event1[ 0 ],
569 event2[ 1 ] - event1[ 1 ],
570 event2[ 2 ] - event1[ 2 ]
593 HPFLTNB tof_sigma_sqrt2 = sqrt(2.)*tof_sigma;
601 HPFLTNB lor_tof_center = lor_length * 0.5 + tof_delta;
604 HPFLTNB tof_edge_low[] = {0,0,0};
606 HPFLTNB tof_edge_high[] = {0,0,0};
611 for (
int ax=0;ax<3;ax++)
614 tof_center = event1[ax] + lor_tof_center * r[ax] / lor_length;
617 tof_edge_low[ax] = tof_center - tof_half_span * fabs(r[ax]) / lor_length;
618 tof_index = max( (
INTNB)::floor( (tof_edge_low[ax] - (-
mp_halfFOV[ax])) / mp_sizeVox[ax] ), (
INTNB)0);
620 if (tof_index>mp_nbVox[ax]-1)
return 0;
624 tof_edge_high[ax] = tof_center + tof_half_span * fabs(r[ax]) / lor_length;
625 tof_index = min( (
INTNB)::floor( (tof_edge_high[ax] - (-
mp_halfFOV[ax])) / mp_sizeVox[ax] ), mp_nbVox[ax]-1);
627 if (tof_index<0)
return 0;
633 HPFLTNB alphaMin = 0.0, alphaMax = 1.0;
636 HPFLTNB pos[ 3 ] = { 0.0, 0.0, 0.0 };
637 HPFLTNB wfl[ 2 ] = { 0.0, 0.0 };
638 HPFLTNB wcl[ 2 ] = { 0.0, 0.0 };
639 HPFLTNB w[ 4 ] = { 0.0, 0.0, 0.0, 0.0 };
640 int16_t index[ 2 ] = { 0, 0 };
641 int32_t finalIdx = 0;
642 int8_t limitX1 = 1; int8_t limitX2 = 1;
643 int8_t limitY1 = 1; int8_t limitY2 = 1;
644 int8_t limitZ1 = 1; int8_t limitZ2 = 1;
647 if( ::fabs( r[ 0 ] ) > ::fabs( r[ 1 ] ) )
652 HPFLTNB const alphaX_0 = ( tof_edge_low[ 0 ] - event1[ 0 ] ) / r[ 0 ];
653 HPFLTNB const alphaX_1 = ( tof_edge_high[ 0 ] - event1[ 0 ] ) / r[ 0 ];
654 alphaMin = std::max( alphaMin, std::min( alphaX_0, alphaX_1 ) );
655 alphaMax = std::min( alphaMax, std::max( alphaX_0, alphaX_1 ) );
662 HPFLTNB const alphaY_0 = ( tof_edge_low[ 1 ] - mp_sizeVox[ 1 ] * 0.5 - event1[ 1 ] )
664 HPFLTNB const alphaY_1 = ( tof_edge_high[ 1 ] + mp_sizeVox[ 1 ] * 0.5 - event1[ 1 ] )
666 alphaMin = std::max( alphaMin, std::min( alphaY_0, alphaY_1 ) );
667 alphaMax = std::min( alphaMax, std::max( alphaY_0, alphaY_1 ) );
675 HPFLTNB const alphaZ_0 = ( tof_edge_low[ 2 ] - mp_sizeVox[ 2 ] * 0.5 - event1[ 2 ] )
677 HPFLTNB const alphaZ_1 = ( tof_edge_high[ 2 ] + mp_sizeVox[ 2 ] * 0.5 - event1[ 2 ] )
679 alphaMin = std::max( alphaMin, std::min( alphaZ_0, alphaZ_1 ) );
680 alphaMax = std::min( alphaMax, std::max( alphaZ_0, alphaZ_1 ) );
683 if( alphaMax <= alphaMin )
return 0;
685 if( r[ 1 ] == 0.0 )
if( event1[ 1 ] < -
mp_halfFOV[ 1 ] || event1[ 1 ] >
mp_halfFOV[ 1 ] )
return 0;
686 if( r[ 2 ] == 0.0 )
if( event1[ 2 ] < -
mp_halfFOV[ 2 ] || event1[ 2 ] >
mp_halfFOV[ 2 ] )
return 0;
689 HPFLTNB const factor( ::fabs( r[ 0 ] ) / lor_length );
690 HPFLTNB const factor_for_tof( lor_length / r[ 0 ]) ;
691 HPFLTNB const weight( mp_sizeVox[ 0 ] / factor );
701 int iMin = 0, iMax = 0;
704 iMin = ::ceil( mp_nbVox[ 0 ] -
m_toleranceX - (
mp_halfFOV[ 0 ] - alphaMin * r[ 0 ] - event1[ 0 ] ) / mp_sizeVox[ 0 ] );
705 iMax = ::floor(
m_toleranceX + ( event1[ 0 ] + alphaMax * r[ 0 ] - (-
mp_halfFOV[ 0 ]) ) / mp_sizeVox[ 0 ] );
707 else if( r[ 0 ] < 0.0 )
709 iMin = ::ceil( mp_nbVox[ 0 ] -
m_toleranceX - (
mp_halfFOV[ 0 ] - alphaMax * r[ 0 ] - event1[ 0 ] ) / mp_sizeVox[ 0 ] );
710 iMax = ::floor(
m_toleranceX + ( event1[ 0 ] + alphaMin * r[ 0 ] - (-
mp_halfFOV[ 0 ]) ) / mp_sizeVox[ 0 ] );
714 HPFLTNB const offset = -
mp_halfFOV[ 0 ] + ( mp_sizeVox[ 0 ] * 0.5 ) - event1[ 0 ];
722 for(
int i = iMin; i < iMax; ++i )
725 HPFLTNB const step = offset + i * mp_sizeVox[ 0 ];
726 pos[ 1 ] = event1[ 1 ] + step * ri[ 1 ];
727 pos[ 2 ] = event1[ 2 ] + step * ri[ 2 ];
734 finalIdx = i + ( index[ 0 ] - 1 ) * mp_nbVox[ 0 ] + ( index[ 1 ] - 1 ) *
m_nbVoxXY;
737 if( index[ 0 ] <= 0 ) limitY1 = 0;
738 if( index[ 0 ] >= mp_nbVox[ 1 ] ) limitY2 = 0;
741 if( index[ 1 ] <= 0 ) limitZ1 = 0;
742 if( index[ 1 ] >= mp_nbVox[ 2 ] ) limitZ2 = 0;
747 if ( limitY1 && limitZ1 && limitY2 && limitZ2 &&
754 wfl[ 0 ] = pos[ 1 ] - (
m_boundY + index[ 0 ] * mp_sizeVox[ 1 ] );
755 wfl[ 1 ] = pos[ 2 ] - (
m_boundZ + index[ 1 ] * mp_sizeVox[ 2 ] );
756 wfl[ 0 ] /= mp_sizeVox[ 1 ];
757 wfl[ 1 ] /= mp_sizeVox[ 2 ];
760 wcl[ 0 ] = 1.0 - wfl[ 0 ];
761 wcl[ 1 ] = 1.0 - wfl[ 1 ];
764 w[ 0 ] = wcl[ 0 ] * wcl[ 1 ];
765 w[ 1 ] = wcl[ 0 ] * wfl[ 1 ];
766 w[ 2 ] = wfl[ 0 ] * wfl[ 1 ];
767 w[ 3 ] = wfl[ 0 ] * wcl[ 1 ];
791 HPFLTNB temp_erf = std::min(tof_half_span, std::max(-tof_half_span, lor_tof_center -
m_TOFBinSizeInMm/2. - step * factor_for_tof));
792 HPFLTNB prev_erf = erf(temp_erf/tof_sigma_sqrt2);
793 temp_erf = std::min(tof_half_span, std::max(-tof_half_span, lor_tof_center +
m_TOFBinSizeInMm/2. - step * factor_for_tof));
794 HPFLTNB new_erf = erf(temp_erf/tof_sigma_sqrt2);
801 HPFLTNB temp = ( step * factor_for_tof - lor_tof_center ) / tof_sigma;
806 ap_ProjectionLine->
AddVoxel(a_direction, finalIdx * limitY1 * limitZ1, w[ 0 ] * weight * tof_weight * limitY1 * limitZ1);
807 ap_ProjectionLine->
AddVoxel(a_direction, ( finalIdx +
m_nbVoxXY ) * limitY1 * limitZ2, w[ 1 ] * weight * tof_weight * limitY1 * limitZ2);
808 ap_ProjectionLine->
AddVoxel(a_direction, ( finalIdx + mp_nbVox[ 0 ] +
m_nbVoxXY ) * limitY2 * limitZ2, w[ 2 ] * weight * tof_weight * limitY2 * limitZ2);
809 ap_ProjectionLine->
AddVoxel(a_direction, ( finalIdx + mp_nbVox[ 0 ] ) * limitY2 * limitZ1, w[ 3 ] * weight * tof_weight * limitY2 * limitZ1);
811 limitY1 = 1.0; limitY2 = 1.0;
812 limitZ1 = 1.0; limitZ2 = 1.0;
822 HPFLTNB const alphaX_0 = ( tof_edge_low[ 0 ] - mp_sizeVox[ 0 ] * 0.5 - event1[ 0 ] )
824 HPFLTNB const alphaX_1 = ( tof_edge_high[ 0 ] + mp_sizeVox[ 0 ] * 0.5 - event1[ 0 ] )
826 alphaMin = std::max( alphaMin, std::min( alphaX_0, alphaX_1 ) );
827 alphaMax = std::min( alphaMax, std::max( alphaX_0, alphaX_1 ) );
833 HPFLTNB const alphaY_0 = ( tof_edge_low[ 1 ] - event1[ 1 ] ) / r[ 1 ];
834 HPFLTNB const alphaY_1 = ( tof_edge_high[ 1 ] - event1[ 1 ] ) / r[ 1 ];
835 alphaMin = std::max( alphaMin, std::min( alphaY_0, alphaY_1 ) );
836 alphaMax = std::min( alphaMax, std::max( alphaY_0, alphaY_1 ) );
843 HPFLTNB const alphaZ_0 = ( tof_edge_low[ 2 ] - mp_sizeVox[ 2 ] * 0.5 - event1[ 2 ] )
845 HPFLTNB const alphaZ_1 = ( tof_edge_high[ 2 ] + mp_sizeVox[ 2 ] * 0.5 - event1[ 2 ] )
847 alphaMin = std::max( alphaMin, std::min( alphaZ_0, alphaZ_1 ) );
848 alphaMax = std::min( alphaMax, std::max( alphaZ_0, alphaZ_1 ) );
851 if( alphaMax <= alphaMin )
return 0;
853 if( r[ 0 ] == 0.0 )
if( event1[ 0 ] < -
mp_halfFOV[ 0 ] || event1[ 0 ] >
mp_halfFOV[ 0 ] )
return 0;
854 if( r[ 2 ] == 0.0 )
if( event1[ 2 ] < -
mp_halfFOV[ 2 ] || event1[ 2 ] >
mp_halfFOV[ 2 ] )
return 0;
857 HPFLTNB const factor( ::fabs( r[ 1 ] ) / lor_length );
858 HPFLTNB const factor_for_tof( lor_length / r[ 1 ] );
859 HPFLTNB const weight( mp_sizeVox[ 1 ] / factor );
869 int jMin = 0, jMax = 0;
872 jMin = ::ceil( mp_nbVox[ 1 ] -
m_toleranceY - (
mp_halfFOV[ 1 ] - alphaMin * r[ 1 ] - event1[ 1 ] ) / mp_sizeVox[ 1 ] );
873 jMax = ::floor(
m_toleranceY + ( event1[ 1 ] + alphaMax * r[ 1 ] - (-
mp_halfFOV[ 1 ]) ) / mp_sizeVox[ 1 ] );
875 else if( r[ 1 ] < 0.0 )
877 jMin = ::ceil( mp_nbVox[ 1 ] -
m_toleranceY - (
mp_halfFOV[ 1 ] - alphaMax * r[ 1 ] - event1[ 1 ] ) / mp_sizeVox[ 1 ] );
878 jMax = ::floor(
m_toleranceY + ( event1[ 1 ] + alphaMin * r[ 1 ] - (-
mp_halfFOV[ 1 ]) ) / mp_sizeVox[ 1 ] );
887 HPFLTNB const offset = -
mp_halfFOV[ 1 ] + ( mp_sizeVox[ 1 ] * 0.5 ) - event1[ 1 ];
890 for(
int j = jMin; j < jMax; ++j )
893 HPFLTNB const step = offset + j * mp_sizeVox[ 1 ];
894 pos[ 0 ] = event1[ 0 ] + step * ri[ 0 ];
895 pos[ 2 ] = event1[ 2 ] + step * ri[ 2 ];
902 finalIdx = ( index[ 0 ] - 1 ) + j * mp_nbVox[ 0 ] + ( index[ 1 ] - 1 ) *
m_nbVoxXY;
905 if( index[ 0 ] <= 0 ) limitX1 = 0;
906 if( index[ 0 ] >= mp_nbVox[ 0 ] ) limitX2 = 0;
909 if( index[ 1 ] <= 0 ) limitZ1 = 0;
910 if( index[ 1 ] >= mp_nbVox[ 2 ] ) limitZ2 = 0;
915 if ( limitX1 && limitZ1 && limitX2 && limitZ2 &&
922 wfl[ 0 ] = pos[ 0 ] - (
m_boundX + index[ 0 ] * mp_sizeVox[ 0 ] );
923 wfl[ 1 ] = pos[ 2 ] - (
m_boundZ + index[ 1 ] * mp_sizeVox[ 2 ] );
924 wfl[ 0 ] /= mp_sizeVox[ 0 ];
925 wfl[ 1 ] /= mp_sizeVox[ 2 ];
928 wcl[ 0 ] = 1.0 - wfl[ 0 ];
929 wcl[ 1 ] = 1.0 - wfl[ 1 ];
932 w[ 0 ] = wcl[ 0 ] * wcl[ 1 ];
933 w[ 1 ] = wcl[ 0 ] * wfl[ 1 ];
934 w[ 2 ] = wfl[ 0 ] * wfl[ 1 ];
935 w[ 3 ] = wfl[ 0 ] * wcl[ 1 ];
959 HPFLTNB temp_erf = std::min(tof_half_span, std::max(-tof_half_span, lor_tof_center -
m_TOFBinSizeInMm/2. - step * factor_for_tof));
960 HPFLTNB prev_erf = erf(temp_erf/tof_sigma_sqrt2);
961 temp_erf = std::min(tof_half_span, std::max(-tof_half_span, lor_tof_center +
m_TOFBinSizeInMm/2. - step * factor_for_tof));
962 HPFLTNB new_erf = erf(temp_erf/tof_sigma_sqrt2);
969 HPFLTNB temp = ( step * factor_for_tof - lor_tof_center ) / tof_sigma;
974 ap_ProjectionLine->
AddVoxel(a_direction, finalIdx * limitX1 * limitZ1, w[ 0 ] * weight * tof_weight * limitX1 * limitZ1);
975 ap_ProjectionLine->
AddVoxel(a_direction, ( finalIdx +
m_nbVoxXY ) * limitX1 * limitZ2, w[ 1 ] * weight * tof_weight * limitX1 * limitZ2);
976 ap_ProjectionLine->
AddVoxel(a_direction, ( finalIdx + 1 +
m_nbVoxXY ) * limitX2 * limitZ2, w[ 2 ] * weight * tof_weight * limitX2 * limitZ2);
977 ap_ProjectionLine->
AddVoxel(a_direction, ( finalIdx + 1 ) * limitX2 * limitZ1, w[ 3 ] * weight * tof_weight * limitX2 * limitZ1);
979 limitX1 = 1; limitX2 = 1;
980 limitZ1 = 1; limitZ2 = 1;
996 Cerr(
"***** iProjectorJoseph::ProjectTOFHistogram() -> Called while not initialized !" << endl);
1001 #ifdef CASTOR_VERBOSE 1004 string direction =
"";
1005 if (a_direction==
FORWARD) direction =
"forward";
1006 else direction =
"backward";
1007 Cout(
"iProjectorJoseph::Project with TOF bins -> Project line '" << ap_ProjectionLine <<
"' in " << direction <<
" direction" << endl);
1017 event2[ 0 ] - event1[ 0 ],
1018 event2[ 1 ] - event1[ 1 ],
1019 event2[ 2 ] - event1[ 2 ]
1024 HPFLTNB lor_length_half = lor_length * 0.5;
1028 INTNB tof_half_nb_bins = tof_nb_bins/2;
1032 HPFLTNB tof_sigma_sqrt2 = sqrt(2.)*tof_sigma;
1038 HPFLTNB prev_erf = 0., new_erf = 0.;
1041 INTNB tof_bin_last = tof_half_nb_bins;
1042 INTNB tof_bin_first = -tof_half_nb_bins;
1050 INTNB tof_bin_first_for_voxel = 0, tof_bin_last_for_voxel = 0;
1063 HPFLTNB alphaMin = 0.0, alphaMax = 1.0;
1066 HPFLTNB pos[ 3 ] = { 0.0, 0.0, 0.0 };
1067 HPFLTNB wfl[ 2 ] = { 0.0, 0.0 };
1068 HPFLTNB wcl[ 2 ] = { 0.0, 0.0 };
1069 HPFLTNB w[ 4 ] = { 0.0, 0.0, 0.0, 0.0 };
1070 int16_t index[ 2 ] = { 0, 0 };
1071 int32_t finalIdx = 0;
1072 int8_t limitX1 = 1; int8_t limitX2 = 1;
1073 int8_t limitY1 = 1; int8_t limitY2 = 1;
1074 int8_t limitZ1 = 1; int8_t limitZ2 = 1;
1077 if( ::fabs( r[ 0 ] ) > ::fabs( r[ 1 ] ) )
1084 alphaMin = std::max( alphaMin, std::min( alphaX_0, alphaX_1 ) );
1085 alphaMax = std::min( alphaMax, std::max( alphaX_0, alphaX_1 ) );
1092 HPFLTNB const alphaY_0 = ( -
mp_halfFOV[ 1 ] - mp_sizeVox[ 1 ] * 0.5 - event1[ 1 ] )
1094 HPFLTNB const alphaY_1 = (
mp_halfFOV[ 1 ] + mp_sizeVox[ 1 ] * 0.5 - event1[ 1 ] )
1096 alphaMin = std::max( alphaMin, std::min( alphaY_0, alphaY_1 ) );
1097 alphaMax = std::min( alphaMax, std::max( alphaY_0, alphaY_1 ) );
1105 HPFLTNB const alphaZ_0 = ( -
mp_halfFOV[ 2 ] - mp_sizeVox[ 2 ] * 0.5 - event1[ 2 ] )
1107 HPFLTNB const alphaZ_1 = (
mp_halfFOV[ 2 ] + mp_sizeVox[ 2 ] * 0.5 - event1[ 2 ] )
1109 alphaMin = std::max( alphaMin, std::min( alphaZ_0, alphaZ_1 ) );
1110 alphaMax = std::min( alphaMax, std::max( alphaZ_0, alphaZ_1 ) );
1113 if( alphaMax <= alphaMin )
return 0;
1115 if( r[ 1 ] == 0.0 )
if( event1[ 1 ] < -
mp_halfFOV[ 1 ] || event1[ 1 ] >
mp_halfFOV[ 1 ] )
return 0;
1116 if( r[ 2 ] == 0.0 )
if( event1[ 2 ] < -
mp_halfFOV[ 2 ] || event1[ 2 ] >
mp_halfFOV[ 2 ] )
return 0;
1121 for (
INTNB tof_bin=0; tof_bin<tof_nb_bins; tof_bin++) tof_weights_temp[tof_bin] = 0.;
1124 HPFLTNB const factor( ::fabs( r[ 0 ] ) / lor_length );
1125 HPFLTNB const factor_for_tof( lor_length / r[ 0 ] );
1126 HPFLTNB const weight( mp_sizeVox[ 0 ] / factor );
1136 int iMin = 0, iMax = 0;
1139 iMin = ::ceil( mp_nbVox[ 0 ] -
m_toleranceX - (
mp_halfFOV[ 0 ] - alphaMin * r[ 0 ] - event1[ 0 ] ) / mp_sizeVox[ 0 ] );
1140 iMax = ::floor(
m_toleranceX + ( event1[ 0 ] + alphaMax * r[ 0 ] - (-
mp_halfFOV[ 0 ]) ) / mp_sizeVox[ 0 ] );
1142 else if( r[ 0 ] < 0.0 )
1144 iMin = ::ceil( mp_nbVox[ 0 ] -
m_toleranceX - (
mp_halfFOV[ 0 ] - alphaMax * r[ 0 ] - event1[ 0 ] ) / mp_sizeVox[ 0 ] );
1145 iMax = ::floor(
m_toleranceX + ( event1[ 0 ] + alphaMin * r[ 0 ] - (-
mp_halfFOV[ 0 ]) ) / mp_sizeVox[ 0 ] );
1149 HPFLTNB const offset = -
mp_halfFOV[ 0 ] + ( mp_sizeVox[ 0 ] * 0.5 ) - event1[ 0 ];
1152 for(
int i = iMin; i < iMax; ++i )
1155 HPFLTNB const step = offset + i * mp_sizeVox[ 0 ];
1156 pos[ 1 ] = event1[ 1 ] + step * ri[ 1 ];
1157 pos[ 2 ] = event1[ 2 ] + step * ri[ 2 ];
1163 finalIdx = i + ( index[ 0 ] - 1 ) * mp_nbVox[ 0 ] + ( index[ 1 ] - 1 ) *
m_nbVoxXY;
1166 if( index[ 0 ] <= 0 ) limitY1 = 0;
1167 if( index[ 0 ] >= mp_nbVox[ 1 ] ) limitY2 = 0;
1170 if( index[ 1 ] <= 0 ) limitZ1 = 0;
1171 if( index[ 1 ] >= mp_nbVox[ 2 ] ) limitZ2 = 0;
1176 if ( limitY1 && limitZ1 && limitY2 && limitZ2 &&
1192 tof_bin_first_for_voxel = max(tof_bin_first , (
INTNB)(ceil( (step * factor_for_tof - tof_half_span - lor_length_half ) /
m_TOFBinSizeInMm )));
1193 tof_bin_last_for_voxel = min(tof_bin_last , (
INTNB)(floor( (step * factor_for_tof + tof_half_span - lor_length_half) /
m_TOFBinSizeInMm )));
1196 lor_tof_center = lor_length_half + tof_bin_first_for_voxel *
m_TOFBinSizeInMm;
1199 tof_bin_first_for_voxel += tof_half_nb_bins;
1200 tof_bin_last_for_voxel += tof_half_nb_bins;
1206 HPFLTNB temp = std::min(tof_half_span,std::max(-tof_half_span, lor_tof_center - m_TOFBinSizeInMm/2. - step * factor_for_tof));
1207 prev_erf = erf(temp/tof_sigma_sqrt2);
1212 for (
INTNB tof_bin=tof_bin_first_for_voxel; tof_bin<=tof_bin_last_for_voxel; tof_bin++)
1232 HPFLTNB temp = std::min(tof_half_span,std::max(-tof_half_span, lor_tof_center + m_TOFBinSizeInMm/2. - step * factor_for_tof));
1233 new_erf = erf(temp/tof_sigma_sqrt2);
1234 tof_weights_temp[tof_bin] = 0.5 * fabs(new_erf - prev_erf);
1244 HPFLTNB temp = ( step * factor_for_tof - lor_tof_center) / tof_sigma;
1256 wfl[ 0 ] = pos[ 1 ] - (
m_boundY + index[ 0 ] * mp_sizeVox[ 1 ] );
1257 wfl[ 1 ] = pos[ 2 ] - (
m_boundZ + index[ 1 ] * mp_sizeVox[ 2 ] );
1258 wfl[ 0 ] /= mp_sizeVox[ 1 ];
1259 wfl[ 1 ] /= mp_sizeVox[ 2 ];
1262 wcl[ 0 ] = 1.0 - wfl[ 0 ];
1263 wcl[ 1 ] = 1.0 - wfl[ 1 ];
1266 w[ 0 ] = wcl[ 0 ] * wcl[ 1 ];
1267 w[ 1 ] = wcl[ 0 ] * wfl[ 1 ];
1268 w[ 2 ] = wfl[ 0 ] * wfl[ 1 ];
1269 w[ 3 ] = wfl[ 0 ] * wcl[ 1 ];
1278 ap_ProjectionLine->
AddVoxelAllTOFBins(a_direction, finalIdx * limitY1 * limitZ1, w[ 0 ] * weight * limitY1 * limitZ1, tof_weights_temp, tof_bin_first_for_voxel, tof_bin_last_for_voxel);
1279 ap_ProjectionLine->
AddVoxelAllTOFBins(a_direction, ( finalIdx +
m_nbVoxXY ) * limitY1 * limitZ2, w[ 1 ] * weight * limitY1 * limitZ2 , tof_weights_temp, tof_bin_first_for_voxel, tof_bin_last_for_voxel);
1280 ap_ProjectionLine->
AddVoxelAllTOFBins(a_direction, ( finalIdx + mp_nbVox[ 0 ] +
m_nbVoxXY ) * limitY2 * limitZ2, w[ 2 ] * weight * limitY2 * limitZ2 , tof_weights_temp, tof_bin_first_for_voxel, tof_bin_last_for_voxel);
1281 ap_ProjectionLine->
AddVoxelAllTOFBins(a_direction, ( finalIdx + mp_nbVox[ 0 ] ) * limitY2 * limitZ1, w[ 3 ] * weight * limitY2 * limitZ1 , tof_weights_temp, tof_bin_first_for_voxel, tof_bin_last_for_voxel);
1284 limitY1 = 1.0; limitY2 = 1.0;
1285 limitZ1 = 1.0; limitZ2 = 1.0;
1287 delete[] tof_weights_temp;
1296 HPFLTNB const alphaX_0 = ( -
mp_halfFOV[ 0 ] - mp_sizeVox[ 0 ] * 0.5 - event1[ 0 ] )
1298 HPFLTNB const alphaX_1 = (
mp_halfFOV[ 0 ] + mp_sizeVox[ 0 ] * 0.5 - event1[ 0 ] )
1300 alphaMin = std::max( alphaMin, std::min( alphaX_0, alphaX_1 ) );
1301 alphaMax = std::min( alphaMax, std::max( alphaX_0, alphaX_1 ) );
1309 alphaMin = std::max( alphaMin, std::min( alphaY_0, alphaY_1 ) );
1310 alphaMax = std::min( alphaMax, std::max( alphaY_0, alphaY_1 ) );
1317 HPFLTNB const alphaZ_0 = ( -
mp_halfFOV[ 2 ] - mp_sizeVox[ 2 ] * 0.5 - event1[ 2 ] )
1319 HPFLTNB const alphaZ_1 = (
mp_halfFOV[ 2 ] + mp_sizeVox[ 2 ] * 0.5 - event1[ 2 ] )
1321 alphaMin = std::max( alphaMin, std::min( alphaZ_0, alphaZ_1 ) );
1322 alphaMax = std::min( alphaMax, std::max( alphaZ_0, alphaZ_1 ) );
1325 if( alphaMax <= alphaMin )
return 0;
1327 if( r[ 0 ] == 0.0 )
if( event1[ 0 ] < -
mp_halfFOV[ 0 ] || event1[ 0 ] >
mp_halfFOV[ 0 ] )
return 0;
1328 if( r[ 2 ] == 0.0 )
if( event1[ 2 ] < -
mp_halfFOV[ 2 ] || event1[ 2 ] >
mp_halfFOV[ 2 ] )
return 0;
1332 for (
INTNB tof_bin=0; tof_bin<tof_nb_bins; tof_bin++) tof_weights_temp[tof_bin] = 0.;
1335 HPFLTNB const factor( ::fabs( r[ 1 ] ) / lor_length );
1336 HPFLTNB const factor_for_tof( lor_length / r[ 1 ] );
1337 HPFLTNB const weight( mp_sizeVox[ 1 ] / factor );
1347 int jMin = 0, jMax = 0;
1350 jMin = ::ceil( mp_nbVox[ 1 ] -
m_toleranceY - (
mp_halfFOV[ 1 ] - alphaMin * r[ 1 ] - event1[ 1 ] ) / mp_sizeVox[ 1 ] );
1351 jMax = ::floor(
m_toleranceY + ( event1[ 1 ] + alphaMax * r[ 1 ] - (-
mp_halfFOV[ 1 ]) ) / mp_sizeVox[ 1 ] );
1353 else if( r[ 1 ] < 0.0 )
1355 jMin = ::ceil( mp_nbVox[ 1 ] -
m_toleranceY - (
mp_halfFOV[ 1 ] - alphaMax * r[ 1 ] - event1[ 1 ] ) / mp_sizeVox[ 1 ] );
1356 jMax = ::floor(
m_toleranceY + ( event1[ 1 ] + alphaMin * r[ 1 ] - (-
mp_halfFOV[ 1 ]) ) / mp_sizeVox[ 1 ] );
1360 HPFLTNB const offset = -
mp_halfFOV[ 1 ] + ( mp_sizeVox[ 1 ] * 0.5 ) - event1[ 1 ];
1363 for(
int j = jMin; j < jMax; ++j )
1366 HPFLTNB const step = offset + j * mp_sizeVox[ 1 ];
1367 pos[ 0 ] = event1[ 0 ] + step * ri[ 0 ];
1368 pos[ 2 ] = event1[ 2 ] + step * ri[ 2 ];
1374 finalIdx = ( index[ 0 ] - 1 ) + j * mp_nbVox[ 0 ] + ( index[ 1 ] - 1 ) *
m_nbVoxXY;
1377 if( index[ 0 ] <= 0 ) limitX1 = 0;
1378 if( index[ 0 ] >= mp_nbVox[ 0 ] ) limitX2 = 0;
1381 if( index[ 1 ] <= 0 ) limitZ1 = 0;
1382 if( index[ 1 ] >= mp_nbVox[ 2 ] ) limitZ2 = 0;
1387 if ( limitX1 && limitZ1 && limitX2 && limitZ2 &&
1397 tof_bin_first_for_voxel = max(tof_bin_first , (
INTNB)(floor( (step * factor_for_tof - tof_half_span - lor_length_half - m_TOFBinSizeInMm/2.) / m_TOFBinSizeInMm )));
1398 tof_bin_last_for_voxel = min(tof_bin_last , (
INTNB)(ceil( (step * factor_for_tof + tof_half_span - lor_length_half + m_TOFBinSizeInMm/2.) / m_TOFBinSizeInMm )));
1403 tof_bin_first_for_voxel = max(tof_bin_first , (
INTNB)(ceil( (step * factor_for_tof - tof_half_span - lor_length_half ) / m_TOFBinSizeInMm )));
1404 tof_bin_last_for_voxel = min(tof_bin_last , (
INTNB)(floor( (step * factor_for_tof + tof_half_span - lor_length_half) / m_TOFBinSizeInMm )));
1407 lor_tof_center = lor_length_half + tof_bin_first_for_voxel *
m_TOFBinSizeInMm;
1410 if(tof_bin_first_for_voxel>tof_bin_last || tof_bin_last_for_voxel<tof_bin_first)
continue;
1413 tof_bin_first_for_voxel += tof_half_nb_bins;
1414 tof_bin_last_for_voxel += tof_half_nb_bins;
1420 HPFLTNB temp = std::min(tof_half_span,std::max(-tof_half_span, lor_tof_center - m_TOFBinSizeInMm/2. - step * factor_for_tof));
1421 prev_erf = erf(temp/tof_sigma_sqrt2);
1426 for (
INTNB tof_bin=tof_bin_first_for_voxel; tof_bin<=tof_bin_last_for_voxel; tof_bin++)
1446 HPFLTNB temp = std::min(tof_half_span,std::max(-tof_half_span, lor_tof_center + m_TOFBinSizeInMm/2. - step * factor_for_tof));
1447 new_erf = erf(temp/tof_sigma_sqrt2);
1448 tof_weights_temp[tof_bin] = 0.5 * fabs(new_erf - prev_erf);
1458 HPFLTNB temp = ( step * factor_for_tof - lor_tof_center) / tof_sigma;
1470 wfl[ 0 ] = pos[ 0 ] - (
m_boundX + index[ 0 ] * mp_sizeVox[ 0 ] );
1471 wfl[ 1 ] = pos[ 2 ] - (
m_boundZ + index[ 1 ] * mp_sizeVox[ 2 ] );
1472 wfl[ 0 ] /= mp_sizeVox[ 0 ];
1473 wfl[ 1 ] /= mp_sizeVox[ 2 ];
1476 wcl[ 0 ] = 1.0 - wfl[ 0 ];
1477 wcl[ 1 ] = 1.0 - wfl[ 1 ];
1480 w[ 0 ] = wcl[ 0 ] * wcl[ 1 ];
1481 w[ 1 ] = wcl[ 0 ] * wfl[ 1 ];
1482 w[ 2 ] = wfl[ 0 ] * wfl[ 1 ];
1483 w[ 3 ] = wfl[ 0 ] * wcl[ 1 ];
1494 ap_ProjectionLine->
AddVoxelAllTOFBins(a_direction, finalIdx * limitX1 * limitZ1, w[ 0 ] * weight * limitX1 * limitZ1, tof_weights_temp, tof_bin_first_for_voxel, tof_bin_last_for_voxel);
1495 ap_ProjectionLine->
AddVoxelAllTOFBins(a_direction, ( finalIdx +
m_nbVoxXY ) * limitX1 * limitZ2, w[ 1 ] * weight * limitX1 * limitZ2, tof_weights_temp, tof_bin_first_for_voxel, tof_bin_last_for_voxel);
1496 ap_ProjectionLine->
AddVoxelAllTOFBins(a_direction, ( finalIdx + 1 +
m_nbVoxXY ) * limitX2 * limitZ2, w[ 2 ] * weight * limitX2 * limitZ2, tof_weights_temp, tof_bin_first_for_voxel, tof_bin_last_for_voxel);
1497 ap_ProjectionLine->
AddVoxelAllTOFBins(a_direction, ( finalIdx + 1 ) * limitX2 * limitZ1, w[ 3 ] * weight * limitX2 * limitZ1, tof_weights_temp, tof_bin_first_for_voxel, tof_bin_last_for_voxel);
1499 limitX1 = 1; limitX2 = 1;
1500 limitZ1 = 1; limitZ2 = 1;
1502 delete[] tof_weights_temp;
bool m_compatibleWithSPECTAttenuationCorrection
int ReadStringOption(const string &a_input, T *ap_return, int a_nbElts, const string &sep, const string &a_option)
Parse the 'a_input' string corresponding to the 'a_option' into 'a_nbElts' elements, using the 'sep' separator. The results are returned in the templated 'ap_return' dynamic templated array. Call "ConvertFromString()" to perform the correct conversion depending on the type of the data to convert.
FLTNB m_TOFGaussianNormCoef
int InitializeSpecific()
This function is used to initialize specific stuff to the child projector.
void ShowHelpSpecific()
A function used to show help about the child module.
void AddVoxelAllTOFBins(int a_direction, INTNB a_voxelIndex, FLTNB a_voxelWeight, HPFLTNB *a_tofWeights, INTNB a_tofBinFirst, INTNB a_tofBinLast)
FLTNB GetTOFMeasurementInPs()
This function is used to get the TOF measurement in ps.
This class is designed to generically described any on-the-fly projector.
#define SPEED_OF_LIGHT_IN_MM_PER_PS
int ReadConfigurationFile(const string &a_configurationFile)
bool m_TOFWeightingFcnPrecomputedFlag
bool m_TOFBinProperProcessingFlag
HPFLTNB * mp_TOFWeightingFcn
oImageDimensionsAndQuantification * mp_ImageDimensionsAndQuantification
FLTNB GetLength()
This function is used to get the length of the line.
int ReadOptionsList(const string &a_optionsList)
int CheckSpecificParameters()
A private function used to check the parameters settings specific to the child projector.
~iProjectorJoseph()
The destructor of iProjectorJoseph.
int ProjectTOFListmode(int a_direction, oProjectionLine *ap_ProjectionLine)
FLTNB * GetPosition1()
This function is used to get the pointer to the mp_position1 (3-values tab).
void AddVoxel(int a_direction, INTNB a_voxelIndice, FLTNB a_voxelWeight)
FLTNB m_TOFResolutionInMm
INTNB EstimateMaxNumberOfVoxelsPerLine()
This function is used to compute and provide an estimate of the maximum number of voxels that could c...
This class is designed to manage and store system matrix elements associated to a vEvent...
int ProjectWithoutTOF(int a_direction, oProjectionLine *ap_ProjectionLine)
FLTNB m_TOFPrecomputedSamplingFactor
int ProjectTOFHistogram(int a_direction, oProjectionLine *ap_ProjectionLine)
int GetNbTOFBins()
This function is used to get the number of TOF bins in use.
FLTNB * GetPosition2()
This function is used to get the pointer to the mp_position2 (3-values tab).
INTNB GetNbVoxX()
Get the number of voxels along the X axis.
INTNB GetNbVoxZ()
Get the number of voxels along the Z axis.
iProjectorJoseph()
The constructor of iProjectorJoseph.
bool m_compatibleWithCompression
#define TWO_SQRT_TWO_LN_2
bool IsVoxelMasked(INTNB a_voxIndex)
INTNB GetNbVoxY()
Get the number of voxels along the Y axis.
INTNB m_TOFWeightingFcnNbSamples