45 int tmp = int(
float(s)/2.0 + .5);
46 return( s%2 ? tmp : -tmp );
54 : _internalMode( mode ), _displayMode( mode ), _scannerConfig(config)
140 if ( &other ==
this )
144 _header.copy(other._header) ;
147 _scannerConfig = other._scannerConfig ;
150 _internalMode = other._internalMode;
151 _displayMode = other._displayMode;
161 return _bin(segment)(zOrAlpha) ;
167 if( _displayMode == _internalMode ){
169 return _bin(segment)(zOrAlpha).clone() ;
172 int dimX = _bin(segment)(0).dimX() ;
173 int dimY = _bin(segment).dimX() ;
174 float sizeX = _bin(segment)(0).sizeX() ;
175 float sizeY = _bin(segment).sizeX() ;
181 for(
int alphaOrZ = 0 ; alphaOrZ < dimY ; ++alphaOrZ )
182 for(
int ro = 0 ; ro < dimX ; ++ro )
183 plane(ro, alphaOrZ) = _bin(segment)(alphaOrZ)(ro, zOrAlpha) ;
195 return _bin(seg)(alpha).clone() ;
199 int dimX = _bin(seg)(0).dimX() ;
200 int dimY = _bin(seg).dimX() ;
201 float sizeX = _bin(seg)(0).sizeX() ;
202 float sizeY = _bin(seg).sizeX() ;
209 for(
int z = 0 ; z < dimY ; ++z )
210 for(
int ro = 0 ; ro < dimX ; ++ro )
211 plane(ro, z) = _bin(seg)(z)(ro, alpha) ;
222 return (_bin(seg))(alpha) ;
232 return (_bin(seg))(alpha) ;
241 return _bin(seg)(z).clone() ;
245 int dimX = _bin(seg)(0).dimX() ;
246 int dimY = _bin(seg).dimX() ;
247 float sizeX = _bin(seg)(0).sizeX() ;
248 float sizeY = _bin(seg).sizeX() ;
255 for(
int alpha = 0 ; alpha < dimY ; ++alpha )
256 for(
int ro = 0 ; ro < dimX ; ++ro )
257 plane(ro, alpha) = _bin(seg)(alpha)(ro, z) ;
269 return (_bin(seg))(z) ;
279 return (_bin(seg))(z) ;
287 return( _bin(0).dimX() );
289 return( _bin(0)(0).dimY() );
296 return( _bin(seg)(0).dimY() );
298 return( _bin(seg).dimX() );
304 return( _bin(0)(0).dimX() );
316 std::string fileType;
317 _header.getProperty(
"file_type", fileType);
324 std::string fileType;
325 _header.getProperty(
"ecat_file_type", fileType);
333 _header.getProperty(
"ecat_system_type", systemType);
340 unsigned int startTime;
341 _header.getProperty(
"ecat_scan_start_time", startTime);
349 _header.getProperty(
"ecat_prompts", prompts);
356 std::vector<float> us;
357 _header.getProperty(
"ecat_uncor_singles", us);
365 _header.getProperty(
"ecat_delayed", delayed);
373 _header.getProperty(
"ecat_multiples", multiples);
381 _header.getProperty(
"ecat_net_trues", trues);
390 _header.getProperty(
"ecat_tot_avg_cor", tac);
399 _header.getProperty(
"ecat_tot_avg_uncor", tau);
408 _header.getProperty(
"ecat_total_coin_rate", tcr);
417 _header.getProperty(
"ecat_loss_correction_fctr", dtcf);
428 _header.getProperty(
"ecat_frame_start_time", st);
439 _header.getProperty(
"ecat_frame_duration", dt);
449 _header.getProperty(
"ecat_gate_duration", dt);
457 std::string radiopharmac ;
459 _header.getProperty(
"ecat_radiopharmaceutical", radiopharmac);
466 std::string isotopeName;
468 _header.getProperty(
"ecat_isotope_name", isotopeName);
475 float isotopeHalfLife;
477 _header.getProperty(
"ecat_isotope_halflife", isotopeHalfLife);
478 return isotopeHalfLife;
484 float distanceScanned;
486 _header.getProperty(
"ecat_distance_scanned", distanceScanned);
487 return distanceScanned;
495 _header.getProperty(
"ecat_transaxial_FOV", transaxialFOV);
496 return transaxialFOV;
502 short angularCompression;
504 _header.getProperty(
"ecat_angular_compression", angularCompression);
505 return angularCompression;
511 std::string studyType;
513 _header.getProperty(
"ecat_study_type", studyType);
520 short patientOrientation;
522 _header.getProperty(
"ecat_patient_orientation", patientOrientation);
523 return patientOrientation;
529 float planeSeparation ;
531 _header.getProperty(
"ecat_plane_separation", planeSeparation);
532 return planeSeparation;
540 _header.getProperty(
"ecat_num_planes", numPlanes);
549 _header.getProperty(
"multi_files_type", multiFileType);
550 return multiFileType;
556 float InitBedPosition;
558 _header.getProperty(
"ecat_init_bed_position", InitBedPosition);
559 return InitBedPosition;
565 short LowerTrueThreshold;
567 _header.getProperty(
"ecat_lwr_true_thres", LowerTrueThreshold);
568 return LowerTrueThreshold;
574 short UpperTrueThreshold;
576 _header.getProperty(
"ecat_upr_true_thres", UpperTrueThreshold);
577 return UpperTrueThreshold;
583 short aquisitionMode;
585 _header.getProperty(
"ecat_acquisition_mode", aquisitionMode);
586 return aquisitionMode;
592 short aquisitionType;
594 _header.getProperty(
"ecat_acquisition_type", aquisitionType);
595 return aquisitionType;
603 _header.getProperty(
"ecat_bin_size", BinSize);
610 float BranchingFraction;
612 _header.getProperty(
"ecat_branching_fraction", BranchingFraction);
613 return BranchingFraction;
619 unsigned int DoseStartTime;
621 _header.getProperty(
"ecat_dose_start_time", DoseStartTime);
622 return DoseStartTime;
630 _header.getProperty(
"ecat_bed_elevation", bedElevation);
637 short coinSampleMode;
639 _header.getProperty(
"ecat_coin_samp_mode", coinSampleMode);
640 return coinSampleMode;
646 short axialSampleMode;
648 _header.getProperty(
"ecat_axial_samp_mode", axialSampleMode);
649 return axialSampleMode;
655 float calibrationFactor;
657 _header.getProperty(
"ecat_calibration_factor", calibrationFactor);
658 return calibrationFactor;
664 std::vector<float> bedOffset;
666 _header.getProperty(
"ecat_bed_offset", bedOffset);
673 short lowerScatterThreshold;
675 _header.getProperty(
"ecat_lwr_sctr_thres", lowerScatterThreshold);
676 return lowerScatterThreshold;
684 _header.getProperty(
"ecat_dosage", dosage);
691 float wellCounterFactor;
693 _header.getProperty(
"ecat_well_counter_factor", wellCounterFactor);
694 return wellCounterFactor;
702 _header.getProperty(
"ecat_septa_state", septaState);
711 _header.getProperty(
"ecat_x_resolution", xRresolution);
720 _header.getProperty(
"ecat_v_resolution", vRresolution);
729 _header.getProperty(
"ecat_z_resolution", zRresolution);
738 _header.getProperty(
"ecat_w_resolution", wRresolution);
747 _header.getProperty(
"ecat_scan_min", scanMin);
756 _header.getProperty(
"ecat_scan_max", scanMax);
766 _header.setProperty(
"file_type", fileType);
772 _header.setProperty(
"ecat_file_type", fileType);
778 _header.setProperty(
"ecat_system_type", systemType ) ;
784 _header.setProperty(
"ecat_scan_start_time", scanStartTime ) ;
790 _header.setProperty(
"ecat_prompts", prompts);
796 _header.setProperty(
"ecat_uncor_singles", uncorr);
802 _header.setProperty(
"ecat_delayed", delayed);
808 _header.setProperty(
"ecat_multiples", multiples);
814 _header.setProperty(
"ecat_net_trues", trues);
820 _header.setProperty(
"ecat_tot_avg_cor", tac);
826 _header.setProperty(
"ecat_tot_avg_uncor", tau);
832 _header.setProperty(
"ecat_total_coin_rate", tcr);
838 _header.setProperty(
"ecat_loss_correction_fctr", dtcf);
844 _header.setProperty(
"ecat_frame_start_time", st);
850 _header.setProperty(
"ecat_frame_duration", dt);
856 _header.setProperty(
"ecat_gate_duration", dt);
862 _header.setProperty(
"ecat_radiopharmaceutical", radiopharmaceutical);
868 _header.setProperty(
"ecat_isotope_code", isotopeName);
874 _header.setProperty(
"ecat_isotope_halflife", isotopeHalfLife);
880 _header.setProperty(
"ecat_distance_scanned", DistanceScanned);
886 _header.setProperty(
"ecat_transaxial_FOV", TransaxialFOV);
892 _header.setProperty(
"ecat_angular_compression", AngularCompression);
898 _header.setProperty(
"ecat_study_type", studyType);
904 _header.setProperty(
"ecat_patient_orientation", PatientOrientation);
910 _header.setProperty(
"ecat_plane_separation", planeSep);
916 _header.setProperty(
"ecat_num_planes", numPlanes);
922 _header.setProperty(
"multi_files_type", multiFileType);
928 _header.setProperty(
"ecat_init_bed_position", InitBedPosition);
934 _header.setProperty(
"ecat_lwr_true_thres", LowerTrueThreshold);
940 _header.setProperty(
"ecat_upr_true_thres", UpperTrueThreshold);
946 _header.setProperty(
"ecat_acquisition_mode", AquisitionMode);
952 _header.setProperty(
"ecat_acquisition_type", AquisitionType );
958 _header.setProperty(
"ecat_bin_size", BinSize);
964 _header.setProperty(
"ecat_branching_fraction", BranchingFraction);
970 _header.setProperty(
"ecat_dose_start_time", DoseStartTime);
976 _header.setProperty(
"ecat_bed_elevation", bedElevation);
982 _header.setProperty(
"ecat_coin_sample_mode", coinSampleMode );
988 _header.setProperty(
"ecat_axial_sample_mode", axialSampleMode );
994 _header.setProperty(
"ecat_calibration_factor", calibrationFactor);
1000 _header.setProperty(
"ecat_bed_offset", bedOffset);
1003 template <
class T >
1006 _header.setProperty(
"ecat_lwr_sctr_thres", lowerScatterThreshold );
1009 template <
class T >
1012 _header.setProperty(
"ecat_dosage", dosage);
1015 template <
class T >
1018 _header.setProperty(
"ecat_well_counter_factor", wellCounterFactor);
1021 template <
class T >
1024 _header.setProperty(
"ecat_septa_state", septaState );
1027 template <
class T >
1030 _header.setProperty(
"ecat_x_resolution", xResolution);
1033 template <
class T >
1036 _header.setProperty(
"ecat_v_resolution", vResolution);
1039 template <
class T >
1042 _header.setProperty(
"ecat_z_resolution", zResolution);
1045 template <
class T >
1048 _header.setProperty(
"ecat_w_resolution", wResolution);
1051 template <
class T >
1054 _header.setProperty(
"ecat_scan_min", scanMin);
1057 template <
class T >
1060 _header.setProperty(
"ecat_scan_max", scanMax);
1063 template <
class T >
1068 this->getInternalMode() ;
1082 for(
int seg = 0 ; seg < _bin.dimX() ; ++seg ){
1085 for(
int thetaOrZ = 0 ; thetaOrZ < _bin(seg).dimX() ; ++thetaOrZ ){
1086 copyBin(seg)(thetaOrZ) =
AimsData<T>(_bin(seg)(thetaOrZ).dimX(), _bin(seg)(thetaOrZ).dimY()) ;
1087 for(
int zOrTheta = 0 ; zOrTheta < _bin(seg)(thetaOrZ).dimY() ; ++zOrTheta )
1088 for(
int x = 0 ; x < _bin(seg)(thetaOrZ).dimX() ; ++x )
1089 copyOf(seg, thetaOrZ, zOrTheta, x ) = _bin(seg)(thetaOrZ)( x, zOrTheta ) ;
1095 template <
class T >
#define ForEach1d(thing, x)
void setSizeXYZT(float sizex=1.0f, float sizey=1.0f, float sizez=1.0f, float sizet=1.0f)
An attempt to efficiently manage view/sinogram acquisition PET data.
int getZ(int segment) const
short getAcquisitionType() const
void setEcatFileType(const std::string &fileType)
void setSeptaState(short)
void setIsotopeHalfLife(float isotopeHalfLife)
void setWellCounterFactor(float)
AimsData< T > extractSino(int, int)
unsigned int getScanStartTime() const
float getTotalAverageUncorrected() const
short getCoinSampleMode() const
unsigned int getGateDuration() const
float getIsotopeHalfLife() const
void setAcquisitionMode(short AquisitionMode)
void setIsotopeName(const std::string &isotopeName)
void setAngularCompression(short AngularCompression)
void setTransaxialFOV(float TransaxialFOV)
void setScanMin(short scanMin)
float getVResolution() const
void setStudyType(const std::string &StudyType)
unsigned int getDurationTime() const
void setZResolution(float)
short getAxialSampleMode() const
void setLowerTrueThreshold(short LowerTrueThreshold)
short getLowerTrueThreshold() const
float getDeadTimeCorrectionFactor() const
float getWellCounterFactor() const
void setBranchingFraction(float BranchingFraction)
void setStartTime(unsigned int)
AimsData< T > & getSino(int, int)
void setMultiples(int multiples)
float getDistanceScanned() const
void setScanStartTime(unsigned int scanStartTime)
short getAngularCompression() const
int transCodeSegment(int s) const
AimsData< T > extractView(int, int)
AimsData< T > getPlaneInDisplayMode(int, int)
void setPrompts(int prompts)
AimsData< T > & getView(int, int)
void setTotalAverageUncorrected(float)
std::string getStudyType() const
void setDelayed(int delayed)
AimsData< T > & getPlaneInInternalMode(int, int)
float getXResolution() const
std::string getIsotopeName() const
void setCoinSampleMode(short)
void setTotalNumPlanes(short NumPlanes)
void setXResolution(float)
float getTotalAverageCorrected() const
void setFileType(const std::string &fileType)
void setVResolution(float)
void setCalibrationFactor(float)
void setSystemType(short systemType)
float getBedElevation() const
Sinogram(const ScannerConf &conf=ecatHRPlusUsual)
void setAxialSampleMode(short)
void setTotalCoinRate(int)
float getBranchingFraction() const
void setDistanceScanned(float DistanceScanned)
unsigned int getStartTime() const
short getSeptaState() const
short getSystemType() const
void setGateDuration(unsigned int)
void setInitBedPosition(float InitBedPosition)
short getTotalNumPlanes() const
void setScanMax(short scanMax)
float getCalibrationFactor() const
void setHeader(const PythonHeader &hdr)
short getUpperTrueThreshold() const
void setDoseStartTime(unsigned int DoseStartTime)
void setBedOffset(const std::vector< float > &)
void setLowerScatterThreshold(short)
AimsData< AimsData< AimsData< T > > > & start()
int getTotalCoinRate() const
void setUncorrectedSingles(const std::vector< float > &uncorrSingles)
short getLowerScatterThreshold() const
float getZResolution() const
Sinogram< T > clone() const
void setDurationTime(unsigned int)
void setRadioPharmaceutical(const std::string &radiopharmaceutical)
std::vector< float > getUncorrectedSingles() const
void setAcquisitionType(short AquisitionType)
float getTransaxialFOV() const
float getPlaneSeparation() const
float getWResolution() const
int getMultiFileType() const
void setPatientOrientation(short PatientOrientation)
void setBinSize(float BinSize)
std::vector< float > getBedOffset() const
void setTotalAverageCorrected(float)
std::string getEcatFileType() const
float getInitBedPosition() const
void setWResolution(float)
short getAcquisitionMode() const
int getNumPlanes(int seg) const
void setUpperTrueThreshold(short UpperTrueThreshold)
std::string getRadioPharmaceutical() const
Sinogram< T > & operator=(const Sinogram< T > &other)
void setMultiFileType(int MultiFileType)
std::string getFileType() const
short getPatientOrientation() const
void setDeadTimeCorrectionFactor(float)
void setBedElevation(float)
unsigned int getDoseStartTime() const
void setPlaneSeparation(float planeSep)