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;
324 std::string fileType;
333 _header.
getProperty(
"ecat_system_type", systemType);
340 unsigned int startTime;
341 _header.
getProperty(
"ecat_scan_start_time", startTime);
356 std::vector<float> us;
417 _header.
getProperty(
"ecat_loss_correction_fctr", dtcf);
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;
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;
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;
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;
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);
778 _header.
setProperty(
"ecat_system_type", systemType ) ;
784 _header.
setProperty(
"ecat_scan_start_time", scanStartTime ) ;
838 _header.
setProperty(
"ecat_loss_correction_fctr", dtcf);
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);
904 _header.
setProperty(
"ecat_patient_orientation", PatientOrientation);
910 _header.
setProperty(
"ecat_plane_separation", planeSep);
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 );
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 >
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 >
1057 template <
class T >
1063 template <
class T >
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 >
void setTotalAverageUncorrected(float)
void setFileType(const std::string &fileType)
void setPatientOrientation(short PatientOrientation)
void setBinSize(float BinSize)
Sinogram< T > & operator=(const Sinogram< T > &other)
float getInitBedPosition() const
void setTotalCoinRate(int)
virtual bool getProperty(const std::string &, Object &) const
short getAcquisitionMode() const
void setPrompts(int prompts)
float getTotalAverageUncorrected() const
void setUpperTrueThreshold(short UpperTrueThreshold)
int getTotalCoinRate() const
short getAxialSampleMode() const
unsigned int getScanStartTime() const
unsigned int getDoseStartTime() const
AimsData< T > getPlaneInDisplayMode(int, int)
float getXResolution() const
unsigned int getGateDuration() const
void setUncorrectedSingles(const std::vector< float > &uncorrSingles)
void setWellCounterFactor(float)
short getLowerScatterThreshold() const
void setTransaxialFOV(float TransaxialFOV)
void setTotalAverageCorrected(float)
float getIsotopeHalfLife() const
short getSeptaState() const
void setAcquisitionMode(short AquisitionMode)
void setMultiFileType(int MultiFileType)
void setPlaneSeparation(float planeSep)
AimsData< AimsData< AimsData< T > > > & start()
void setBedElevation(float)
void setSeptaState(short)
int getZ(int segment) const
void setStudyType(const std::string &StudyType)
float getVResolution() const
void setIsotopeHalfLife(float isotopeHalfLife)
An attempt to efficiently manage view/sinogram acquisition PET data.
float getTransaxialFOV() const
void setDelayed(int delayed)
void setAxialSampleMode(short)
void setCoinSampleMode(short)
void setScanStartTime(unsigned int scanStartTime)
Mode getInternalMode() const
void setRadioPharmaceutical(const std::string &radiopharmaceutical)
short getAngularCompression() const
int transCodeSegment(int s) const
void setScanMax(short scanMax)
std::vector< float > getUncorrectedSingles() const
float getWellCounterFactor() const
void setGateDuration(unsigned int)
Sinogram< T > clone() const
void setDurationTime(unsigned int)
void setWResolution(float)
std::vector< float > getBedOffset() const
std::string getFileType() const
AimsData< T > extractSino(int, int)
void setTotalNumPlanes(short NumPlanes)
void setHeader(const PythonHeader &hdr)
float getPlaneSeparation() const
void setSystemType(short systemType)
short getLowerTrueThreshold() const
AimsData< T > & getSino(int, int)
int getNumPlanes(int seg) const
short getUpperTrueThreshold() const
AimsData< T > & getView(int, int)
float getBedElevation() const
std::string getEcatFileType() const
short getCoinSampleMode() const
const ScannerConf & getScannerConf() const
void setCalibrationFactor(float)
void setInitBedPosition(float InitBedPosition)
void setZResolution(float)
void setMultiples(int multiples)
float getWResolution() const
void setBedOffset(const std::vector< float > &)
unsigned int getDurationTime() const
void setXResolution(float)
float getZResolution() const
std::string getStudyType() const
int getMultiFileType() const
float getDistanceScanned() const
void setDeadTimeCorrectionFactor(float)
short getTotalNumPlanes() const
AimsData< T > & getPlaneInInternalMode(int, int)
float getBranchingFraction() const
void setDoseStartTime(unsigned int DoseStartTime)
void setAngularCompression(short AngularCompression)
void setLowerScatterThreshold(short)
void setEcatFileType(const std::string &fileType)
float getTotalAverageCorrected() const
virtual void setProperty(const std::string &, Object)
void setSizeXYZT(float sizex=1.0f, float sizey=1.0f, float sizez=1.0f, float sizet=1.0f)
void setAcquisitionType(short AquisitionType)
float getDeadTimeCorrectionFactor() const
short getSystemType() const
void setVResolution(float)
void setBranchingFraction(float BranchingFraction)
void setStartTime(unsigned int)
void setIsotopeName(const std::string &isotopeName)
void setScanMin(short scanMin)
void setLowerTrueThreshold(short LowerTrueThreshold)
short getPatientOrientation() const
float getCalibrationFactor() const
std::string getIsotopeName() const
#define ForEach1d(thing, x)
AimsData< T > extractView(int, int)
std::string getRadioPharmaceutical() const
Sinogram(const ScannerConf &conf=ecatHRPlusUsual)
short getAcquisitionType() const
unsigned int getStartTime() const
void setDistanceScanned(float DistanceScanned)