STIR
6.2.0
|
Declaration of class stir::InputStreamFromROOTFileForECATPET. More...
#include "stir/IO/InputStreamFromROOTFileForECATPET.h"
Public Member Functions | |
InputStreamFromROOTFileForECATPET () | |
Default constructor. | |
Succeeded | get_next_record (CListRecordROOT &record) override |
virtual std::string | method_info () const |
gives method information | |
Succeeded | set_up (const std::string &header_path) override |
Must be called before calling for the first event. | |
int | get_num_rings () const override |
Calculate the number of rings based on the crystals and blocks. | |
int | get_num_dets_per_ring () const override |
Calculate the number of detectors per ring based on the crystals blocks. | |
int | get_num_axial_blocks_per_bucket_v () const override |
Get the number of axial blocks. | |
int | get_num_transaxial_blocks_per_bucket_v () const override |
Get the number of transaxial blocks. | |
int | get_num_axial_crystals_per_singles_unit () const override |
Get the number of crystals per block. | |
int | get_num_trans_crystals_per_singles_unit () const override |
Get the number of crystals per block. | |
void | set_block_repeater_y (int) |
void | set_block_repeater_z (int) |
Public Member Functions inherited from stir::RegisteredParsingObject< InputStreamFromROOTFileForECATPET, InputStreamFromROOTFile, InputStreamFromROOTFile > | |
std::string | get_registered_name () const override |
Returns Derived::registered_name. | |
std::string | parameter_info () override |
Returns a string with all parameters and their values, in a form suitable for parsing again. | |
Public Member Functions inherited from stir::InputStreamFromROOTFile | |
InputStreamFromROOTFile () | |
Default constructor. | |
Succeeded | reset () |
Go to the first event. | |
SavedPosition | save_get_position () |
Save current position in a vector. | |
Succeeded | set_get_position (const SavedPosition &) |
Set current position. | |
std::vector< unsigned long int > | get_saved_get_positions () const |
Get the vector with the saved positions. | |
void | set_saved_get_positions (const std::vector< unsigned long int > &) |
Set a vector with saved positions. | |
unsigned long int | get_total_number_of_events () const |
Returns the total number of events. | |
std::string | get_ROOT_filename () const |
int | get_num_axial_crystals_per_block_v () const |
Get the axial number of crystals per module. | |
int | get_num_transaxial_crystals_per_block_v () const |
Get the transaxial number of crystals per module. | |
float | get_low_energy_thres () const |
Lower energy threshold. | |
float | get_up_energy_thres () const |
Upper energy threshold. | |
void | set_singles_readout_depth (int) |
Set singles_readout_depth. | |
void | set_input_filename (const std::string &) |
void | set_chain_name (const std::string &) |
void | set_exclude_true_events (bool) |
void | set_exclude_scattered_events (bool) |
void | set_exclude_unscattered_events (bool) |
void | set_exclude_random_events (bool) |
void | set_low_energy_window (float) |
void | set_upper_energy_window (float) |
void | set_optional_ROOT_fields (bool) |
Set the read_optional_root_fields flag. | |
void | set_crystal_repeater_x (int) |
void | set_crystal_repeater_y (int) |
void | set_crystal_repeater_z (int) |
int | get_num_virtual_axial_crystals_per_block () const |
int | get_num_virtual_transaxial_crystals_per_block () const |
void | set_num_virtual_axial_crystals_per_block (int) |
void | set_num_virtual_transaxial_crystals_per_block (int) |
Public Member Functions inherited from stir::ParsingObject | |
ParsingObject (const ParsingObject &) | |
ParsingObject & | operator= (const ParsingObject &) |
void | ask_parameters () |
bool | parse (std::istream &f) |
bool | parse (const char *const filename) |
Static Public Attributes | |
static const char *const | registered_name = "GATE_ECAT_PET" |
Name which will be used when parsing a OSMAPOSLReconstruction object. | |
Protected Member Functions | |
void | set_defaults () override |
Set defaults before parsing. | |
void | initialise_keymap () override |
Initialise all keywords. | |
bool | post_processing () override |
This will be called at the end of the parsing. More... | |
Protected Member Functions inherited from stir::InputStreamFromROOTFile | |
float | get_energy1_in_keV () const |
OpenGATE output ROOT energy information is given in MeV, these methods convert to keV. | |
float | get_energy2_in_keV () const |
bool | check_brentry_randoms_scatter_energy_conditions (long long int brentry) |
Checks brentry satisfies the randoms, scatter and energy conditions. | |
void | GetEntryCheck (const int ret) |
Checks the return of branch->GetEntry(brentry) and errors if return <= 0. | |
Protected Member Functions inherited from stir::ParsingObject | |
virtual void | set_key_values () |
This will be called before parsing or parameter_info is called. More... | |
Protected Attributes | |
int | block_repeater_y |
int | block_repeater_z |
int | half_block |
In GATE, inside a block, the indeces start from the lower unit counting upwards. Therefore in order to align the crystals, between STIR and GATE we have to move half block more. | |
TBranches for ECAT PET | |
TBranch * | br_crystalID1 = nullptr |
TBranch * | br_crystalID2 = nullptr |
TBranch * | br_blockID1 = nullptr |
TBranch * | br_blockID2 = nullptr |
ROOT Variables, i.e. to hold data from each entry. | |
std::int32_t | blockID1 |
std::int32_t | blockID2 |
std::int32_t | crystalID1 |
std::int32_t | crystalID2 |
Protected Attributes inherited from stir::InputStreamFromROOTFile | |
std::string | filename |
Input data file name. | |
unsigned long int | starting_stream_position |
The starting position. | |
unsigned long int | nentries |
The total number of entries. | |
unsigned long int | current_position |
Current get position. | |
std::vector< unsigned long int > | saved_get_positions |
A vector with saved position indices. | |
std::string | chain_name |
The name of the ROOT chain to be read. | |
bool | read_optional_root_fields |
This variable can be used to setBranchAddress to ROOT fields that currently are not used by STIR. Because they might be related to medical image reconstruction or because STIR does not support a relevant use. Of course, just activating this flag does not mean that something meaningfull will happen. Please edit get_next_record() function accordingly. | |
bool | exclude_nonrandom |
Skip True events (eventID1 == eventID2). Default is false. | |
bool | exclude_scattered |
Skip scattered events (comptonphantom1 > 0 && comptonphantom2 > 0). Default is false. | |
bool | exclude_unscattered |
Skip unscattered events (comptonphantom1 == 0 && comptonphantom2 == 0)). Default is false. | |
bool | exclude_randoms |
Skip random events (eventID1 != eventID2). Default is false. | |
bool | check_energy_window_information |
Check energy window information (low_energy_window < energy < up_energy_window). Default is true. | |
float | low_energy_window |
Lower energy threshold. Default is 1000 (keV) | |
float | up_energy_window |
Upper energy threshold. Default is 0 (keV) | |
int | singles_readout_depth |
For the singles_readout_depth from GATE's online documentation: (here )
| |
double | least_significant_clock_bit |
int | crystal_repeater_x |
int | crystal_repeater_y |
int | crystal_repeater_z |
TChain * | stream_ptr |
std::int32_t | eventID1 |
std::int32_t | eventID2 |
std::int32_t | runID |
std::int32_t | sourceID1 |
std::int32_t | sourceID2 |
double | time1 |
double | time2 |
float | energy1 |
float | energy2 |
float | rotation_angle |
float | sinogramS |
float | sinogramTheta |
float | axialPos |
int32_t | comptonphantom1 |
int32_t | comptonphantom2 |
float | globalPosX1 |
float | globalPosX2 |
float | globalPosY1 |
float | globalPosY2 |
float | globalPosZ1 |
float | globalPosZ2 |
float | sourcePosX1 |
float | sourcePosX2 |
float | sourcePosY1 |
float | sourcePosY2 |
float | sourcePosZ1 |
float | sourcePosZ2 |
TBranch * | br_time1 = nullptr |
TBranch * | br_time2 = nullptr |
TBranch * | br_eventID1 = nullptr |
TBranch * | br_eventID2 = nullptr |
TBranch * | br_energy1 = nullptr |
TBranch * | br_energy2 = nullptr |
TBranch * | br_comptonPhantom1 = nullptr |
TBranch * | br_comptonPhantom2 = nullptr |
TBranch * | br_axialPos = nullptr |
TBranch * | br_globalPosX1 = nullptr |
TBranch * | br_globalPosX2 = nullptr |
TBranch * | br_globalPosY1 = nullptr |
TBranch * | br_globalPosY2 = nullptr |
TBranch * | br_globalPosZ1 = nullptr |
TBranch * | br_globalPosZ2 = nullptr |
TBranch * | br_rotation_angle = nullptr |
TBranch * | br_runID = nullptr |
TBranch * | br_sinogramS = nullptr |
TBranch * | br_sinogramTheta = nullptr |
TBranch * | br_sourceID1 = nullptr |
TBranch * | br_sourceID2 = nullptr |
TBranch * | br_sourcePosX1 = nullptr |
TBranch * | br_sourcePosX2 = nullptr |
TBranch * | br_sourcePosY1 = nullptr |
TBranch * | br_sourcePosY2 = nullptr |
TBranch * | br_sourcePosZ1 = nullptr |
TBranch * | br_sourcePosZ2 = nullptr |
int | num_virtual_axial_crystals_per_block |
int | num_virtual_transaxial_crystals_per_block |
Protected Attributes inherited from stir::ParsingObject | |
KeyParser | parser |
Additional Inherited Members | |
Public Types inherited from stir::InputStreamFromROOTFile | |
typedef std::vector< long long int >::size_type | SavedPosition |
Static Public Member Functions inherited from stir::RegisteredParsingObject< InputStreamFromROOTFileForECATPET, InputStreamFromROOTFile, InputStreamFromROOTFile > | |
static InputStreamFromROOTFile * | read_from_stream (std::istream *) |
Construct a new object (of type Derived) by parsing the istream. More... | |
Static Public Member Functions inherited from stir::RegisteredObject< InputStreamFromROOTFile > | |
static InputStreamFromROOTFile * | read_registered_object (std::istream *in, const std::string ®istered_name) |
Construct a new object (of a type derived from Root, its actual type determined by the registered_name parameter) by parsing the istream. More... | |
static InputStreamFromROOTFile * | ask_type_and_parameters () |
ask the user for the type, and then calls read_registered_object(0, type) More... | |
static void | list_registered_names (std::ostream &stream) |
List all possible registered names to the stream. More... | |
Protected Types inherited from stir::RegisteredObject< InputStreamFromROOTFile > | |
typedef InputStreamFromROOTFile *(* | RootFactory) (std::istream *) |
The type of a root factory is a function, taking an istream* as argument, and returning a Root*. | |
typedef FactoryRegistry< std::string, RootFactory, interfile_less > | RegistryType |
The type of the registry. | |
Static Protected Member Functions inherited from stir::RegisteredObject< InputStreamFromROOTFile > | |
static RegistryType & | registry () |
Static function returning the registry. More... | |
Declaration of class stir::InputStreamFromROOTFileForECATPET.
The ECAT system is a simplified version of CylindricalPET. Such scanners are based on the block detector principle. The blocks are organized along an annular geometry to yield multi-ring detectors. From (here ) a ECAT PET scanner has two levels block crystal
The geometry is defined through the repeaters. In the example header file found below. The values in the repeaters must match the values in the simulation macro file.
GATE scanner type := GATE_ECAT_PET GATE_ECAT_PET Parameters := name of data file := ${INPUT_ROOT_FILE} name of input TChain := Coincidences number of blocks Y := 1 number of blocks Z := 1 number of crystals X := 1 number of crystals Y := 1 number of crystals Z := 4 Singles readout depth := 1 exclude scattered events := ${EXCLUDE_SCATTERED} exclude random events := ${EXCLUDE_RANDOM} low energy window (keV) := 0 upper energy window (keV):= 10000 End GATE_ECAT_PET Parameters :=
|
overridevirtual |
Returns the next record in the ROOT file. The code is adapted from Sadek A. Nehmeh and CR Schmidtlein, downloaded from here
Implements stir::InputStreamFromROOTFile.
References stir::InputStreamFromROOTFile::check_brentry_randoms_scatter_energy_conditions(), stir::InputStreamFromROOTFile::current_position, stir::InputStreamFromROOTFile::get_num_transaxial_crystals_per_block_v(), stir::InputStreamFromROOTFile::GetEntryCheck(), half_block, stir::CListRecordROOT::init_from_data(), and stir::InputStreamFromROOTFile::nentries.
|
overrideprotectedvirtual |
This will be called at the end of the parsing.
Reimplemented from stir::InputStreamFromROOTFile.