STIR  6.2.0
Public Types | Public Member Functions | Static Public Member Functions | List of all members
stir::DynamicDiscretisedDensity Class Reference

Class of multiple image frames, one for each time frame Each time frame is a DiscretisedDensity<3,float> More...

#include "stir/DynamicDiscretisedDensity.h"

Inheritance diagram for stir::DynamicDiscretisedDensity:
Inheritance graph
[legend]

Public Types

typedef DynamicDiscretisedDensity hierarchy_base_type
 A typedef that can be used what the base of the hierarchy is. More...
 
typedef DiscretisedDensity< 3, float > singleDiscDensT
 
typedef NestedIterator< DensitiesT::iterator, PtrBeginEndAllFunction< DensitiesT::iterator > > full_iterator
 typedef for iterator that runs over all densels in all frames
 
typedef NestedIterator< DensitiesT::const_iterator, ConstPtrBeginEndAllFunction< DensitiesT::const_iterator > > const_full_iterator
 typedef for const iterator that runs over all densels in all frames
 

Public Member Functions

 DynamicDiscretisedDensity (const DynamicDiscretisedDensity &argument)
 
 DynamicDiscretisedDensity (const TimeFrameDefinitions &time_frame_definitions, const double scan_start_time_in_secs_since_1970, const shared_ptr< Scanner > &scanner_sptr)
 
 DynamicDiscretisedDensity (const TimeFrameDefinitions &time_frame_definitions, const double scan_start_time_in_secs_since_1970, const shared_ptr< Scanner > &scanner_sptr, const shared_ptr< singleDiscDensT > &density_sptr)
 Construct an empty DynamicDiscretisedDensity based on a shared_ptr<DiscretisedDensity<3,float> >
 
DynamicDiscretisedDensityoperator= (const DynamicDiscretisedDensity &argument)
 
const float get_isotope_halflife () const
 
float get_calibration_factor () const
 
const singleDiscDensTat (const unsigned int frame_num) const
 at method
 
singleDiscDensTat (const unsigned int frame_num)
 at method
 
const double get_start_time_in_secs_since_1970 () const
 Return time of start of scan. More...
 
const float get_scanner_default_bin_size () const
 
void set_time_frame_definitions (const TimeFrameDefinitions &time_frame_definitions)
 
void set_scanner (const Scanner &scanner)
 
const TimeFrameDefinitionsget_time_frame_definitions () const
 
unsigned get_num_time_frames () const
 
Succeeded write_to_ecat7 (const std::string &filename) const
 write data to file Currently only in ECAT7 format. More...
 
void calibrate_frames () const
 
void decay_correct_frames ()
 
void set_if_decay_corrected (const bool is_decay_corrected)
 
void set_calibration_factor (const float calibration_factor)
 
void set_num_densities (const int num_densities)
 
functions returning full_iterators

These return iterators that run through all elements in all time frames.

full_iterator begin_all ()
 
const_full_iterator begin_all () const
 
const_full_iterator begin_all_const () const
 
full_iterator end_all ()
 
const_full_iterator end_all () const
 
const_full_iterator end_all_const () const
 
get/set the densities
Warning
The frame_num starts from 1
void set_density (const singleDiscDensT &density, const unsigned int frame_num)
 
const std::vector< shared_ptr< singleDiscDensT > > & get_densities () const
 
const singleDiscDensTget_density (const unsigned int frame_num) const
 
const singleDiscDensToperator[] (const unsigned int frame_num) const
 
singleDiscDensTget_density (const unsigned int frame_num)
 Avoid using this as it's unsafe.
 
singleDiscDensToperator[] (const unsigned int frame_num)
 
- Public Member Functions inherited from stir::ExamData
 ExamData ()
 ExamData. More...
 
 ExamData (const shared_ptr< const ExamInfo > &_this_exam)
 
virtual const ExamInfoget_exam_info () const
 
virtual shared_ptr< const ExamInfoget_exam_info_sptr () const
 Get shared pointer to exam info.
 
virtual void set_exam_info (ExamInfo const &)
 change exam info More...
 
void set_exam_info_sptr (shared_ptr< const ExamInfo > new_exam_info_sptr)
 

Static Public Member Functions

static DynamicDiscretisedDensityread_from_file (const std::string &filename)
 

Additional Inherited Members

- Protected Attributes inherited from stir::ExamData
shared_ptr< const ExamInfoexam_info_sptr
 

Detailed Description

Class of multiple image frames, one for each time frame Each time frame is a DiscretisedDensity<3,float>

Todo:
template in elemT and numDimensions?

Member Typedef Documentation

◆ hierarchy_base_type

A typedef that can be used what the base of the hierarchy is.

This typedef is used in write_to_file().

Member Function Documentation

◆ set_density()

void stir::DynamicDiscretisedDensity::set_density ( const singleDiscDensT density,
const unsigned int  frame_num 
)
Warning
This method replaced the set_density_sptr as it was unsafe

References stir::DiscretisedDensity< num_dimensions, elemT >::clone(), stir::error(), and stir::TimeFrameDefinitions::get_num_time_frames().

◆ get_start_time_in_secs_since_1970()

const double stir::DynamicDiscretisedDensity::get_start_time_in_secs_since_1970 ( ) const

Return time of start of scan.

Returns
the time in seconds since 1 Jan 1970 00:00 UTC, i.e. independent of your local time zone.

Note that the return type is a double. This allows for enough accuracy for a long time to come. It also means that the start time can have fractional seconds.

The time frame definitions should be relative to this time.

References stir::read_from_file().

◆ write_to_ecat7()

Succeeded stir::DynamicDiscretisedDensity::write_to_ecat7 ( const std::string &  filename) const

write data to file Currently only in ECAT7 format.

Warning
write_time_frame_definitions() is not yet implemented, so time information is missing.

References stir::ecat::ecat7::DiscretisedDensity_to_ECAT7(), stir::ecat::ecat7::make_ECAT7_main_header(), stir::round_to(), and stir::warning().

Referenced by stir::ecat::ecat7::ECAT7DynamicDiscretisedDensityOutputFileFormat::actual_write_to_file().

◆ decay_correct_frames()

void stir::DynamicDiscretisedDensity::decay_correct_frames ( )
Warning
This function should be used only if the _decay_corrected is false. Time of a frame is taken as the mean time for each frame which is an accurate approximation only if frame_duration <<< isotope_halflife.

References stir::decay_correction_factor(), and stir::warning().


The documentation for this class was generated from the following files: