|
STIR 6.5.0
|

Classes | |
| class | stir::CPUTimer |
| A class for measuring elapsed CPU time. More... | |
| class | stir::DynamicDiscretisedDensity |
| Class of multiple image frames, one for each time frame Each time frame is a DiscretisedDensity<3,float>. More... | |
| class | stir::DynamicProjData |
| Dynamic projection data. More... | |
| class | stir::ExamData |
| base class for data objects such as ProjData etc More... | |
| class | stir::ExamInfo |
| a class for storing information about 1 exam (or scan) More... | |
| class | stir::FactoryRegistry< Key, Factory, Compare > |
| This class can be used to store 'factories' and their corresponding keys. It is essentially a map, but with some extra embelishments. More... | |
| class | stir::FilePath |
| The FilePath class. More... | |
| class | stir::GeneralisedPoissonNoiseGenerator |
| Generates noise realisations according to Poisson statistics but allowing for scaling. More... | |
| struct | stir::HigherPrecision< T > |
| Helper class to get a type with higher precision. More... | |
| class | stir::ImagingModality |
| Class for encoding the modality. More... | |
| class | stir::KeyArgument |
| A class that enumerates the possible types that can be used to store parsed values. Used (only) by KeyParser. More... | |
| class | stir::map_element |
| Class to store the Interfile keywords and their actions. More... | |
| class | stir::KeyParser |
| A class to parse Interfile headers. More... | |
| class | stir::NestedIterator< topleveliterT, GetRestRangeFunctionT > |
| Class NestedIterator implements a (forward) iterator using a pair of 'nested' iterators. More... | |
| class | stir::NumericInfo< NUMBER > |
| class NumericInfo<NUMBER> defines properties for the type NUMBER. More... | |
| class | stir::NumericType |
| provides names for some numeric types and methods for finding their properties. More... | |
| struct | stir::TypeForNumericType< numeric_type_enum > |
| A helper class that specifies the C++ type for a particular NumericType. More... | |
| class | stir::ParseAndCreateFrom< OutputT, InputT, ParserT > |
| template for adding keywords to a parser and creating an object More... | |
| class | stir::ParsingObject |
| A base class for objects that want to be able to parse parameter files. More... | |
| class | stir::PatientPosition |
| class | stir::SymmetryOperation |
| Encodes symmetry operation on image coordinates and projection data coordinates. More... | |
| class | stir::RegisteredObject< Root > |
Helper class to provide registry mechanisms to a Base class. More... | |
| class | stir::RegisteredObjectBase |
| Base class for all classes that can parse .par files (and more?)The only reason that this class exists is such that KeyParser can store different types of objects, and get some basic info from it. More... | |
| class | stir::RegisteredParsingObject< Derived, Base, Parent > |
| Parent class for all leaves in a RegisteredObject hierarchy that do parsing of parameter files. More... | |
| class | stir::RunTests |
| A base class for making test classes. More... | |
| class | stir::Scanner |
| A class for storing some info on the scanner. More... | |
| class | stir::TimedBlock< TimerT=Timer > |
| Helper class for measuring execution time of a block of code. More... | |
| class | stir::TimedObject |
| base class for all objects which need timers. At the moment, there's only a CPU timer. More... | |
| class | stir::TimeFrameDefinitions |
| Class used for storing time frame durations. More... | |
| class | stir::TimeGateDefinitions |
| Class used for storing time gate durations. More... | |
| class | stir::Timer |
| A general base class for timers. Interface is like a stop watch. More... | |
| class | stir::Verbosity |
| This class enables the user to control the on-screen output. More... | |
| class | stir::ZoomOptions |
| This class enables the user to choose between different zooming options. More... | |
| class | stir::AbsTimeInterval |
| Base class for specifying a time interval (in absolute time). More... | |
| class | stir::AbsTimeIntervalFromDynamicData |
| class for specifying a time interval via a dynamic scan More... | |
| class | stir::AbsTimeIntervalFromECAT7ACF |
| class for specifying a time interval via an ECAT7 .a file More... | |
| class | stir::AbsTimeIntervalWithParsing |
| class for specifying a time interval via parsing of explicit times More... | |
| class | stir::SeparableArrayFunctionObject2< num_dimensions, elemT > |
This class implements an n -dimensional ArrayFunctionObject whose operation is separable. More... | |
| class | stir::ImagingModalityTests |
| Test class for ImagingModality. More... | |
| class | stir::ByteOrder |
| This class provides member functions to find out what byte-order your machine is and to swap numbers. More... | |
Macros | |
| #define | STIRIsNativeByteOrderBigEndian 1 |
| A macro that is defined to 1 when the compilation is on a big endian machine, otherwise it is set to 0. | |
| #define | STIRIsNativeByteOrderLittleEndian 0 |
| A macro that is defined to 1 when the compilation is on a little endian machine, and to 0 otherwise. | |
| #define | _PI 3.1415926535897932384626433832795028841971693993751058209749445923078164062 |
| The constant pi to high precision. | |
Functions | |
| template<class NUMBER> | |
| NUMBER | stir::square (const NUMBER &x) |
| returns the square of a number, templated. | |
| template<class coordT> | |
| CartesianCoordinate3D< coordT > | stir::cross_product (const CartesianCoordinate3D< coordT > &a, const CartesianCoordinate3D< coordT > &b) |
| the cross-product for 3-dimensional coordinates. | |
| double | stir::decay_correction_factor (const double isotope_halflife, const double start_time, const double end_time) |
| Compute decay-correction factor for a time frame. | |
| double | stir::decay_correction_factor (const double isotope_halflife, const double rel_time) |
| Computes the decay-correction factor for activity at a given time point. | |
| void | stir::error (const char *const s,...) |
Print error with format string a la printf and throw exception. | |
| template<class STRING> | |
| void | stir::error (const STRING &string) |
| Use this function for writing error messages and throwing an exception. | |
| template<class elemT> | |
| Array< 1, elemT > | stir::extract_line (const Array< 3, elemT > &, const BasicCoordinate< 3, int > &index, const int dimension) |
| extracts a line from an array in the direction of the specified dimension. | |
| template<class STRING> | |
| void | stir::info (const STRING &string, const int verbosity_level=1) |
| Use this function for writing informational messages. | |
| template<class Value, class DataType, class CoordinatesType> | |
| void | stir::linear_regression (Value &constant, Value &scale, Value &chi_square, Value &variance_of_constant, Value &variance_of_scale, Value &covariance_of_constant_with_scale, const VectorWithOffset< DataType > &measured_data, const VectorWithOffset< CoordinatesType > &coordinates, const VectorWithOffset< float > &weights, const bool use_estimated_variance=true) |
| Implements standard linear regression on VectorWithOffset data. | |
| template<class Value, class DataIter, class CoordinatesIter, class WeightsIter> | |
| void | stir::linear_regression (Value &constant, Value &scale, Value &chi_square, Value &variance_of_constant, Value &variance_of_scale, Value &covariance_of_constant_with_scale, DataIter measured_data_begin, DataIter measured_data_end, CoordinatesIter coords_begin, WeightsIter weights_begin, const bool use_estimated_variance=true) |
| Implements standard linear regression. | |
| template<typename ForwardIter_t> | |
| ForwardIter_t | stir::min_positive_element (ForwardIter_t start, ForwardIter_t end) |
| Finds where the smallest strictly positive element occurs. | |
| template<class iterT> | |
| iterT | stir::abs_max_element (iterT start, iterT end) |
| Like std::max_element, but comparing after taking absolute value. | |
| template<class IterT, class elemT> | |
| elemT | stir::sum (IterT start, IterT end, elemT init) |
| Compute the sum of a sequence using operator+=(), using an initial value. | |
| template<class IterT> | |
| std::iterator_traits< IterT >::value_type | stir::sum (IterT start, IterT end) |
| Compute the sum of a sequence using operator+=(). | |
| template<class IterT> | |
| std::iterator_traits< IterT >::value_type | stir::average (IterT start, IterT end) |
| Compute the average of a sequence using sum(start,end). | |
| void | stir::warning (const char *const s,...) |
Print warning with format string a la printf. | |
| template<class STRING> | |
| void | stir::warning (const STRING &string, const int verbosity_level=1) |
| Use this function for writing warning messages. | |
Functions for stream/file manipulations | |
| const int | stir::max_filename_length = 1000 |
| some large value to say how long filenames can be in the (deprecated) function ask_filename_with_extension(char *,const std::string&, const std::string&) | |
| void * | stir::read_stream_in_memory (std::istream &input, std::streamsize &file_size) |
| reads data into memory, returning a pointer to the memory | |
| streamsize | stir::find_remaining_size (std::istream &input) |
| Find number of remaining characters in the stream. | |
| template<class IFSTREAM> | |
| IFSTREAM & | stir::open_read_binary (IFSTREAM &s, const std::string &name) |
| opens a stream for reading binary data. Calls error() when it does not succeed. | |
| FILE *& | stir::open_read_binary (FILE *&fptr, const std::string &name) |
| opens a FILE for reading binary data. Calls error() when it does not succeed. | |
| template<class OFSTREAM> | |
| OFSTREAM & | stir::open_write_binary (OFSTREAM &s, const std::string &name) |
| opens a stream for writing binary data. Calls error() when it does not succeed. | |
| FILE *& | stir::open_write_binary (FILE *&fptr, const std::string &name) |
| opens a FILE for writing binary data. Calls error() when it does not succeed. | |
| template<class FSTREAM> | |
| void | stir::close_file (FSTREAM &s) |
| closes a stream without error checking. | |
| void | stir::close_file (FILE *&fptr) |
| closes a FILE without error checking. | |
Functions for filename manipulations | |
These functions work on different platforms, i.e. Unix, VAX, Windows. Also on older MacOS versions.
| |
| char * | stir::strupr (char *const str) |
| make C-string uppercase | |
Library with things that are not specific to reconstructions. This includes multi-dimensional arrays, images, image processors, projection data,...
| #define STIRIsNativeByteOrderBigEndian 1 |
A macro that is defined to 1 when the compilation is on a big endian machine, otherwise it is set to 0.
This should be used only in the case that you really need to know this at compilation time. Try to use class ByteOrder instead.
The definition of class ByteOrder is independent of this macro.
| #define STIRIsNativeByteOrderLittleEndian 0 |
A macro that is defined to 1 when the compilation is on a little endian machine, and to 0 otherwise.
| #define _PI 3.1415926535897932384626433832795028841971693993751058209749445923078164062 |
The constant pi to high precision.
Referenced by stir::Scanner::check_consistency(), stir::CListModeDataROOT::CListModeDataROOT(), stir::ScatterSimulation::detection_efficiency_no_scatter(), stir::FBP3DRPReconstruction::do_colsher_filter_view(), stir::ScatterSimulation::downsample_scanner(), stir::extend_segment(), stir::ProjDataInfoCylindricalNoArcCorr::find_cartesian_coordinates_given_scanner_coordinates(), stir::ProjDataInfoCylindricalNoArcCorr::find_scanner_coordinates_given_cartesian_coordinates(), stir::fourier_1d_for_real_data(), stir::from_min_pi_plus_pi_to_0_2pi(), stir::ProjDataInfoCylindricalNoArcCorr::get_bin(), stir::ProjMatrixByDenselUsingRayTracing::get_element(), stir::Ellipsoid::get_geometric_volume(), stir::EllipsoidalCylinder::get_geometric_volume(), stir::inverse_fourier_1d_for_real_data_corrupting_input(), stir::EllipsoidalCylinder::is_inside_shape(), stir::LORInAxialAndNoArcCorrSinogramCoordinates< coordT >::LORInAxialAndNoArcCorrSinogramCoordinates(), stir::LORInAxialAndSinogramCoordinates< coordT >::LORInAxialAndSinogramCoordinates(), stir::ecat::ecat7::make_ECAT7_main_header(), stir::ProjDataInfoCylindrical::parameter_info(), stir::Scanner::parameter_info(), stir::InterfilePDFSHeader::post_processing(), stir::InterfilePDFSHeaderSPECT::post_processing(), stir::Shape3DWithOrientation::post_processing(), stir::ProjDataInfoCylindrical::ProjDataInfoCylindrical(), stir::ProjDataInfoCylindricalNoArcCorr::ProjDataInfoCylindricalNoArcCorr(), stir::FourierRebinning::rebin(), stir::ProjDataInfoTests::run_coordinate_test(), stir::ProjDataInfoTests::run_coordinate_test_for_realistic_scanner(), stir::ProjDataInfoTests::run_lor_get_s_test(), stir::ArrayTests::run_tests(), stir::OutputFileFormatTests::run_tests(), stir::ProjDataInfoCylindricalArcCorrTests::run_tests(), stir::Scanner::Scanner(), stir::Shape3DWithOrientation::set_key_values(), stir::ColsherFilter::set_up(), stir::ProjMatrixByBinSPECTUB::set_up(), stir::erfTests::test_FastErf(), stir::to_0_2pi(), and stir::write_basic_interfile_PDFS_header().
|
inline |
returns the square of a number, templated.
References square().
Referenced by absolute_max_eigenvector_using_power_method(), stir::ProjMatrixByDenselOnCartesianGridUsingElement::calculate_proj_matrix_elems_for_one_densel(), stir::LORAs2Points< coordT >::change_representation_for_block(), stir::GibbsPenalty< elemT, potentialT >::compute_default_weights(), stir::QuadraticPrior< elemT >::compute_value(), coordinate_between_2_lines(), distance_between_line_and_point(), stir::ScatterSimulation::energy_lower_limit(), find_LOR_intersections_with_cylinder(), stir::ProjDataInfoCylindricalNoArcCorr::find_scanner_coordinates_given_cartesian_coordinates(), stir::ProjDataInfo::get_costheta(), stir::ProjMatrixByDenselUsingRayTracing::get_element(), stir::ProjDataInfoCylindrical::get_LOR(), stir::ProjDataInfoGenericNoArcCorr::get_LOR(), stir::ProjDataInfoCylindrical::get_tantheta(), stir::EllipsoidalCylinder::is_inside_shape(), stir::ScatterSimulation::max_cos_angle(), randoms_from_singles(), stir::RigidObject3DTransformation::RigidObject3DTransformation(), stir::MatchTrackerAndScanner::run(), stir::ProjDataInfoCylindricalArcCorrTests::run_tests(), stir::QuaternionTests::run_tests(), square(), stir::ProjMatrixElemsForOneBin::square_sum(), stir::ProjMatrixElemsForOneDensel::square_sum(), truncate_rim(), and stir::RelativeDifferencePrior< elemT >::value().
| CartesianCoordinate3D< coordT > stir::cross_product | ( | const CartesianCoordinate3D< coordT > & | a, |
| const CartesianCoordinate3D< coordT > & | b ) |
the cross-product for 3-dimensional coordinates.

References cross_product().
Referenced by cross_product().
|
inline |
Compute decay-correction factor for a time frame.
This function computes the factor needed to convert average number of counts per second to activity at time 0, i.e. it returns
![\[ \frac{(t_2-t_1)}{ \int_{t_1}^{t_2} \! 2^{-t/\mathrm{halflife}} \, dt} \]](form_13.png)
References decay_correction_factor().
Referenced by stir::DynamicDiscretisedDensity::decay_correct_frames(), stir::PlasmaData::decay_correct_PlasmaData(), decay_correction_factor(), decay_correction_factor(), and randoms_from_singles().
|
inline |
Computes the decay-correction factor for activity at a given time point.
This function computes the correction factor to convert activity at t0 + rel_time to activity at t0, i.e.
![\[ 2^{(\mathrm{rel\_time} / \mathrm{halflife})} \]](form_14.png)
References decay_correction_factor().
| void stir::error | ( | const char *const | s, |
| ... ) |
Print error with format string a la printf and throw exception.
The arguments are the same as if you would call printf(). The error message is written to stderr, preceeded by "ERROR:", a std::string is constructed with the error message, and throw is called with the string as argument.
Note that because we throw an exception, the caller can catch it. Prior to STIR 2.1, this was not possible as stir::error directly called std::exit.
References error().
Referenced by absolute_max_eigenvector_using_shifted_power_method(), stir::AbsTimeIntervalFromDynamicData::AbsTimeIntervalFromDynamicData(), stir::AbsTimeIntervalFromECAT7ACF::AbsTimeIntervalFromECAT7ACF(), stir::GibbsPenalty< elemT, potentialT >::accumulate_Hessian_times_input(), stir::QuadraticPrior< float >::accumulate_Hessian_times_input(), stir::GeneralisedObjectiveFunction< TargetT >::actual_accumulate_sub_Hessian_times_input_without_penalty(), stir::PoissonLogLikelihoodWithLinearModelForMeanAndListModeDataWithProjMatrixByBin< TargetT >::actual_accumulate_sub_Hessian_times_input_without_penalty(), stir::PoissonLogLikelihoodWithLinearModelForMeanAndProjData< TargetT >::actual_accumulate_sub_Hessian_times_input_without_penalty(), stir::GeneralisedObjectiveFunction< TargetT >::actual_add_multiplication_with_approximate_sub_Hessian_without_penalty(), stir::PoissonLogLikelihoodWithLinearModelForMeanAndProjData< TargetT >::actual_add_multiplication_with_approximate_sub_Hessian_without_penalty(), stir::BackProjectorByBin::actual_back_project(), stir::BackProjectorByBinParallelproj::actual_back_project(), stir::BackProjectorByBinUsingProjMatrixByBin::actual_back_project(), stir::PoissonLogLikelihoodWithLinearModelForMeanAndListModeDataWithProjMatrixByBin< TargetT >::actual_compute_objective_function_without_penalty(), stir::PoissonLogLikelihoodWithLinearModelForMeanAndProjData< TargetT >::actual_compute_objective_function_without_penalty(), stir::PoissonLogLikelihoodWithLinearModelForMeanAndListModeDataWithProjMatrixByBin< TargetT >::actual_compute_subset_gradient_without_penalty(), stir::PoissonLogLikelihoodWithLinearModelForMeanAndProjData< TargetT >::actual_compute_subset_gradient_without_penalty(), stir::ForwardProjectorByBin::actual_forward_project(), stir::FBP3DRPReconstruction::actual_reconstruct(), stir::MultiDynamicDiscretisedDensityOutputFileFormat::actual_write_to_file(), stir::GeneralisedPrior< DataT >::add_multiplication_with_approximate_Hessian(), stir::RelativeDifferencePrior< elemT >::add_multiplication_with_approximate_Hessian(), stir::GeneralisedObjectiveFunction< TargetT >::add_multiplication_with_approximate_sub_Hessian_without_penalty(), stir::PoissonLogLikelihoodWithLinearModelForMeanAndListModeDataWithProjMatrixByBin< TargetT >::add_subset_sensitivity(), stir::PoissonLogLikelihoodWithLinearModelForMeanAndProjData< TargetT >::add_subset_sensitivity(), stir::FilePath::append(), stir::PatlakPlot::apply_linear_regression(), stir::ArrayFilterUsingRealDFTWithPadding< num_dimensions, elemT >::ArrayFilterUsingRealDFTWithPadding(), stir::ArrayFilterUsingRealDFTWithPadding< 2, float >::ArrayFilterUsingRealDFTWithPadding(), stir::OSSPSReconstruction< TargetT >::ask_parameters(), stir::BackProjectorByBin::back_project(), stir::BackProjectorByBin::back_project(), stir::BackProjectorByBinNiftyPET::back_project(), stir::DynamicProjData::calibrate_frames(), stir::PETSIRDCListmodeInputFileFormat::can_read(), stir::BackProjectorByBin::check(), stir::BackProjectorByBin::check(), stir::BinNormalisation::check(), stir::ForwardProjectorByBin::check(), stir::ForwardProjectorByBin::check(), stir::GibbsPenalty< elemT, potentialT >::check(), stir::LogcoshPrior< elemT >::check(), stir::PLSPrior< elemT >::check(), stir::ProjectorByBinPair::check(), stir::Reconstruction< TargetT >::check(), stir::RelativeDifferencePrior< elemT >::check(), stir::GE::RDF_HDF5::GEHDF5Wrapper::check_GE_signature(), stir::ParseDiscretisedDensityParameters::check_values(), stir::ecat::ecat7::CListModeDataECAT< CListRecordT >::CListModeDataECAT(), stir::ecat::CListModeDataECAT8_32bit::CListModeDataECAT8_32bit(), stir::GE::RDF_HDF5::CListModeDataGEHDF5::CListModeDataGEHDF5(), stir::CListModeDataLMF::CListModeDataLMF(), stir::CListModeDataPENN::CListModeDataPENN(), stir::CListModeDataPETSIRD::CListModeDataPETSIRD(), stir::CListModeDataROOT::CListModeDataROOT(), stir::CListModeDataSAFIR< CListRecordT >::CListModeDataSAFIR(), stir::SqrtHessianRowSum< TargetT >::compute_approximate_Hessian_row_sum(), stir::GeneralisedObjectiveFunction< stir::DiscretisedDensity< 3, float > >::compute_gradient(), stir::GibbsPenalty< elemT, potentialT >::compute_gradient(), stir::GeneralisedPrior< DataT >::compute_gradient_times_input(), stir::GibbsPenalty< elemT, potentialT >::compute_gradient_times_input(), stir::GeneralisedPrior< DataT >::compute_Hessian(), stir::GibbsPenalty< elemT, potentialT >::compute_Hessian(), stir::GeneralisedPrior< DataT >::compute_Hessian_diagonal(), stir::GibbsPenalty< elemT, potentialT >::compute_Hessian_diagonal(), stir::SqrtHessianRowSum< TargetT >::compute_Hessian_row_sum(), stir::KOSMAPOSLReconstruction< TargetT >::compute_kernelised_image(), stir::GeneralisedObjectiveFunction< TargetT >::compute_objective_function_without_penalty(), stir::PoissonLogLikelihoodWithLinearModelForMean< TargetT >::compute_sensitivities(), stir::PoissonLogLikelihoodWithLinearModelForMean< TargetT >::compute_sub_gradient_without_penalty(), stir::PoissonLogLikelihoodWithLinearModelForMean< TargetT >::compute_sub_gradient_without_penalty_plus_sensitivity(), stir::GibbsPenalty< elemT, potentialT >::compute_value(), stir::PoissonLLReconstructionTests< TargetT >::construct_log_likelihood(), stir::PoissonLLReconstructionTests< TargetT >::construct_projector_pair(), stir::DiscretisedShape3D::construct_volume(), stir::ModelMatrix< num_param >::convert_to_total_frame_counts(), stir::ModelMatrix< 1 >::convert_to_total_frame_counts(), stir::DataSymmetriesForBins_PET_CartesianGrid::DataSymmetriesForBins_PET_CartesianGrid(), stir::DataSymmetriesForDensels_PET_CartesianGrid::DataSymmetriesForDensels_PET_CartesianGrid(), stir::ScatterSimulation::detection_efficiency(), stir::ScatterSimulation::detection_efficiency_no_scatter(), determinant(), DICOM_date_time_to_DT(), DICOM_datetime_to_secs_since_Unix_epoch(), distributable_computation(), stir::DistributedWorker< TargetT >::distributable_computation(), stir::DynamicProjData::divide_with_duration(), stir::FBP3DRPReconstruction::do_colsher_filter_view(), stir::FBP3DRPReconstruction::do_forward_project_view(), stir::ScatterSimulation::downsample_density_image_for_scatter_points(), stir::EllipsoidalCylinder::EllipsoidalCylinder(), stir::EllipsoidalCylinder::EllipsoidalCylinder(), error(), error(), stir::FilePath::FilePath(), stir::ProjData::fill(), stir::ProjData::fill(), stir::PoissonLogLikelihoodWithLinearModelForMean< stir::DiscretisedDensity< 3, float > >::fill_nonidentifiable_target_parameters(), find_centre_of_gravity(), stir::RigidObject3DTransformation::find_closest_transformation(), stir::Scanner::find_detection_position_given_cartesian_coordinate(), stir::ecat::find_ECAT_data_type(), stir::FactoryRegistry< Key, Factory, Compare >::find_factory(), find_fwhm_in_image(), find_STIR_config_file(), stir::ecat::find_type_from_ECAT_data_type(), stir::ForwardProjectorByBin::forward_project(), fourier_1d(), fourier_1d_for_real_data(), stir::Scanner::get_axial_length(), stir::CListEventSAFIR< Derived >::get_bin(), stir::ProjDataInfoCylindricalArcCorr::get_bin(), stir::ProjDataInfoCylindricalNoArcCorr::get_bin(), stir::ProjDataInfoGenericNoArcCorr::get_bin(), stir::BinNormalisationFromAttenuationImage::get_bin_efficiency(), stir::BinNormalisationFromProjData::get_bin_efficiency(), stir::ProjDataFromStream::get_bin_value(), stir::Radionuclide::get_branching_ratio(), stir::BinNormalisationWithCalibration::get_calib_decay_branching_ratio_factor(), stir::Scanner::get_coincidence_window_width_in_ps(), stir::Array< num_dimensions, elemT >::get_const_full_data_ptr(), stir::Scanner::get_coordinate_for_det_pos(), stir::Scanner::get_coordinate_for_index(), stir::Scanner::get_det_pos_for_index(), stir::PatlakPlot::get_dynamic_image_from_parametric_image(), stir::GE::RDF_HDF5::CListModeDataGEHDF5::get_empty_record_sptr(), stir::ProjDataInfo::get_empty_related_viewgrams(), stir::Radionuclide::get_energy(), stir::Array< num_dimensions, elemT >::get_full_data_ptr(), stir::Radionuclide::get_half_life(), stir::IterativeReconstruction< TargetT >::get_initial_data_ptr(), stir::AnalyticReconstruction::get_input_data(), stir::IterativeReconstruction< TargetT >::get_input_data(), stir::PoissonLogLikelihoodWithLinearModelForMeanAndListModeData< TargetT >::get_input_data(), stir::Radionuclide::get_modality(), stir::PatlakPlot::get_model_matrix(), stir::RigidObject3DMotionFromPolaris::get_motion_in_tracker_coords_rel_time(), stir::InputStreamFromROOTFileForCylindricalPET::get_num_axial_crystals_per_singles_unit(), stir::InputStreamFromROOTFileForCylindricalPET::get_num_trans_crystals_per_singles_unit(), stir::ProjDataFromStream::get_offset(), stir::BackProjectorByBin::get_output(), stir::BackProjectorByBinParallelproj::get_output(), stir::GeneralisedObjectiveFunction< stir::DiscretisedDensity< 3, float > >::get_prior_ptr(), stir::RigidObject3DTransformation::get_relative_transformation(), stir::ProjDataInfoCylindrical::get_ring_pair_for_segment_axial_pos_num(), stir::ProjDataInfoCylindrical::get_ring_radius(), stir::ListModeData::get_scanner(), stir::ProjDataFromStream::get_segment_by_sinogram(), stir::ProjDataFromStream::get_segment_by_view(), stir::SinglesRatesForTimeSlices::get_singles(), stir::ProjDataFromStream::get_sinogram(), stir::ProjData::get_subset(), stir::BackProjectorByBinNiftyPET::get_symmetries_used(), stir::BackProjectorByBinParallelproj::get_symmetries_used(), stir::BackProjectorByBinUsingInterpolation::get_symmetries_used(), stir::BackProjectorByBinUsingProjMatrixByBin::get_symmetries_used(), stir::BackProjectorByBinUsingSquareProjMatrixByBin::get_symmetries_used(), stir::ForwardProjectorByBinNiftyPET::get_symmetries_used(), stir::ForwardProjectorByBinParallelproj::get_symmetries_used(), stir::ForwardProjectorByBinUsingProjMatrixByBin::get_symmetries_used(), stir::ForwardProjectorByBinUsingRayTracing::get_symmetries_used(), stir::ListModeData::get_total_number_of_events(), stir::ProjDataFromStream::get_viewgram(), stir::InputStreamFromROOTFile::GetEntryCheck(), stir::ListModeData_dummy::has_delayeds(), stir::Reconstruction< TargetT >::initialise(), stir::GE::RDF_HDF5::GEHDF5Wrapper::initialise_geo_factors_data(), stir::GE::RDF_HDF5::GEHDF5Wrapper::initialise_proj_data(), stir::InputStreamWithRecords< RecordT, OptionsT >::InputStreamWithRecords(), stir::InputStreamWithRecords< RecordT, OptionsT >::InputStreamWithRecords(), integrate_discrete_function(), Interfile_datetime_to_DICOM(), interpolate_blocks_on_cylindrical_projdata(), interpolate_line(), inverse_fourier_1d_for_real_data_corrupting_input(), inverse_SSRB(), stir::FilePath::is_directory(), stir::ChainedBinNormalisation::is_first_trivial(), stir::GE::RDF_HDF5::GEHDF5Wrapper::is_list_file(), stir::FilePath::is_regular_file(), stir::ChainedBinNormalisation::is_second_trivial(), stir::ProjDataInfo::is_tof_data(), stir::BinNormalisationFromProjData::is_TOF_only_norm(), stir::BinNormalisationPETFromComponents::is_trivial(), stir::LmToProjData::LmToProjData(), maximum_location_per_slice(), stir::ModelMatrix< num_param >::multiply_dynamic_image_with_model_and_add_to_input(), stir::PatlakPlot::multiply_dynamic_image_with_model_gradient(), stir::PatlakPlot::multiply_dynamic_image_with_model_gradient_and_add_to_input(), stir::ModelMatrix< num_param >::multiply_parametric_image_with_model_and_add_to_input(), stir::NonRigidObjectTransformationUsingBSplines< num_dimensions, elemT >::NonRigidObjectTransformationUsingBSplines(), open_read_binary(), open_read_binary(), open_write_binary(), open_write_binary(), stir::VectorWithOffset< T >::operator*=(), stir::VectorWithOffset< T >::operator+=(), stir::NumericVectorWithOffset< T, elemT >::operator-=(), stir::VectorWithOffset< T >::operator-=(), stir::VectorWithOffset< T >::operator/=(), stir::DiscretisedShape3D::operator==(), stir::PETSIRDInfo::PETSIRDInfo(), stir::CreateTailMaskFromACFs::post_processing(), stir::InterfileListmodeHeaderSiemens::post_processing(), stir::InterfileNormHeaderSiemens::post_processing(), stir::InterfilePDFSHeader::post_processing(), stir::InterfilePDFSHeaderSiemens::post_processing(), stir::InterfilePDFSHeaderSPECT::post_processing(), stir::InterfileRawDataHeaderSiemens::post_processing(), stir::KOSMAPOSLReconstruction< TargetT >::post_processing(), stir::PoissonLogLikelihoodWithLinearModelForMeanAndProjData< TargetT >::post_processing(), stir::ScatterEstimation::post_processing(), stir::LmToProjData::process_data(), stir::ScatterEstimation::process_data(), stir::ScatterSimulation::process_data_for_view_segment_num(), stir::ProjDataInfoBlocksOnCylindricalNoArcCorr::ProjDataInfoBlocksOnCylindricalNoArcCorr(), stir::ProjDataInfo::ProjDataInfoCTI(), stir::ProjDataInfoCylindricalNoArcCorr::ProjDataInfoCylindricalNoArcCorr(), stir::ProjDataInfo::ProjDataInfoGE(), stir::ProjDataInfoGenericNoArcCorr::ProjDataInfoGenericNoArcCorr(), stir::ProjDataInfoSubsetByView::ProjDataInfoSubsetByView(), stir::ProjDataInMemory::ProjDataInMemory(), stir::BloodFrameData::read_blood_frame_data(), stir::ecat::ecat7::read_ECAT7_exam_info(), stir::DiscretisedDensity< num_dimensions, elemT >::read_from_file(), stir::ecat::ecat6::ECAT6ImageInputFileFormat::read_from_file(), stir::ecat::ecat7::ECAT7DynamicDiscretisedDensityInputFileFormat::read_from_file(), stir::ecat::ecat7::ECAT7DynamicDiscretisedDensityInputFileFormat::read_from_file(), stir::ecat::ecat7::ECAT7ImageInputFileFormat::read_from_file(), stir::ecat::ecat7::ECAT962ListmodeInputFileFormat::read_from_file(), stir::ecat::ecat7::ECAT966ListmodeInputFileFormat::read_from_file(), stir::ecat::ECAT8_32bitListmodeInputFileFormat::read_from_file(), stir::InterfileDynamicDiscretisedDensityInputFileFormat::read_from_file(), stir::InterfileImageInputFileFormat::read_from_file(), stir::InterfileParametricDiscretisedDensityInputFileFormat::read_from_file(), stir::ITKImageInputFileFormat< STIRImageType >::read_from_file(), stir::MultiDynamicDiscretisedDensityInputFileFormat::read_from_file(), stir::MultiParametricDiscretisedDensityInputFileFormat::read_from_file(), stir::PENNListmodeInputFileFormat::read_from_file(), stir::PETSIRDCListmodeInputFileFormat::read_from_file(), stir::ProjData::read_from_file(), read_from_file(), stir::ROOTListmodeInputFileFormat::read_from_file(), stir::SAFIRCListmodeInputFileFormat< EventDataType >::read_from_file(), stir::SinglesRatesFromJSON::read_from_file(), stir::GatedSpatialTransformation::read_from_files(), stir::TimeGateDefinitions::read_gdef_file(), read_interfile_dynamic_image(), read_interfile_dynamic_image(), read_interfile_image(), read_interfile_parametric_image(), read_interfile_parametric_image(), stir::GE::RDF_HDF5::GEHDF5Wrapper::read_list_data(), stir::PlasmaData::read_plasma_data(), stir::GE::RDF_HDF5::GEHDF5Wrapper::read_singles(), stir::ecat::ecat7::SinglesRatesFromECAT7::read_singles_from_file(), stir::ecat::ecat7::SinglesRatesFromSglFile::read_singles_from_sgl_file(), stir::FourierRebinning::rebin(), distributed::receive_and_construct_exam_and_proj_data_info_ptr(), distributed::receive_image_values_and_fill_image_ptr(), stir::AnalyticReconstruction::reconstruct(), stir::ReconstructionTests< TargetT >::reconstruct(), stir::CListModeDataPETSIRD::reopen_and_prime(), stir::ListModeData_dummy::reset(), stir::CorrectProjDataApplication::run(), stir::MatchTrackerAndScanner::run(), stir::DateTimeTest::run_tests(), stir::TestDataProcessorProjectors::run_tests(), stir::TestFBP2D::run_tests(), stir::TestFBP3DRP::run_tests(), stir::TestGPUProjectors::run_tests(), stir::TestOSMAPOSL::run_tests(), stir::ScatterSimulation::sample_scatter_points(), stir::InputStreamWithRecords< RecordT, OptionsT >::save_get_position(), stir::InputStreamWithRecordsFromUPENNtxt::save_get_position(), stir::ListModeData_dummy::save_get_position(), stir::DiscretisedShape3D::scale(), stir::ModelMatrix< num_param >::scale_model_matrix(), stir::ScatterEstimation::ScatterEstimation(), secs_since_Unix_epoch_to_DICOM_datetime(), stir::GeneralisedPoissonNoiseGenerator::seed(), stir::PoissonLogLikelihoodWithLinearModelForMeanAndListModeData< TargetT >::set_additive_proj_data_sptr(), stir::ProjMatrixByBinSPECTUB::set_attenuation_type(), stir::ProjDataInfoGenericNoArcCorr::set_azimuthal_angle_offset(), stir::ProjDataInfoGenericNoArcCorr::set_azimuthal_angle_sampling(), stir::ProjDataFromStream::set_bin_value(), stir::GeneralisedPrior< TargetT >::set_defaults(), stir::DynamicDiscretisedDensity::set_density(), stir::CListEventCylindricalScannerWithViewTangRingRingEncoding< Derived >::set_detection_position(), stir::CListEventPENN::set_detection_position(), stir::ecat::CListEventECAT8_32bit::set_detection_position(), stir::GE::RDF_HDF5::CListRecordGEHDF5::set_detection_position(), stir::DetectorCoordinateMap::set_detector_map(), stir::ListModeData_dummy::set_get_position(), stir::IterativeReconstruction< TargetT >::set_input_data(), stir::LmToProjData::set_input_data(), stir::OSMAPOSLReconstruction< TargetT >::set_MAP_model(), stir::SumOfGeneralisedObjectiveFunctions< ObjFuncT, TargetT, ParentT >::set_num_subsets(), stir::ProjDataInfoGenericNoArcCorr::set_num_views(), stir::ProjDataInfoSubsetByView::set_num_views(), stir::Scanner::set_num_virtual_axial_crystals_per_block(), stir::Scanner::set_num_virtual_transaxial_crystals_per_block(), stir::ScatterSimulation::set_output_proj_data(), stir::KeyParser::set_parsing_object(), stir::ProjDataInfoCylindrical::set_ring_radii_for_all_views(), stir::ProjDataInfoGenericNoArcCorr::set_ring_radii_for_all_views(), stir::ProjDataInfoGenericNoArcCorr::set_ring_spacing(), stir::ProjDataFromStream::set_segment(), stir::ProjDataFromStream::set_segment(), stir::KeyParser::set_shared_parsing_object(), stir::PoissonLogLikelihoodWithLinearModelForMeanAndListModeData< TargetT >::set_skip_lm_input_file(), stir::PoissonLogLikelihoodWithLinearModelForMeanAndListModeData< stir::DiscretisedDensity< 3, float > >::set_skip_lm_input_file(), stir::IterativeReconstruction< TargetT >::set_start_subset_num(), stir::PoissonLogLikelihoodWithLinearModelForMean< TargetT >::set_subsensitivity_filenames(), stir::ProjDataInfo::set_tof_mash_factor(), stir::BackProjectorByBinNiftyPET::set_up(), stir::BackProjectorByBinUsingInterpolation::set_up(), stir::BinNormalisationFromAttenuationImage::set_up(), stir::BinNormalisationPETFromComponents::set_up(), stir::ForwardProjectorByBinNiftyPET::set_up(), stir::ForwardProjectorByBinUsingRayTracing::set_up(), stir::GeneralisedObjectiveFunction< TargetT >::set_up(), stir::GeneralisedPrior< TargetT >::set_up(), stir::InputStreamFromROOTFile::set_up(), stir::InputStreamFromROOTFileForCylindricalPET::set_up(), stir::InputStreamFromROOTFileForECATPET::set_up(), stir::InputStreamWithRecordsFromUPENNbin::set_up(), stir::IterativeReconstruction< TargetT >::set_up(), stir::LmToProjData::set_up(), stir::LmToProjDataWithMC::set_up(), stir::OSMAPOSLReconstruction< TargetT >::set_up(), stir::PLSPrior< elemT >::set_up(), stir::ProjectorByBinPairUsingParallelproj::set_up(), stir::ProjMatrixByBin::set_up(), stir::ProjMatrixByBinFromFile::set_up(), stir::ProjMatrixByBinPinholeSPECTUB::set_up(), stir::ProjMatrixByBinSinglePhoton::set_up(), stir::ProjMatrixByBinSPECTUB::set_up(), stir::ProjMatrixByBinUsingInterpolation::set_up(), stir::ProjMatrixByBinUsingRayTracing::set_up(), stir::ProjMatrixByBinUsingSolidAngle::set_up(), stir::ProjMatrixByBinWithPositronRange::set_up(), stir::ProjMatrixByDenselOnCartesianGridUsingElement::set_up(), stir::ProjMatrixByDenselUsingRayTracing::set_up(), stir::Scanner::set_up(), stir::ScatterEstimation::set_up(), stir::PoissonLogLikelihoodWithLinearModelForMeanAndListModeData< TargetT >::set_up_before_sensitivity(), stir::PoissonLogLikelihoodWithLinearModelForMeanAndListModeDataWithProjMatrixByBin< TargetT >::set_up_before_sensitivity(), stir::PoissonLogLikelihoodWithLinearModelForMeanAndProjData< TargetT >::set_up_before_sensitivity(), stir::KeyParser::set_variable(), stir::ProjDataFromStream::set_viewgram(), stir::Sinogram< elemT >::Sinogram(), SSRB(), SSRB(), stir::DistributedWorker< TargetT >::start(), stir::Timer::start(), stir::BackProjectorByBin::start_accumulating_in_new_target(), stir::GeneralisedObjectiveFunction< TargetT >::subsets_are_approximately_balanced(), stir::TestGPUProjectors::test_adjoints(), stir::ModelMatrix< num_param >::threshold_model_array(), stir::TimeFrameDefinitions::TimeFrameDefinitions(), stir::TimeFrameDefinitions::TimeFrameDefinitions(), stir::TimeFrameDefinitions::TimeFrameDefinitions(), truncate_rim(), stir::ModelMatrix< num_param >::uncalibrate(), stir::ScatterEstimation::upsample_and_fit_scatter_estimate(), stir::Viewgram< elemT >::Viewgram(), stir::Viewgram< float >::Viewgram(), stir::GatedSpatialTransformation::warp_image(), stir::ecat::ecat7::SinglesRatesFromSglFile::write(), write_basic_interfile_image_header(), write_basic_interfile_PDFS_header(), stir::ModelMatrix< 1 >::write_to_file(), write_to_file(), stir::Array< num_dimensions, elemT >::xapyb(), stir::Array< num_dimensions, elemT >::xapyb(), stir::NumericVectorWithOffset< T, elemT >::xapyb(), stir::ProjData::xapyb(), stir::ProjData::xapyb(), stir::ProjDataInMemory::xapyb(), stir::ProjDataInMemory::xapyb(), zoom_image(), zoom_viewgram(), zoom_viewgram(), zoom_viewgrams(), and stir::ZoomOptions::ZoomOptions().
|
inline |
Use this function for writing error messages and throwing an exception.
The argument is expected to be a string, but could be anything for which std::ostream::operator<< would work.
This function currently first writes a newline, then ERROR:, then string and then another newline to std::cerr. Then it throws an exception.
stir::format is useful in this context.
References error().
|
inline |
extracts a line from an array in the direction of the specified dimension.
References extract_line(), stir::VectorWithOffset< T >::get_max_index(), and stir::VectorWithOffset< T >::get_min_index().
Referenced by extract_line(), find_fwhm_in_image(), and interpolate_line().
| void stir::info | ( | const STRING & | string, |
| const int | verbosity_level = 1 ) |
Use this function for writing informational messages.
The argument is expected to be a string, but could be anything for which std::ostream::operator<< would work.
This function currently first writes a newline, then INFO, then string and then another newline to std::cerr.
stir::format is useful in this context.
References info().
Referenced by stir::PoissonLogLikelihoodWithLinearModelForMeanAndProjData< TargetT >::actual_accumulate_sub_Hessian_times_input_without_penalty(), stir::PoissonLogLikelihoodWithLinearModelForMeanAndProjData< TargetT >::actual_add_multiplication_with_approximate_sub_Hessian_without_penalty(), stir::PoissonLogLikelihoodWithLinearModelForMeanAndProjData< stir::DiscretisedDensity< 3, float > >::actual_compute_objective_function_without_penalty(), stir::PoissonLogLikelihoodWithLinearModelForMeanAndListModeDataWithProjMatrixByBin< TargetT >::add_subset_sensitivity(), stir::BackProjectorByBin::back_project(), stir::SqrtHessianRowSum< TargetT >::compute_approximate_Hessian_row_sum(), stir::LogcoshPrior< elemT >::compute_gradient(), stir::PLSPrior< elemT >::compute_gradient(), stir::QuadraticPrior< elemT >::compute_gradient(), stir::RelativeDifferencePrior< elemT >::compute_gradient(), stir::SqrtHessianRowSum< TargetT >::compute_Hessian_row_sum(), stir::Shape3D::construct_volume(), stir::DataSymmetriesForBins_PET_CartesianGrid::DataSymmetriesForBins_PET_CartesianGrid(), stir::ScatterSimulation::detection_efficiency_no_scatter(), DICOM_datetime_to_secs_since_Unix_epoch(), distributable_computation(), stir::DistributedWorker< TargetT >::distributable_computation(), distributable_computation_cache_enabled(), stir::ScatterSimulation::downsample_density_image_for_scatter_points(), stir::ScatterSimulation::downsample_scanner(), stir::IterativeReconstruction< TargetT >::end_of_iteration_processing(), stir::FilePath::exists(), stir::FBP2DReconstruction::FBP2DReconstruction(), stir::PoissonLogLikelihoodWithLinearModelForMean< stir::DiscretisedDensity< 3, float > >::fill_nonidentifiable_target_parameters(), stir::ForwardProjectorByBin::forward_project(), stir::BackProjectorByBinParallelproj::get_output(), info(), stir::FilePath::is_directory(), stir::FilePath::is_regular_file(), stir::KOSMAPOSLReconstruction< TargetT >::KOSMAPOSLReconstruction(), ML_estimate_component_based_normalisation(), stir::OSMAPOSLReconstruction< TargetT >::OSMAPOSLReconstruction(), stir::OSSPSReconstruction< TargetT >::OSSPSReconstruction(), stir::LogcoshPrior< elemT >::parabolic_surrogate_curvature(), stir::QuadraticPrior< elemT >::parabolic_surrogate_curvature(), stir::PETSIRDInfo::PETSIRDInfo(), stir::InterfilePDFSHeader::post_processing(), stir::KOSMAPOSLReconstruction< TargetT >::post_processing(), stir::NonRigidObjectTransformationUsingBSplines< num_dimensions, elemT >::post_processing(), stir::ScatterEstimation::post_processing(), stir::OSSPSReconstruction< TargetT >::precompute_denominator_of_conditioner_without_penalty(), stir::ScatterEstimation::process_data(), stir::SqrtHessianRowSum< TargetT >::process_data(), stir::ProjDataInfoCylindrical::ProjDataInfoCylindrical(), randoms_from_singles(), stir::ecat::ecat7::ECAT966ListmodeInputFileFormat::read_from_file(), stir::ProjData::read_from_file(), stir::FourierRebinning::rebin(), stir::AnalyticReconstruction::reconstruct(), stir::IterativeReconstruction< TargetT >::reconstruct(), stir::ScatterSimulation::sample_scatter_points(), stir::PLSPrior< elemT >::set_anatomical_filename(), stir::ProjMatrixByBinPinholeSPECTUB::set_attenuation_image_sptr(), stir::ProjMatrixByBinSPECTUB::set_attenuation_image_sptr(), stir::ForwardProjectorByBinParallelproj::set_input(), stir::PLSPrior< elemT >::set_kappa_filename(), stir::PoissonLogLikelihoodWithLinearModelForMeanAndProjData< stir::DiscretisedDensity< 3, float > >::set_num_subsets(), stir::ProjDataInfo::set_tof_mash_factor(), stir::InputStreamFromROOTFile::set_up(), stir::LmToProjData::set_up(), stir::OSMAPOSLReconstruction< TargetT >::set_up(), stir::ProjMatrixByBinPinholeSPECTUB::set_up(), stir::ProjMatrixByBinSPECTUB::set_up(), stir::ProjMatrixByBinUsingRayTracing::set_up(), stir::Reconstruction< TargetT >::set_up(), stir::ScatterEstimation::set_up(), stir::PoissonLogLikelihoodWithLinearModelForMeanAndProjData< TargetT >::set_up_before_sensitivity(), stir::PoissonLogLikelihoodWithLinearModelForMean< stir::DiscretisedDensity< 3, float > >::set_use_subset_sensitivities(), stir::InterfileHeader::set_version_specific_keys(), setup_distributable_computation(), stir::SRT2DReconstruction::SRT2DReconstruction(), stir::SRT2DSPECTReconstruction::SRT2DSPECTReconstruction(), stir::LmToProjDataBootstrap< LmToProjDataT >::start_new_time_frame(), stir::PoissonLogLikelihoodWithLinearModelForMeanAndProjDataTests::test_approximate_Hessian_concavity(), stir::ObjectiveFunctionTests< ObjectiveFunctionT, TargetT >::test_gradient(), stir::ObjectiveFunctionTests< ObjectiveFunctionT, TargetT >::test_Hessian(), stir::GeneralisedPriorTests::test_Hessian_against_numerical(), stir::GeneralisedPriorTests::test_Hessian_convexity_configuration(), stir::TimeFrameDefinitions::TimeFrameDefinitions(), transform_3d_object(), stir::OSMAPOSLReconstruction< TargetT >::update_estimate(), stir::OSSPSReconstruction< TargetT >::update_estimate(), and stir::ScatterEstimation::upsample_and_fit_scatter_estimate().
|
inline |
Implements standard linear regression on VectorWithOffset data.
The linear_regression function does straightforward (1 dimensional) weighted least squares fitting.
3 VectorWithOffsets of measured_data, coordinates, weights
1 optional boolean value use_estimated_variance (default=true)
fitted parameters : constant, scale
goodness of fit measures : chi_square and the (co)variances
This solves the minimisation problem:
Find constant, scale such that
chi_square =
sum_i weights[i]*
(constant + scale*coordinates[i] - measured_data[i])^2
is minimal.
When use_estimated_variance == false, the (co)variances are computed assuming that 1/weights[i] is the standard deviation on measured_data[i]. In particular, this means that the (co)variances depend only on the weights and the coordinates.
Alternatively, when use_estimated_variance == true, the weights are considered to be really only proportional to the 1/variance. Then the estimated variance is used to get sensible estimates of the errors:
estimated_variance = chi_square/(measured_data.get_length() - 2)
estimated_covariance_matrix = original_covariance_matrix * estimated_variance
References stir::VectorWithOffset< T >::begin(), stir::VectorWithOffset< T >::end(), stir::VectorWithOffset< T >::get_max_index(), stir::VectorWithOffset< T >::get_min_index(), and linear_regression().
Referenced by stir::PatlakPlot::apply_linear_regression(), linear_regression(), linear_regression(), and stir::linear_regressionTests::run_tests().
|
inline |
Implements standard linear regression.
This function takes the data as iterators for maximum flexibility. Note that it is assumed (but not checked) that the measured_data, coordinates and weights iterators run over the same range.
References linear_regression().
| ForwardIter_t stir::min_positive_element | ( | ForwardIter_t | start, |
| ForwardIter_t | end ) |
Finds where the smallest strictly positive element occurs.
| start | start of the sequence. Usually object.begin(). |
| end | end of the sequence in iterator sense (so actually one beyond the last element). Usually object.end(). |
The iterator type has to satisfy the requirements of a forward iterator, and its value_type has to be comparable using < and <=.
References min_positive_element().
Referenced by min_positive_element(), and threshold_min_to_small_positive_value().
|
inline |
Like std::max_element, but comparing after taking absolute value.
This function using stir::norm_squared(), so works for complex numbers as well.
References abs_max_element(), and norm_squared().
Referenced by abs_max_element(), and absolute_max_eigenvector_using_power_method().
|
inline |
Compute the sum of a sequence using operator+=(), using an initial value.
Sadly std::accumulate uses operator+(). For non-trivial objects, this might call an inefficient version for the addition. As an alternative, std::accumulate could be called with a function object that calls operator+=.
References sum().
Referenced by average(), stir::ParametricQuadraticPrior< TargetT >::compute_value(), find_centre_of_gravity(), find_centre_of_gravity_in_mm_per_plane(), stir::SinglesRatesFromJSON::get_singles_rate(), stir::ArrayFilterTests::run_tests(), stir::ArrayTests::run_tests(), sum(), and sum().
|
inline |
Compute the sum of a sequence using operator+=().
Sadly std::accumulate uses operator+(). For non-trivial objects, this might call an inefficient version for the addition. Alternatively, std::accumulate could be called with a function object that calls operator+=. Still, in that case you need to specify an initial value.
If the range is empty, this function calls operator*=(0) to initialise the object to 0.
References sum().
|
inline |
Compute the average of a sequence using sum(start,end).
References average(), and sum().
Referenced by average(), and stir::RigidObject3DTransformation::find_closest_transformation().
|
inline |
| void stir::warning | ( | const char *const | s, |
| ... ) |
Print warning with format string a la printf.
The arguments are the same as if you would call printf(). The warning message is written to stderr, preceeded by "WARNING:".
References warning().
Referenced by stir::ecat::ecat7::ECAT966ListmodeInputFileFormat::actual_can_read(), stir::PoissonLogLikelihoodWithLinearModelForMeanAndProjData< stir::DiscretisedDensity< 3, float > >::actual_compute_objective_function_without_penalty(), stir::PoissonLogLikelihoodWithLinearModelForMeanAndProjData< stir::DiscretisedDensity< 3, float > >::actual_compute_subset_gradient_without_penalty(), stir::FBP3DRPReconstruction::actual_reconstruct(), stir::PoissonLogLikelihoodWithLinearModelForMeanAndListModeDataWithProjMatrixByBin< TargetT >::actual_subsets_are_approximately_balanced(), stir::ecat::ecat6::ECAT6OutputFileFormat::actual_write_to_file(), stir::ecat::ecat7::ECAT7OutputFileFormat::actual_write_to_file(), stir::ITKOutputFileFormat::actual_write_to_file(), stir::MultiDynamicDiscretisedDensityOutputFileFormat::actual_write_to_file(), stir::PoissonLogLikelihoodWithLinearModelForMeanAndProjData< stir::DiscretisedDensity< 3, float > >::add_subset_sensitivity(), stir::FactoryRegistry< Key, Factory, Compare >::add_to_registry(), stir::FilePath::append(), stir::DataProcessor< DataT >::apply(), stir::KeyParser::ask_parameters(), stir::SAFIRCListmodeInputFileFormat< EventDataType >::can_read(), stir::Scanner::check_consistency(), stir::ProjMatrixElemsForOneBin::check_state(), stir::ProjMatrixElemsForOneDensel::check_state(), stir::ecat::ecat7::CListModeDataECAT< CListRecordT >::CListModeDataECAT(), stir::CListModeDataROOT::CListModeDataROOT(), stir::FilterRootPrior< DataT >::compute_value(), stir::ModelMatrix< num_param >::convert_to_total_frame_counts(), stir::ecat::ecat6::cti_write_idata(), stir::DataSymmetriesForBins_PET_CartesianGrid::DataSymmetriesForBins_PET_CartesianGrid(), stir::BloodFrameData::decay_correct_BloodFrameData(), stir::DynamicDiscretisedDensity::decay_correct_frames(), stir::PlasmaData::decay_correct_PlasmaData(), stir::ecat::ecat6::DiscretisedDensity_to_ECAT6(), stir::ecat::ecat7::DiscretisedDensity_to_ECAT7(), stir::FBP3DRPReconstruction::do_best_fit(), stir::FBP3DRPReconstruction::do_log_file(), stir::LmToProjData::do_post_normalisation(), stir::ScatterSimulation::downsample_density_image_for_scatter_points(), extend_segment(), stir::RigidObject3DTransformation::find_closest_transformation(), stir::DetectorCoordinateMap::find_detection_position_given_cartesian_coordinate(), stir::ecat::find_ECAT_data_type(), stir::ecat::find_ECAT_system_type(), find_level_width(), stir::ForwardProjectorByBin::forward_project(), stir::LmToProjData::get_bin_from_event(), stir::PoissonLogLikelihoodWithLinearModelForMeanAndListModeData< stir::DiscretisedDensity< 3, float > >::get_max_segment_num_to_process(), stir::PlasmaData::get_sample_data_in_frames(), get_scale_factors_per_sinogram(), stir::Scanner::get_scanner_from_name(), stir::ProjDataFromStream::get_sinogram(), stir::ProjDataInfo::get_tof_bin(), stir::ProjDataFromStream::get_viewgram(), interpolate_blocks_on_cylindrical_projdata(), inverse_SSRB(), stir::QuadraticPrior< float >::is_convex(), stir::LmToProjDataBootstrap< LmToProjDataT >::LmToProjDataBootstrap(), stir::LmToProjDataWithRandomRejection< LmToProjDataT >::LmToProjDataWithRandomRejection(), stir::ecat::ecat6::make_ECAT6_Main_header(), stir::ecat::ecat6::make_ECAT6_Main_header(), stir::ecat::ecat7::make_ECAT7_main_header(), stir::ecat::ecat7::make_subheader_for_ECAT7(), stir::ecat::ecat7::make_subheader_for_ECAT7(), ML_estimate_component_based_normalisation(), stir::ModelMatrix< 1 >::multiply_dynamic_image_with_model_and_add_to_input(), stir::Scanner::operator==(), operator>>(), operator>>(), stir::KeyParser::parse(), stir::PETSIRDInfo::PETSIRDInfo(), stir::AnalyticReconstruction::post_processing(), stir::ecat::ecat6::ECAT6OutputFileFormat::post_processing(), stir::ecat::ecat7::ECAT7DynamicDiscretisedDensityOutputFileFormat::post_processing(), stir::ecat::ecat7::ECAT7OutputFileFormat::post_processing(), stir::ecat::ecat7::ECAT7ParametricDensityOutputFileFormat< DiscretisedDensityT >::post_processing(), stir::Ellipsoid::post_processing(), stir::EllipsoidalCylinder::post_processing(), stir::FindMCNormFactors::post_processing(), stir::GibbsPenalty< elemT, potentialT >::post_processing(), stir::InterfileHeader::post_processing(), stir::InterfileImageHeader::post_processing(), stir::InterfilePDFSHeader::post_processing(), stir::InterfilePDFSHeaderSiemens::post_processing(), stir::InterfilePDFSHeaderSPECT::post_processing(), stir::InterfileRawDataHeaderSiemens::post_processing(), stir::IterativeReconstruction< TargetT >::post_processing(), stir::LmToProjData::post_processing(), stir::LogcoshPrior< elemT >::post_processing(), stir::MatchTrackerAndScanner::post_processing(), stir::MoveImage::post_processing(), stir::MoveProjData::post_processing(), stir::MyApp::post_processing(), stir::NonRigidObjectTransformationUsingBSplines< num_dimensions, elemT >::post_processing(), stir::PoissonLogLikelihoodWithLinearModelForMeanAndDynamicProjData< TargetT >::post_processing(), stir::PoissonLogLikelihoodWithLinearModelForMeanAndGatedProjDataWithMotion< TargetT >::post_processing(), stir::PoissonLogLikelihoodWithLinearModelForMeanAndListModeDataWithProjMatrixByBin< TargetT >::post_processing(), stir::PoissonLogLikelihoodWithLinearModelForMeanAndProjData< TargetT >::post_processing(), stir::ProjDataRebinning::post_processing(), stir::QuadraticPrior< elemT >::post_processing(), stir::Reconstruction< TargetT >::post_processing(), stir::RelativeDifferencePrior< elemT >::post_processing(), stir::RigidObject3DMotion::post_processing(), stir::RigidObject3DMotionFromPolaris::post_processing(), stir::ScatterEstimation::post_processing(), stir::Shape3DWithOrientation::post_processing(), stir::TimeFrameMotion::post_processing(), stir::OSSPSReconstruction< TargetT >::precompute_denominator_of_conditioner_without_penalty(), stir::LmToProjData::process_data(), stir::ecat::ecat6::ProjData_to_ECAT6(), stir::ecat::ecat7::ProjData_to_ECAT7(), stir::ProjDataInfo::ProjDataInfoCTI(), stir::ProjDataInfoCylindrical::ProjDataInfoCylindrical(), RayTraceVoxelsOnCartesianGrid(), read_data(), stir::detail::read_data_1d(), stir::ecat::ecat7::read_ECAT7_exam_info(), stir::DiscretisedDensity< num_dimensions, elemT >::read_from_file(), stir::DiscretisedDensity< num_dimensions, float >::read_from_file(), stir::GE::RDF_HDF5::GEHDF5ListmodeInputFileFormat::read_from_file(), stir::TimeGateDefinitions::read_gdef_file(), read_interfile_dynamic_image(), read_interfile_image(), read_interfile_parametric_image(), stir::ecat::ecat7::SinglesRatesFromECAT7::read_singles_from_file(), stir::ecat::ecat7::SinglesRatesFromSglFile::read_singles_from_sgl_file(), stir::FactoryRegistry< Key, Factory, Compare >::remove_from_registry(), stir::DataProcessor< DiscretisedDensity< 3, float > >::reset(), stir::CorrectProjDataApplication::run(), stir::MatchTrackerAndScanner::run(), sample_function_on_regular_grid(), sample_function_using_index_converter(), stir::ModelMatrix< num_param >::scale_model_matrix(), distributed::send_exam_and_proj_data_info(), stir::ecat::ecat6::ECAT6OutputFileFormat::set_byte_order(), stir::ecat::ecat7::ECAT7DynamicDiscretisedDensityOutputFileFormat::set_byte_order(), stir::ecat::ecat7::ECAT7OutputFileFormat::set_byte_order(), stir::ecat::ecat7::ECAT7ParametricDensityOutputFileFormat< DiscretisedDensityT >::set_byte_order(), stir::InterfileDynamicDiscretisedDensityOutputFileFormat::set_byte_order(), stir::MultiDynamicDiscretisedDensityOutputFileFormat::set_byte_order(), stir::LmToProjData::set_input_data(), set_num_threads(), stir::ProjDataFromStream::set_segment(), stir::ProjDataFromStream::set_segment(), stir::ProjDataInMemory::set_segment(), stir::ProjDataFromStream::set_sinogram(), stir::ProjDataInMemory::set_sinogram(), stir::PoissonLogLikelihoodWithLinearModelForMean< TargetT >::set_subsensitivity_filenames(), stir::ecat::ecat6::ECAT6OutputFileFormat::set_type_of_numbers(), stir::ecat::ecat7::ECAT7DynamicDiscretisedDensityOutputFileFormat::set_type_of_numbers(), stir::ecat::ecat7::ECAT7OutputFileFormat::set_type_of_numbers(), stir::ecat::ecat7::ECAT7ParametricDensityOutputFileFormat< DiscretisedDensityT >::set_type_of_numbers(), stir::ArcCorrection::set_up(), stir::ArcCorrection::set_up(), stir::ArcCorrection::set_up(), stir::BinNormalisationFromML2D::set_up(), stir::BinNormalisationFromProjData::set_up(), stir::BinNormalisationPETFromComponents::set_up(), stir::BinNormalisationWithCalibration::set_up(), stir::ColsherFilter::set_up(), stir::CorrectProjDataApplication::set_up(), stir::ecat::BinNormalisationFromECAT8::set_up(), stir::ecat::ecat7::BinNormalisationFromECAT7::set_up(), stir::ForwardProjectorByBinUsingRayTracing::set_up(), stir::GE::RDF_HDF5::BinNormalisationFromGEHDF5::set_up(), stir::GeneralisedObjectiveFunction< TargetT >::set_up(), stir::InputStreamFromROOTFileForCylindricalPET::set_up(), stir::InputStreamFromROOTFileForECATPET::set_up(), stir::IterativeReconstruction< TargetT >::set_up(), stir::LmToProjData::set_up(), stir::OSSPSReconstruction< TargetT >::set_up(), stir::ProjDataRebinning::set_up(), stir::ProjMatrixByBinPinholeSPECTUB::set_up(), stir::ProjMatrixByBinSPECTUB::set_up(), stir::ProjMatrixByBinUsingInterpolation::set_up(), stir::ProjMatrixByBinUsingRayTracing::set_up(), stir::ProjMatrixByDenselUsingRayTracing::set_up(), stir::Reconstruction< TargetT >::set_up(), stir::Reconstruction< DiscretisedDensity< 3, float > >::set_up(), stir::ScatterEstimation::set_up(), stir::PoissonLogLikelihoodWithLinearModelForMeanAndListModeData< TargetT >::set_up_before_sensitivity(), stir::PoissonLogLikelihoodWithLinearModelForMeanAndListModeDataWithProjMatrixByBin< TargetT >::set_up_before_sensitivity(), stir::KeyParser::set_variable(), stir::ProjDataFromStream::set_viewgram(), stir::ProjDataInMemory::set_viewgram(), SSRB(), SSRB(), stir::LmToProjDataBootstrap< LmToProjDataT >::start_new_time_frame(), stir::GeneralisedObjectiveFunction< stir::DiscretisedDensity< 3, float > >::subsets_are_approximately_balanced(), stir::RigidObject3DMotionFromPolaris::synchronise(), transform_3d_object(), stir::ModelMatrix< num_param >::uncalibrate(), stir::ScatterEstimation::upsample_and_fit_scatter_estimate(), warning(), warning(), stir::ecat::ecat7::write_basic_interfile_header_for_ECAT7(), write_basic_interfile_image_header(), write_basic_interfile_PDFS_header(), write_data(), stir::detail::write_data_1d(), stir::ScatterSimulation::write_log(), stir::DynamicDiscretisedDensity::write_to_ecat7(), and stir::ProjMatrixByBinFromFile::write_to_file().
|
inline |
Use this function for writing warning messages.
The argument is expected to be a string, but could be anything for which std::ostream::operator<< would work.
This function currently first writes a newline, then WARNING:, then string and then another newline to std::cerr.
stir::format is useful in this context.
References warning().
| void * stir::read_stream_in_memory | ( | std::istream & | input, |
| std::streamsize & | file_size ) |
reads data into memory, returning a pointer to the memory
If the file_size parameter is zero, the stream is read till EOF and 'file_size' is set to the number of bytes in the file. Otherwise 'file_size' bytes are read.
The data is read from the current position in the stream. At the end of this function, the 'input' stream will be positioned at original_position + file_size.
References close_file(), find_remaining_size(), open_read_binary(), and open_write_binary().
| std::streamsize stir::find_remaining_size | ( | std::istream & | input | ) |
Find number of remaining characters in the stream.
At the end of this function, the 'input' stream will be positioned at the original_position.
References find_remaining_size().
Referenced by find_remaining_size(), and read_stream_in_memory().
|
inline |
opens a stream for reading binary data. Calls error() when it does not succeed.
References error(), and open_read_binary().
| FILE *& stir::open_read_binary | ( | FILE *& | fptr, |
| const std::string & | name ) |
opens a FILE for reading binary data. Calls error() when it does not succeed.
References error(), and open_read_binary().
Referenced by stir::FileSignature::FileSignature(), stir::InputStreamWithRecords< RecordT, OptionsT >::InputStreamWithRecords(), open_read_binary(), open_read_binary(), stir::InputFileFormat< DataT >::read_from_file(), read_interfile_dynamic_image(), read_interfile_image(), read_interfile_parametric_image(), and read_stream_in_memory().
|
inline |
opens a stream for writing binary data. Calls error() when it does not succeed.
Templated such that it works on std::ofstream and std::fstream.
References error(), and open_write_binary().
| FILE *& stir::open_write_binary | ( | FILE *& | fptr, |
| const std::string & | name ) |
opens a FILE for writing binary data. Calls error() when it does not succeed.
References error(), and open_write_binary().
Referenced by open_write_binary(), open_write_binary(), read_stream_in_memory(), and stir::ProjMatrixByBinFromFile::write_to_file().
|
inline |
closes a stream without error checking.
Templated such that it works on std::ofstream, std::ifstream and std::fstream.
This function is only provided in case you need to write code that works with both std::fstream and stdio FILE.
References close_file().
| void stir::close_file | ( | FILE *& | fptr | ) |
closes a FILE without error checking.
This function is only provided in case you need to write code that works with both std::fstream and stdio FILE.
References close_file().
Referenced by close_file(), close_file(), and read_stream_in_memory().
| const int stir::max_filename_length = 1000 |
some large value to say how long filenames can be in the (deprecated) function ask_filename_with_extension(char *,const std::string&, const std::string&)
Referenced by stir::IterativeReconstruction< TargetT >::ask_parameters(), stir::OSSPSReconstruction< TargetT >::ask_parameters(), stir::FBP3DRPReconstruction::do_2D_reconstruction(), stir::FBP3DRPReconstruction::do_log_file(), stir::FilePath::get_current_working_directory(), read_interfile_dynamic_image(), read_interfile_dynamic_image(), read_interfile_image(), read_interfile_image(), read_interfile_parametric_image(), read_interfile_parametric_image(), stir::FilenameTests::run_tests(), stir::ecat::ecat7::write_basic_interfile_header_for_ECAT7(), and write_basic_interfile_PDFS_header().