STIR  6.2.0
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables

Namespace for the STIR library (and some/most of its applications) More...

Namespaces

 BSpline
 Namespace for functions and classes for B-Spline interpolation in the STIR library.
 
 detail
 Namespace for the implementation details of the STIR library.
 
 ecat
 Namespace for the ECAT IO part of the STIR library (and some/most of its applications)
 
 GE
 Namespace for the part of the STIR library that handles GE data (and some/most of its applications)
 

Classes

class  AbsTimeInterval
 Base class for specifying a time interval (in absolute time) More...
 
class  AbsTimeIntervalFromDynamicData
 class for specifying a time interval via a dynamic scan More...
 
class  AbsTimeIntervalFromECAT7ACF
 class for specifying a time interval via an ECAT7 .a file More...
 
class  AbsTimeIntervalWithParsing
 class for specifying a time interval via parsing of explicit times More...
 
class  AnalyticReconstruction
 base class for all analytic reconstruction algorithmsThis class provides extra functinoality (compared to Reconstruction) as it assumes that the TargetT is really a VoxelsOnCartesianGrid. More...
 
class  ArcCorrection
 A class to arc-correct projection data. More...
 
class  ArcCorrectionTests
 Test class for ArcCorrection. More...
 
class  Array
 This class defines multi-dimensional (numeric) arrays. More...
 
class  Array< 1, elemT >
 The 1-dimensional (partial) specialisation of Array. More...
 
class  ArrayFilter1DUsingConvolution
 This class implements convolution of a 1D array with an arbitrary (i.e. potentially non-symmetric) kernel. More...
 
class  ArrayFilter1DUsingConvolutionSymmetricKernel
 This class implements convolution of a 1D array with a symmetric kernel. More...
 
class  ArrayFilterTests
 Tests Array functionality. More...
 
class  ArrayFilterUsingRealDFTWithPadding
 This class implements convolution of an array of real numbers with an arbitrary (i.e. potentially non-symmetric) kernel using DFTs. More...
 
class  ArrayFunctionObject
 A class for operations on n-dimensional Arrays. More...
 
class  ArrayFunctionObject_1ArgumentImplementation
 A convenience class for children of ArrayFunctionObject. It implements the 2 argument operator() in terms of the in-place version. More...
 
class  ArrayFunctionObject_2ArgumentImplementation
 A convenience class for children of ArrayFunctionObject. It implements the in-place operator() in terms of the 2 argument version. More...
 
class  ArrayTests
 Tests Array functionality. More...
 
class  BackProjectorByBin
 Abstract base class for all back projectors. More...
 
class  BackProjectorByBinNiftyPET
 Class for NiftyPET's GPU back projector. More...
 
class  BackProjectorByBinParallelproj
 Class for Parallelproj's back projector. More...
 
class  BackProjectorByBinUsingInterpolation
 does backprojection by interpolating between the bins. More...
 
class  BackProjectorByBinUsingProjMatrixByBin
 This implements the BackProjectorByBin interface, given any ProjMatrixByBin object. More...
 
class  BackProjectorByBinUsingSquareProjMatrixByBin
 This implements the BackProjectorByBin interface, given any ProjMatrixByBin object. More...
 
class  BasicCoordinate
 class BasicCoordinate<int num_dimensions, typename coordT> defines num_dimensions -dimensional coordinates. More...
 
class  BeginEndAllFunction
 Helper class for NestedIterator when the 1st level iterator refers to a stir full iterator for the 2nd level iterator. More...
 
class  BeginEndFunction
 Helper class for NestedIterator when the 1st level iterator refers to an ordinary iterator for the 2nd level iterator. More...
 
class  Bin
 A class for storing coordinates and value of a single projection bin. More...
 
struct  BinAndCorr
 A small bundle of a Bin and its additive correction value. More...
 
class  BinNormalisation
 Abstract base class for implementing bin-wise normalisation of data. More...
 
class  BinNormalisationFromAttenuationImage
 A BinNormalisation class that gets attenuation correction factors from an attenuation image. More...
 
class  BinNormalisationFromML2D
 A BinNormalisation class that gets the normalisation factors from the files output by find_ML_normfactors. More...
 
class  BinNormalisationFromProjData
 A BinNormalisation class that gets the normalisation factors from a ProjData object. More...
 
class  BinNormalisationPETFromComponents
 A BinNormalisation class that uses component-based normalisation for PET. More...
 
class  BinNormalisationSinogramRescaling
 The BinNormalisationSinogramRescaling class gets normaliastion factors by dividing forward projection of the fitted cyl. to the precorrecred data. More...
 
class  BinNormalisationWithCalibration
 
class  BlocksTests
 Test class for Blocks. More...
 
class  BloodFrameData
 A class for storing plasma samples of a single study. More...
 
class  BoundaryConditions
 Preliminary class to specify boundary conditions for filters. More...
 
class  Box3D
 Three-dimensional cuboid box. More...
 
class  ByteOrder
 This class provides member functions to find out what byte-order your machine is and to swap numbers. More...
 
class  ByteOrderTests
 Test class for ByteOrder and the preprocessor defines from ByteOrderDefine.h. More...
 
class  CartesianCoordinate2D
 a templated class for 2-dimensional coordinates. More...
 
class  CartesianCoordinate3D
 a templated class for 3-dimensional coordinates. More...
 
class  ChainedBinNormalisation
 A BinNormalisation class that simply multiplies the factors given by 2 BinNormalisation objects. More...
 
class  ChainedDataProcessor
 A class in the DataProcessor hierarchy that calls 2 DataProcessors in sequence. More...
 
class  CListEvent
 Class for storing and using a coincidence event from a list mode file. More...
 
class  CListEventCylindricalScannerWithDiscreteDetectors
 Class for storing and using a coincidence event from a list mode file for a cylindrical scanner. More...
 
class  CListEventCylindricalScannerWithViewTangRingRingEncoding
 Helper class for listmode events when using 2d sinograms and ring-pairs is most efficient. More...
 
class  CListEventDataLMF
 Class for storing and using a coincidence event from a listmode file. More...
 
class  CListEventDataNeuroLF
 Class for record with coincidence data using NeuroLF bitfield definition. More...
 
class  CListEventDataSAFIR
 Class for record with coincidence data using SAFIR bitfield definition. More...
 
class  CListEventPENN
 Class for handling PENNPet Explorer events. More...
 
class  CListEventSAFIR
 
class  CListEventScannerWithDiscreteDetectors
 Class for storing and using a coincidence event from a list mode file for a cylindrical single layer scanner. More...
 
class  CListModeData
 The base class for reading PET (i.e. coincidence) list mode data.The only difference w.r.t. ListModeData is the used of CListRecord and a virtual function to check if delayeds are present. More...
 
class  CListModeDataLMF
 A class that reads the listmode data from an LMF file. More...
 
class  CListModeDataPENN
 Base class for listmode data for PENNPET Explorer scanner. More...
 
class  CListModeDataROOT
 class that reads ROOT files, generated by GATE, as listmode data. More...
 
class  CListModeDataSAFIR
 Class for reading SAFIR listmode data with variable geometry. More...
 
class  CListRecord
 Class for records in a PET list mode file. More...
 
class  CListRecordLMF
 A class for a general element of a listmode file. More...
 
class  CListRecordROOT
 A class for a general element of a listmode file for a Siemens scanner using the ROOT files. More...
 
class  CListRecordSAFIR
 Class for general SAFIR record, containing a union of data, time and raw record and providing access to certain elements. More...
 
class  CListTimeDataLMF
 A class for storing and using a timing 'event' from a listmode file. More...
 
class  CListTimeDataSAFIR
 Class for record with time data using SAFIR bitfield definition. More...
 
class  CListTimeROOT
 A class for storing and using a timing 'event' from a listmode file from the ECAT 8_32bit scanner. More...
 
class  ColsherFilter
 This class contains the Colsher filter used for 3D-PET reconstruction. More...
 
class  CombinedShape3D
 A class that allows combining several shapes using logical operations. More...
 
class  ConstBeginEndAllFunction
 Convenience class where the 2nd level iterator is a const_full_iterator. More...
 
class  ConstBeginEndFunction
 Convenience class where the 2nd level iterator is a const_iterator. More...
 
class  ConstPtrBeginEndAllFunction
 Convenience class where the 2nd level iterator is a const_full_iterator. More...
 
class  ConstPtrBeginEndFunction
 Convenience class where the 2nd level iterator is a const_iterator. More...
 
class  convert_array_Tests
 tests convert_array functionality More...
 
class  Coordinate2D
 a templated class for 2-dimensional coordinates. More...
 
class  Coordinate3D
 a templated class for 3-dimensional coordinates. More...
 
class  Coordinate4D
 a templated class for 4-dimensional coordinates. More...
 
class  coordinateTests
 Class with tests for BasicCoordinate, Coordinate3D et al. More...
 
struct  CopyFill
 Helper class for stir::copy_to and stir::fill_from. More...
 
struct  CopyFill< Array< num_dimensions, elemT > >
 Helper class for stir::copy_to and stir::fill_from. More...
 
struct  CopyFill< DynamicProjData >
 Copy all bins to a range specified by an iterator. More...
 
struct  CopyFill< MultipleProjData >
 Copy all bins to a range specified by an iterator. More...
 
struct  CopyFill< ProjData >
 Helper class for stir::copy_to and stir::fill_from. More...
 
class  CorrectProjDataApplication
 class to do precorrections More...
 
class  CPUTimer
 A class for measuring elapsed CPU time. More...
 
class  CreateTailMaskFromACFs
 The CreateTailMaskFromACFs class. More...
 
class  CudaRelativeDifferencePrior
 CUDA implementation of the Relative Difference prior. More...
 
class  DataProcessor
 Base class that defines an interface for classes that do data processing. More...
 
class  DataSymmetriesForBins
 A class for encoding/finding symmetries common to the geometry of the projection data and the discretised density. More...
 
class  DataSymmetriesForBins_PET_CartesianGrid
 Symmetries appropriate for a (cylindrical) PET scanner, and a discretised density on a Cartesian grid. More...
 
class  DataSymmetriesForBins_PET_CartesianGridTests
 Test class for DataSymmetriesForBins_PET_CartesianGrid. More...
 
class  DataSymmetriesForDensels
 A class for encoding/finding symmetries common to the geometry of the projection data and the discretised density. More...
 
class  DataSymmetriesForDensels_PET_CartesianGrid
 Symmetries appropriate for a (cylindrical) PET scanner, and a discretised density on a Cartesian grid. More...
 
class  DataSymmetriesForViewSegmentNumbers
 A class for encoding/finding symmetries. Works only on ViewSegmentNumbers (instead of Bin). More...
 
struct  DateTimeStrings
 A simple structure to hold 2 strings (date and time) More...
 
class  DateTimeTest
 Class with tests for date time functions. More...
 
class  DetectionPosition
 A class for storing coordinates of a detection. More...
 
class  DetectionPosition_Tests
 Class with tests for DetectionPosition. More...
 
class  DetectionPositionPair
 A class for storing 2 coordinates-sets of a detection, together with a timing-position index (for TOF), as suitable for PET. More...
 
class  DetectionPosMapTests
 Test class for Blocks. More...
 
class  DetectorCoordinateMap
 
class  DiscretisedDensity
 This abstract class is the basis for all image representations. More...
 
class  DiscretisedDensityOnCartesianGrid
 This abstract class is the basis for images on a Cartesian grid. More...
 
class  DiscretisedShape3D
 A class for shapes that have been discretised as a volume. More...
 
class  DistributedCachingInformation
 This class implements the logic needed to support caching in a distributed manner. More...
 
class  DistributedWorker
 This implements the Worker for the stir::distributable_computation() function. More...
 
class  DynamicDiscretisedDensity
 Class of multiple image frames, one for each time frame Each time frame is a DiscretisedDensity<3,float> More...
 
class  DynamicProjData
 Dynamic projection data. More...
 
class  Ellipsoid
 Three-dimensional ellipsoid. More...
 
class  EllipsoidalCylinder
 Three-dimensional ellipsoidal cylinder. More...
 
class  erfTests
 A simple class to test the erf and erfc functions. More...
 
class  ExamData
 base class for data objects such as ProjData etcProvides an ExamInfo member. More...
 
class  ExamInfo
 a class for storing information about 1 exam (or scan) More...
 
class  FactoryRegistry
 This class can be used to store 'factories' and their corresponding keys. It is essentially a map, but with some extra embelishments. More...
 
class  FBP2DReconstruction
 Reconstruction class for 2D Filtered Back Projection. More...
 
class  FBP3DRPReconstruction
 This class contains the implementation of the FBP3DRP algorithm. More...
 
class  FilenameTests
 Test class for filename functions defined in utility.h. More...
 
class  FilePath
 The FilePath class. More...
 
class  FileSignature
 A class to read/store the file signature. More...
 
class  Filter1D
 Preliminary class for 1D filtering using FFTs. More...
 
class  Filter2D
 2-dimensional filters (filtering done by FFTs) More...
 
class  FilterRootPrior
 A class in the GeneralisedPrior hierarchy. This implements 'generalised' priors a la the Median Root Prior (which was invented by Sakari Alenius). More...
 
class  find_fwhm_in_imageTests
 A simple class to test the find_fwhm_in_image function. More...
 
class  FindMCNormFactors
 Class to compute 'time-efficiency' factors for motino corrected projection data. More...
 
class  ForwardProjectorByBin
 Abstract base class for all forward projectors. More...
 
class  ForwardProjectorByBinNiftyPET
 Class for NiftyPET's GPU forward projector. More...
 
class  ForwardProjectorByBinParallelproj
 Class for Parallelproj's forward projector. More...
 
class  ForwardProjectorByBinUsingProjMatrixByBin
 This implements the ForwardProjectorByBin interface, given any ProjMatrixByBin objectIt stores a shared_ptr to a ProjMatrixByBin object, which will be used to get the relevant elements of the projection matrix. More...
 
class  ForwardProjectorByBinUsingRayTracing
 This class implements forward projection using Siddon's algorithm for ray tracing. That is, it computes length of intersection with the voxels. More...
 
class  FourierRebinning
 Class for Serial FORE Reconstruction. More...
 
class  FourierTests
 A simple class to test the erf and erfc functions. More...
 
class  FrameSinglesRates
 A single frame of singles information. More...
 
class  FullArrayIterator
 Class FullArrayIterator implements (forward) iterators that go through all elements of an Array. More...
 
class  GatedDiscretisedDensity
 Class of multiple image gates. More...
 
class  GatedSpatialTransformation
 Class for spatial transformations for gated images. More...
 
class  GeneralisedObjectiveFunction
 A base class for 'generalised' objective functions, i.e. objective functions for which at least a 'gradient' is defined. More...
 
class  GeneralisedPoissonNoiseGenerator
 Generates noise realisations according to Poisson statistics but allowing for scaling. More...
 
class  GeneralisedPoissonNoiseGeneratorTests
 Tests GeneralisedPoissonNoiseGenerator functionalityCurrently contains only simple tests to check mean and variance. More...
 
class  GeneralisedPrior
 A base class for 'generalised' priors, i.e. priors for which at least a 'gradient' is defined. More...
 
class  GeneralisedPriorTests
 Test class for QuadraticPrior, RelativeDifferencePrior, CudaRelativeDifferencePrior and LogcoshPrior. More...
 
class  GeometryBlocksOnCylindrical
 A helper class to build the crystal map based on scanner info. More...
 
class  GeometryBlocksOnCylindricalTests
 Test class for BlocksOnCylindrical geometry. More...
 
struct  HigherPrecision
 Helper class to get a type with higher precision. More...
 
class  HighResWallClockTimer
 High-resolution timer. More...
 
class  HUToMuImageProcessor
 A class in the DataProcessor hierarchy that convert from Hounsfield Units to mu-values. More...
 
class  ImagingModality
 Class for encoding the modality. More...
 
class  ImagingModalityTests
 Test class for ImagingModality. More...
 
class  IndexRange
 This class defines ranges which can be 'irregular'. More...
 
class  IndexRange2D
 a 'convenience' class for 2D index ranges. More...
 
class  IndexRange3D
 a 'convenience' class for 3D index ranges. Provides an easier constructor for regular ranges. More...
 
class  IndexRange4D
 A convenience class for 4D index ranges. More...
 
class  IndexRange< 1 >
 The (simple) 1 dimensional specialisation of IndexRange. More...
 
class  IndexRange_Tests
 Class with tests for IndexRange, IndexRange3D. More...
 
class  InputFileFormat
 Base-class for file-formats for reading. More...
 
class  InputFileFormatRegistry
 A class for registering (and finding) all input file formats. More...
 
class  InputStreamFromROOTFile
 A helper class to read data from a ROOT file Generated by GATE simulation toolkit. More...
 
class  InputStreamFromROOTFileForCylindricalPET
 Declaration of class stir::InputStreamFromROOTFileForCylindricalPET. More...
 
class  InputStreamFromROOTFileForECATPET
 Declaration of class stir::InputStreamFromROOTFileForECATPET. More...
 
class  InputStreamWithRecords
 A helper class to read data from a (presumably binary) stream. More...
 
class  InputStreamWithRecordsFromUPENN
 Base class for reading listmode files from the PENNPet Explorer scanner. More...
 
class  InputStreamWithRecordsFromUPENNbin
 Class for reading binary listmode files from the PENNPet Explorer scanner. More...
 
class  InputStreamWithRecordsFromUPENNtxt
 Class for reading listmode files in text format from the PENNPet Explorer scanner. More...
 
class  integrate_discrete_functionTests
 A simple class to test the integrate_discrete_function function. More...
 
struct  interfile_less
 A function object that compares Interfile keywords. More...
 
class  InterfileDynamicDiscretisedDensityInputFileFormat
 Class for reading images in Interfile file-format. More...
 
class  InterfileDynamicDiscretisedDensityOutputFileFormat
 Implementation of OutputFileFormat paradigm for the Interfile format. More...
 
class  InterfileHeader
 a class for Interfile keywords (and parsing) common to all types of data More...
 
class  InterfileImageHeader
 a class for Interfile keywords (and parsing) specific to images More...
 
class  InterfileImageInputFileFormat
 Class for reading images in Interfile file-format. More...
 
class  InterfileOutputFileFormat
 Implementation of OutputFileFormat paradigm for the Interfile format. More...
 
class  InterfileParametricDiscretisedDensityInputFileFormat
 Class for reading images in Interfile file-format. More...
 
class  InterfileParametricDiscretisedDensityOutputFileFormat
 Implementation of OutputFileFormat paradigm for the Interfile format. More...
 
class  InterfilePDFSHeader
 a class for Interfile keywords (and parsing) specific to projection data (i.e. ProjDataFromStream) More...
 
class  InterfilePDFSHeaderSPECT
 a class for Interfile keywords (and parsing) specific to SPECT projection data More...
 
class  InvertAxis
 a utility class to "invert" an axis More...
 
class  IOTests
 A simple class to test the OutputFileFormat function. More...
 
class  IOTests_DiscretisedDensity
 A simple class to test the OutputFileFormat function. More...
 
class  IOTests_DynamicDiscretisedDensity
 A simple class to test the OutputFileFormat function. More...
 
class  IOTests_ITKMulticomponent
 A simple class to test the reading of multicomponent ITK images. More...
 
class  IOTests_ParametricDiscretisedDensity
 A simple class to test the OutputFileFormat function. More...
 
class  IR_filterTests
 A simple class to test the IIR_filter and FIR_filter function. More...
 
class  IterativeReconstruction
 base class for iterative reconstruction objectsThis is the base class for all iterative reconstruction methods. It provides the basic iteration mechanisms. What each iteration does has to be implemented in a derived class. More...
 
class  ITKImageInputFileFormat
 Class for reading images using ITK. More...
 
class  ITKOutputFileFormat
 Implementation of OutputFileFormat paradigm using the ITK library for writing. More...
 
class  JacobianForIntBP
 The next class is used in BackProjectorByBinUsingInterpolation to take geometric things into account. It also includes some normalisation. (internal use only). More...
 
class  KeyArgument
 A class that enumerates the possible types that can be used to store parsed values. Used (only) by KeyParser. More...
 
class  KeyParser
 A class to parse Interfile headers. More...
 
class  KeyParserTests
 Test class for KeyParser. More...
 
class  KineticModel
 base class for all kinetic modelsAt present very basic. It just provides the parsing mechanism. More...
 
class  KOSMAPOSLReconstruction
 A reconstructor class appropriate for emission data. More...
 
class  Line
 A class used by the Interfile parser. More...
 
class  linear_regressionTests
 A simple class to test the linear_regression function. More...
 
class  ListEvent
 Class for storing and using gamma events from a list mode file. More...
 
class  ListGatingInput
 A class recording external input to the scanner (normally used for gating) More...
 
class  ListModeData
 The base class for reading list mode data. More...
 
class  ListModeData_dummy
 A class to trick the Objective function that we have list mode data, when we only have cache. More...
 
class  ListRecord
 A class for a general element of a list mode file. More...
 
class  ListTime
 A class for storing and using a timing record from a listmode file. More...
 
class  LmToProjData
 This class is used to bin listmode data to projection data, i.e. (3d) sinograms. More...
 
class  LmToProjDataAbstract
 This class is the abstract base class fir binning listmode data to projection data, i.e. (3d) sinograms. More...
 
class  LmToProjDataBootstrap
 Class for binning list mode data into projection data using the bootstrap procedure. More...
 
class  LmToProjDataWithMC
 Class for binning list mode files with motion correction. More...
 
class  LmToProjDataWithRandomRejection
 Class for binning list mode data into projection data using the bootstrap procedure. More...
 
class  LogcoshPrior
 A class in the GeneralisedPrior hierarchy. This implements a logcosh Gibbs prior. More...
 
class  LogCoshPriorTests
 tests for LogCoshPrior More...
 
class  LOR
 A base class for specifying an LOR with geometric coordinates. More...
 
class  LORAs2Points
 A class for LORs. More...
 
class  LORCylindricalCoordinates_z_and_radius
 An internal class for LORs. Do not use. More...
 
class  LORInAxialAndNoArcCorrSinogramCoordinates
 A class for LORs. More...
 
class  LORInAxialAndSinogramCoordinates
 A class for LORs. More...
 
class  LORInCylinderCoordinates
 A class for LORs. More...
 
class  map_element
 Class to store the Interfile keywords and their actions. More...
 
struct  MaskingParameters
 A struct to hold the parameters for image masking. More...
 
class  MatchTrackerAndScanner
 A class for finding the coordinate transformation between tracker and scanner coordinate systems. More...
 
class  MatrixTests
 Tests MatrixFunction.h functionality. More...
 
class  MaximalArrayFilter3D
 Implements erosion on 3D arrays. More...
 
class  MaximalImageFilter3D
 A class in the ImageProcessor hierarchy that implements maximal filtering. More...
 
class  MedianArrayFilter3D
 Implements median filtering on 3D arrays. More...
 
class  MedianImageFilter3D
 A class in the ImageProcessor hierarchy that implements median filtering. More...
 
class  MinimalArrayFilter3D
 Implements erosion on 3D arrays. More...
 
class  MinimalImageFilter3D
 A class in the ImageProcessor hierarchy that implements minimal filtering. More...
 
class  MinimalInterfileHeader
 a minimal class for Interfile keywords (and parsing) common to all types of data More...
 
class  ML_normTests
 Test class for ML_norm.h functions. More...
 
class  modellingTests
 A simple class to test modelling functions. More...
 
class  ModelMatrix
 A helper class to store the model matrix for a linear kinetic model. More...
 
class  MoveImage
 A class for moving an image according to average motion in the frame. More...
 
class  MoveProjData
 A class for moving projection data according to average motion in the frame. More...
 
class  MultiDynamicDiscretisedDensityInputFileFormat
 Class for reading images in Multi file-format. More...
 
class  MultiDynamicDiscretisedDensityOutputFileFormat
 Implementation of OutputFileFormat paradigm for the Multi format. More...
 
class  MultiParametricDiscretisedDensityInputFileFormat
 Class for reading images in Multi file-format. More...
 
class  MultiParametricDiscretisedDensityOutputFileFormat
 Implementation of OutputFileFormat paradigm for the Multi format. More...
 
class  MultipleProjDataTests
 Test class for MultipleProjData. More...
 
class  multiply_plane_scale_factorsImageProcessor
 Simply multiplies each plane in an image with a scale factor. More...
 
class  MyApp
 A class for moving an image according to average motion in the frame. More...
 
class  NestedIterator
 Class NestedIterator implements a (forward) iterator using a pair of 'nested' iterators. More...
 
class  NestedIteratorTests
 Tests NestedIterator functionality. More...
 
class  NiftyPETHelper
 Helper class for the wrapped NiftyPET projectors. More...
 
class  NonRigidObjectTransformationUsingBSplines
 Class to perform non-rigid object transformations in arbitrary dimensions. More...
 
class  NonseparableConvolutionUsingRealDFTImageFilter
 A class derived from DataProcessor for performing separable periodic convolutions with an array kernel. More...
 
struct  NormSquared
 A helper class that computes the square of the norm of numeric data. More...
 
class  NumericInfo
 class NumericInfo<NUMBER> defines properties for the type NUMBER. More...
 
class  NumericInfo< double >
 Basic properties of double. More...
 
class  NumericInfo< float >
 Basic properties of float. More...
 
class  NumericInfo< signed char >
 Basic properties of signed char. More...
 
class  NumericInfo< signed int >
 Basic properties of signed int. More...
 
class  NumericInfo< signed long >
 Basic properties of signed long. More...
 
class  NumericInfo< signed short >
 Basic properties of signed short. More...
 
class  NumericInfo< unsigned char >
 Basic properties of unsigned char. More...
 
class  NumericInfo< unsigned int >
 Basic properties of unsigned int. More...
 
class  NumericInfo< unsigned long >
 Basic properties of unsigned long. More...
 
class  NumericInfo< unsigned short >
 Basic properties of unsigned short. More...
 
class  NumericType
 provides names for some numeric types and methods for finding their properties. More...
 
class  NumericVectorWithOffset
 like VectorWithOffset, but with changes in various numeric operators More...
 
class  ObjectiveFunctionTests
 Test class for GeneralisedObjectiveFunction and GeneralisedPrior. More...
 
class  ObjectTransformation
 Base-class for performing (potentially non-rigid) object transformations. More...
 
class  OSMAPOSLReconstruction
 Implementation of the Ordered Subsets version of Green's MAP One Step Late algorithm. More...
 
class  OSSPSReconstruction
 Implementation of the relaxed Ordered Subsets Separable Paraboloidal Surrogate ( OSSPS) More...
 
class  OutputFileFormat
 Base class for classes that create output files. More...
 
class  OutputFileFormatTests
 A simple class to test the OutputFileFormat function. More...
 
class  overlap_interpolateTests
 Test class for stir::overlap_interpolate. More...
 
struct  Parametric2Single
 A helper class to find the type of a 'single' image for a corresponding parametric image. More...
 
class  ParametricDiscretisedDensity
 Class to store parametric images. More...
 
class  ParametricQuadraticPrior
 A class in the GeneralisedPrior hierarchy. This implements a quadratic Gibbs prior. More...
 
class  ParseAndCreateFrom
 template for adding keywords to a parser and creating an object More...
 
class  ParseAndCreateFrom< DiscretisedDensity< 3, elemT >, ExamDataT >
 parse keywords for creating a VoxelsOnCartesianGrid from ProjData etc More...
 
class  ParseAndCreateFrom< ParametricDiscretisedDensity< VoxelsOnCartesianGrid< elemT > >, ExamDataT >
 parse keywords for creating a parametric VoxelsOnCartesianGrid from DynamicProjData etc More...
 
class  ParseDiscretisedDensityParameters
 Class for adding parameters relevant to DiscretisedDensity to a parser. More...
 
class  ParsingObject
 A base class for objects that want to be able to parse parameter files. More...
 
class  PatientPosition
 
class  PatlakPlot
 Patlak kinetic model. More...
 
class  PENNListmodeInputFileFormat
 Base class for PENN listmode file format support. More...
 
class  PixelsOnCartesianGrid
 This class is used to represent pixelised densities on a rectangular grid (2D). More...
 
class  PlasmaData
 A class for storing plasma and blood samples of a single study. More...
 
class  PlasmaSample
 
class  PLSPrior
 A class in the GeneralisedPrior hierarchy. This implements the anatomical penalty function, Parallel Level Sets (PLS), also sometimes called Directional TV, proposed by Matthias J. Ehrhardt et. al in "PET Reconstruction With an Anatomical MRI Prior Using Parallel Level Sets", IEEE Trans. med. Imag., vol. 35, no. 9, Sept. 2016. https://doi.org/10.1109/TMI.2016.2549601 Note that PLS becomes smoothed TV when an uniform anatomical image is provided. More...
 
class  PLSPriorTests
 tests for PLSPrior More...
 
class  PointOnCylinder
 A class for a point on a cylinder. More...
 
class  PoissonLLReconstructionTests
 Base class for tests for iterative reconstruction that use PoissonLogLikelihoodWithLinearModelForMeanAndProjData. More...
 
class  PoissonLogLikelihoodWithLinearKineticModelAndDynamicProjectionData
 a base class for LogLikelihood of independent Poisson variables where the mean values are linear combinations of the kinetic parameters. More...
 
class  PoissonLogLikelihoodWithLinearModelForMean
 a base class for LogLikelihood of independent Poisson variables where the mean values are linear combinations of the parameters. More...
 
class  PoissonLogLikelihoodWithLinearModelForMeanAndDynamicProjData
 a base class for LogLikelihood of independent Poisson variables where the mean values are linear combinations of the frames. More...
 
class  PoissonLogLikelihoodWithLinearModelForMeanAndGatedProjDataWithMotion
 a base class for LogLikelihood of independent Poisson variables where the mean values are linear combinations of the gated images. More...
 
class  PoissonLogLikelihoodWithLinearModelForMeanAndListModeData
 An objective function class appropriate for PET list mode data. More...
 
class  PoissonLogLikelihoodWithLinearModelForMeanAndListModeDataWithProjMatrixByBin
 Class for PET list mode data from static images for a scanner with discrete detectors. More...
 
class  PoissonLogLikelihoodWithLinearModelForMeanAndListModeDataWithProjMatrixByBinTests
 Test class for PoissonLogLikelihoodWithLinearModelForMeanAndListModeDataWithProjMatrixByBin. More...
 
class  PoissonLogLikelihoodWithLinearModelForMeanAndProjData
 An objective function class appropriate for PET emission data. More...
 
class  PoissonLogLikelihoodWithLinearModelForMeanAndProjDataTests
 Test class for PoissonLogLikelihoodWithLinearModelForMeanAndProjData. More...
 
class  Polaris_MT_File
 a class for parsing .mt files output by the Polaris software More...
 
class  PostsmoothingBackProjectorByBin
 A very preliminary class that first smooths the image, then back projects. More...
 
class  PostsmoothingForwardProjectorByBin
 A very preliminary class that first forward projects, and then smooths the viewgrams. More...
 
class  PrepareProjData
 A preliminary class to prepare files for iterative reconstruction. More...
 
class  PresmoothingForwardProjectorByBin
 A very preliminary class that first smooths the image, then forward projects. More...
 
class  PriorWithParabolicSurrogate
 this class implements priors with a parabolic surrogate curvature More...
 
class  ProjData
 The (abstract) base class for the projection data. More...
 
class  ProjDataFromStream
 A class which reads/writes projection data from/to a (binary) stream. More...
 
class  ProjDataInfo
 An (abstract base) class that contains information on the projection data. More...
 
class  ProjDataInfoBlocksOnCylindricalNoArcCorr
 Projection data info for data from a scanner with discrete dtectors organised by blocks. More...
 
class  ProjDataInfoCylindrical
 projection data info for data corresponding to a 'cylindrical' sampling. More...
 
class  ProjDataInfoCylindricalArcCorr
 Projection data info for arc-corrected data. More...
 
class  ProjDataInfoCylindricalArcCorrTests
 Test class for ProjDataInfoCylindricalArcCorr. More...
 
class  ProjDataInfoCylindricalNoArcCorr
 Projection data info for data which are not arc-corrected. More...
 
class  ProjDataInfoCylindricalNoArcCorrTests
 Test class for ProjDataInfoCylindricalNoArcCorr. More...
 
class  ProjDataInfoCylindricalTests
 Test class for ProjDataInfoCylindrical. More...
 
class  ProjDataInfoGeneric
 projection data info for data corresponding to 'Generic' sampling. More...
 
class  ProjDataInfoGenericNoArcCorr
 Projection data info for data for a scanner with discrete detectors. More...
 
class  ProjDataInfoSubsetByView
 Projection data info for data corresponding to a subset sampling by views. More...
 
class  ProjDataInfoTests
 Test class for ProjDataInfo. More...
 
class  ProjDataInMemory
 A class which reads/writes projection data from/to memory. More...
 
class  ProjDataInMemoryTests
 Test class for ProjDataInMemory. More...
 
class  ProjDataInterfile
 A class which reads/writes projection data from/to a (binary) stream, but creates the corresponding Interfile header. More...
 
class  ProjDataRebinning
 base class for all rebinning algorithms for 3D PET dataTODO describe what rebinning is and why you need it More...
 
class  ProjDataTests
 Test class for ProjData and ProjDataInMemory. More...
 
class  ProjectorByBinPair
 Abstract base class for all projector pairs. More...
 
class  ProjectorByBinPairUsingNiftyPET
 A projector pair based on NiftyPET projectors. More...
 
class  ProjectorByBinPairUsingParallelproj
 A projector pair based on Parallelproj projectors. More...
 
class  ProjectorByBinPairUsingProjMatrixByBin
 A projector pair based on a single matrix. More...
 
class  ProjectorByBinPairUsingSeparateProjectors
 A projector pair based on a single matrix. More...
 
class  ProjMatrixByBin
 This is the (abstract) base class for all projection matrices which are organised by 'bin'. More...
 
class  ProjMatrixByBinFromFile
 Reads/writes a projection matrix from/to file. More...
 
class  ProjMatrixByBinPinholeSPECTUB
 Generates projection matrix for pinhole SPECT studies. More...
 
class  ProjMatrixByBinSinglePhoton
 a 'projection matrix' to implement a model for a single photon acquisition in terms of the detector efficiencies. More...
 
class  ProjMatrixByBinSPECTUB
 generates projection matrix for SPECT studies More...
 
class  ProjMatrixByBinUsingInterpolation
 Computes projection matrix elements for VoxelsOnCartesianGrid images by using an interpolation model. More...
 
class  ProjMatrixByBinUsingInterpolationTests
 Test class for ProjMatrixByBinUsingInterpolation. More...
 
class  ProjMatrixByBinUsingRayTracing
 Computes projection matrix elements for VoxelsOnCartesianGrid images by using a Length of Intersection (LOI) model. More...
 
class  ProjMatrixByBinUsingSolidAngle
 Computes projection matrix elements for VoxelsOnCartesianGrid images by using a Solid Angle model. More...
 
class  ProjMatrixByBinWithPositronRange
 Computes projection matrix elements for VoxelsOnCartesianGrid images by using a Solid Angle model. More...
 
class  ProjMatrixByDensel
 This is the (abstract) base class for all projection matrices which are organised by 'Densel'. More...
 
class  ProjMatrixByDenselOnCartesianGridUsingElement
 Computes projection matrix elements for VoxelsOnCartesianGrid images by using a Length of Intersection (LOI) model. More...
 
class  ProjMatrixByDenselUsingRayTracing
 Computes projection matrix elements for VoxelsOnCartesianGrid images by using a Length of Intersection (LOI) model. More...
 
class  ProjMatrixElemsForOneBin
 This stores the non-zero projection matrix elements for every 'densel' that contributes to a given bin. More...
 
class  ProjMatrixElemsForOneBinValue
 Stores voxel coordinates and the value of the matrix element. More...
 
class  ProjMatrixElemsForOneDensel
 This stores the non-zero projection matrix elements for every 'voxel'. More...
 
class  ProjMatrixElemsForOneDenselValue
 Stores voxel coordinates and the value of the matrix element. More...
 
class  PtrBeginEndAllFunction
 Helper class for NestedIterator when the 1st level iterator refers to a pointer to a stir full iterator for the 2nd level iterator. More...
 
class  PtrBeginEndFunction
 Helper class for NestedIterator when the 1st level iterator refers to pointers to an ordinary iterator for the 2nd level iterator. More...
 
class  PullLinearInterpolator
 A function object to pull interpolated values from the input array into the grid points of the output array. More...
 
class  PullNearestNeighbourInterpolator
 A function object to pull interpolated values from the input array into the grid points of the output array. More...
 
class  PushNearestNeighbourInterpolator
 A function object to push values at the grid of the input array into the output array. More...
 
class  PushTransposeLinearInterpolator
 A function object to push values at the grid of the input array into the output array. More...
 
class  QuadraticPrior
 A class in the GeneralisedPrior hierarchy. This implements a quadratic Gibbs prior. More...
 
class  QuadraticPriorTests
 tests for QuadraticPrior More...
 
class  QuaternionTests
 Test class for Quaternion. More...
 
class  Radionuclide
 A class for storing radionuclide information. More...
 
class  RadionuclideTest
 Class with tests for stir::RadionuclideDB and stir::Radionuclide. More...
 
class  RampFilter
 The ramp filter used for (2D) FBP. More...
 
class  Reconstruction
 base class for all ReconstructionsAs there is not a lot of commonality between different reconstruction algorithms, this base class is rather basic. It essentially takes care of constructing a target image, calls the virtual reconstruct() function, and writes the result to file. More...
 
class  ReconstructionTests
 Base class for simple test on reconstruction. More...
 
class  RegisteredObject
 Helper class to provide registry mechanisms to a Base classSuppose you have a hierarchy of classes with (nearly) all public functionality provided by virtual functions of the Base (here called Root) class. The aim is then to be able to select at run-time which of the nodes will be used. More...
 
class  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  RegisteredParsingObject
 Parent class for all leaves in a RegisteredObject hierarchy that do parsing of parameter files. More...
 
struct  RegisterInputFileFormat
 A helper class to allow automatic registration to the default InputFileFormatRegistry. More...
 
class  RelatedBins
 This class contains all information about a set of bins related by symmetry. More...
 
class  RelatedDensels
 This class contains all information about a set of densels related by symmetry. More...
 
class  RelatedViewgrams
 A class for storing viewgrams which are related by symmetry. More...
 
class  RelativeDifferencePrior
 A class in the GeneralisedPrior hierarchy. This implements a Relative Difference prior. More...
 
class  RelativeDifferencePriorTests
 tests for RelativeDifferencePrior More...
 
class  ReportMovement
 A class for reporting the movement within the frame w.r.t. to the reference position. More...
 
struct  ResolutionIndex
 a structure that is used to hold the output of the function find_fwhm_in_image. More...
 
class  RigidObject3DMotion
 Base class for 3D rigid motion. More...
 
class  RigidObject3DMotionFromPolaris
 A class for handling motion information from the Polaris tracker. More...
 
class  RigidObject3DTransformation
 Class to perform rigid object transformations in 3 dimensions. More...
 
class  RigidObject3DTransformationTests
 Various tests on RigidObject3DTransformation. More...
 
class  ROITests
 Test class for compute_ROI_values and Shape3D hierarchy. More...
 
class  ROIValues
 A class to store and get results of an ROI calculation. More...
 
class  ROOTListmodeInputFileFormat
 The ROOTListmodeInputFileFormat class. More...
 
class  RunTests
 A base class for making test classesWith a derived class, an application could look like. More...
 
class  SAFIRCListmodeInputFileFormat
 Class for reading SAFIR coincidence listmode data. More...
 
class  Scanner
 A class for storing some info on the scanner. More...
 
class  ScannerTests
 Test class for Scanner. More...
 
class  ScatterEstimation
 Estimate the scatter probability using a model-based approach. More...
 
class  ScatterSimulation
 Simulate the scatter probability using a model-based approach. More...
 
class  ScatterSimulationTests
 Test class for ScatterSimulation. More...
 
class  Segment
 An (abstract base) class for storing 3d projection dataThis stores a subset of the data accessible via a ProjData object, where the SegmentIndices are fixed. More...
 
class  SegmentBySinogram
 A class for storing (3d) projection data with fixed SegmentIndices. More...
 
class  SegmentByView
 A class for storing (3d) projection data with fixed SegmentIndices. More...
 
class  SegmentIndices
 A very simple class to store segment numbers and any other indices that define a segment. More...
 
class  SeparableArrayFunctionObject
 This class implements an n -dimensional ArrayFunctionObject whose operation is separable. More...
 
class  SeparableArrayFunctionObject2
 This class implements an n -dimensional ArrayFunctionObject whose operation is separable. More...
 
class  SeparableCartesianMetzImageFilter
 A class in the DataProcessor hierarchy that implements Metz filtering (which includes Gaussian filtering). More...
 
class  SeparableConvolutionImageFilter
 A class derived from DataProcessor for performing separable non-periodic convolutions. More...
 
class  SeparableGaussianArrayFilter
 Separable Gaussian filtering in n - dimensions. More...
 
class  SeparableGaussianArrayFilterTests
 Tests SeparableGaussianArrayFilter functionalityCurrently only very basic tests on normalisation. More...
 
class  SeparableGaussianImageFilter
 A class in the DataProcessor hierarchy that implements Gaussian filtering. More...
 
class  SeparableMetzArrayFilter
 Separable Metz filtering in n - dimensions. More...
 
class  SeparableMetzArrayFilterTests
 Tests SeparableMetzArrayFilter functionalityCurrently only very basic tests on normalisation. More...
 
class  Shape3D
 The base class for all 3 dimensional shapes. More...
 
class  Shape3DWithOrientation
 Class for shapes with orientation. More...
 
class  SingleScatterSimulation
 PET single scatter simulation. More...
 
class  SinglesRates
 The base-class for using singles info. More...
 
class  SinglesRatesForTimeFrames
 A class for singles rates that are recorded in time frames. More...
 
class  SinglesRatesForTimeSlices
 A class for singles that are recorded at equal time intervals. More...
 
class  Sinogram
 A class for 2d projection data. More...
 
class  SinogramIndices
 A very simple class to store all dincies to get a (2D) Sinogram. More...
 
class  SpatialTransformation
 base class for any type of motion fieldsAt present very basic. It just provides the parsing mechanism. More...
 
class  SPECTListEvent
 Class for storing and using gamma events from a SPECT List mode file. More...
 
class  SPECTListModeData
 The base class for reading SPECT list mode data.This class (and SPECTListRecord) is specific to SPECT, i.e. to single gamma detection. However, the only difference with the PET part are the functions related to prompts and delayeds. SPECT is handled by calling all single photon events 'prompts'. More...
 
class  SPECTListRecord
 A class for a general element of a list mode file. More...
 
class  SqrtHessianRowSum
 Implementations of two square root Hessian row sum computation methods, as proposed by Tsai et al. (2020). More...
 
class  stir_mathTests
 Test class for the stir_math utility. More...
 
class  Succeeded
 a class containing an enumeration type that can be used by functions to signal successful operation or not More...
 
class  SumOfGeneralisedObjectiveFunctions
 A base class for sums of 'generalised' objective functions, i.e. objective functions for which at least a 'gradient' is defined. More...
 
class  SymmetryOperation
 Encodes symmetry operation on image coordinates and projection data coordinates. More...
 
class  TestBSplineTransformation
 Test class for Transformations. More...
 
class  TestDataProcessorProjectors
 Test class for GPU projectors. More...
 
class  TestFBP2D
 Test class for FBP2D. More...
 
class  TestFBP3DRP
 Test class for FBP3DRP. More...
 
class  TestGPUProjectors
 Test class for GPU projectors. More...
 
class  TestOSMAPOSL
 Test class for OSMAPOSL. More...
 
class  TestProjDataInfoSubsets
 Test class for subsets in ProjDataInfo. More...
 
class  ThresholdMinToSmallPositiveValueDataProcessor
 A class in the DataProcessor hierarchy for making sure all elements are strictly positive. More...
 
class  TimedBlock< TimerT=Timer >
 Helper class for measuring execution time of a block of code.It starts the timer in ctor, stops in dtor. Do not create unnamed instances of this class, as they are quite useless: you cannot predict destruction time. More...
 
class  TimedObject
 base class for all objects which need timers. At the moment, there's only a CPU timer. More...
 
class  TimeFrameDefinitions
 Class used for storing time frame durations. More...
 
class  TimeFrameMotion
 A class for encoding average motion in the frames. More...
 
class  TimeGateDefinitions
 Class used for storing time gate durations. More...
 
class  Timer
 A general base class for timers. Interface is like a stop watch. More...
 
class  TOF_Tests
 Test class for Time Of Flight. More...
 
class  Transform3DObjectImageProcessor
 A class in the ImageProcessor hierarchy that performs movement by reinterpolation. More...
 
class  TrivialBinNormalisation
 Trivial class which does not do any normalisation whatsoever. More...
 
class  TrivialDataSymmetriesForBins
 A class derived from DataSymmetriesForBins that says that there are no symmetries at all. More...
 
class  TrivialDataSymmetriesForViewSegmentNumbers
 A class for encoding/finding NO symmetries. Works only on ViewSegmentNumbers (instead of Bin). More...
 
class  TrivialSymmetryOperation
 A class implementing the trivial case where the symmetry operation does nothing at all. More...
 
class  TruncateToCylindricalFOVImageProcessor
 A class in the DataProcessor hierarchy that sets voxels to 0 outside a given radius. More...
 
struct  TypeForNumericType
 A helper class that specifies the C++ type for a particular NumericType. More...
 
class  Utah_phantom
 A class that represents a Utah phantom. More...
 
class  VectorWithOffset
 A templated class for vectors, but with indices starting not from 0. More...
 
class  VectorWithOffsetTests
 Test class for VectorWithOffset. More...
 
class  Verbosity
 This class enables the user to control the on-screen output. More...
 
class  Viewgram
 A class for 2d projection data. More...
 
class  ViewgramIndices
 A very simple class to store all dincies to get a (2D) Viewgram. More...
 
class  ViewSegmentNumbers
 alias for ViewgramIndices More...
 
class  VoxelsOnCartesianGrid
 This class is used to represent voxelised densities on a cuboid grid (3D). More...
 
class  VoxelsOnCartesianGridTests
 Test class for VoxelsOnCartesianGrid and image hierarchy. More...
 
class  warp_imageTests
 Class with tests for warp_image functions. More...
 
class  zoom_imageTests
 Test class for zoom_image (and centre_of_gravity) More...
 
class  ZoomOptions
 This class enables the user to choose between different zooming optionsThe 3 possible values determine a global scale factor used for the end result: (i) preserve sum (locally) (ii) preserve values (like interpolation) (iii) preserve projections: using a STIR forward projector on the zoomed image will give (approximately) the same projections. More...
 

Typedefs

typedef char assert_unsigned_long_size[sizeof(unsigned long) - sizeof(unsigned char)]
 
typedef SegmentByView< elem_type > segment_type
 
typedef VectorWithOffset< shared_ptr< segment_type > > all_segments_type
 
typedef Array< 1, std::complex< float > > ArrayC1
 
typedef Array< 1, float > ArrayF1
 
typedef Array< 2, float > ArrayF2
 
typedef Array< 2, std::complex< float > > ArrayC2
 
typedef Array< 3, float > ArrayF3
 
typedef Array< 3, std::complex< float > > ArrayC3
 
typedef Coordinate3D< int > Densel
 a typedef used for an element of a DiscretisedDensity More...
 
typedef std::vector< std::string > ASCIIlist_type
 
typedef Array< 2, float > GeoData
 
typedef Array< 2, float > BlockData
 
typedef Array< 2, float > DetectorEfficiencies
 
typedef FanProjData BlockData3D
 
typedef VoxelsOnCartesianGrid< KineticParameters< 2, float > > ParametricVoxelsOnCartesianGridBaseType
 Convenience typedef for base-type of Cartesian Voxelised Parametric Images with just two parameters.
 
typedef ParametricDiscretisedDensity< ParametricVoxelsOnCartesianGridBaseTypeParametricVoxelsOnCartesianGrid
 Convenience typedef for Cartesian Voxelised Parametric Images with just two parameters.
 
using ProjDataInfoBlocksOnCylindrical = ProjDataInfoGeneric
 
typedef Coordinate2D< int > AxTangPosNumbers
 AxTangPosNumbers as a class that provides the 2 remaining coordinates for a Bin, aside from ViewSegmentNumbers. More...
 
typedef void RPC_process_related_viewgrams_type(const shared_ptr< ForwardProjectorByBin > &forward_projector_sptr, const shared_ptr< BackProjectorByBin > &back_projector_sptr, RelatedViewgrams< float > *measured_viewgrams_ptr, int &count, int &count2, double *log_likelihood_ptr, const RelatedViewgrams< float > *additive_binwise_correction_ptr, const RelatedViewgrams< float > *mult_viewgrams_ptr)
 typedef for callback functions for distributable_computation() More...
 
typedef itk::Image< float, 3 > ITKImageSingle
 Class for reading images in ITK file-format. More...
 
typedef itk::VectorImage< float, 3 > ITKImageMulti
 
typedef DiscretisedDensity< 3, float > STIRImageSingle
 
typedef VoxelsOnCartesianGrid< float > STIRImageSingleConcrete
 
typedef DiscretisedDensity< 3, CartesianCoordinate3D< float > > STIRImageMulti
 
typedef VoxelsOnCartesianGrid< CartesianCoordinate3D< float > > STIRImageMultiConcrete
 
typedef itk::MetaDataObject< std::string > MetaDataStringType
 
typedef DiscretisedDensity< 3, float > target_type
 

Enumerations

enum  OUTPUT_CHANNEL { INFORMATION_CHANNEL, WARNING_CHANNEL, ERROR_CHANNEL }
 
enum  options {
  _quit, _display_view, _display_sino, _absdiff,
  _add_sino, _subtract_sino, _mult_sino, _div_sino,
  _add_scalar, _mult_scalar, _div_scalar, _stats,
  _pos_ind, _trunc_neg, _trim, _zero_ends,
  _restart, _menu
}
 

Functions

template<class T >
find_unweighted_centre_of_gravity_1d (const VectorWithOffset< T > &row)
 Compute centre of gravity of a vector but without dividing by its sum. More...
 
template<class T >
find_unweighted_centre_of_gravity (const Array< 1, T > &)
 Compute centre of gravity of a 1D Array but without dividing by its sum. More...
 
template<int num_dimensions, class T >
BasicCoordinate< num_dimensions, T > find_unweighted_centre_of_gravity (const Array< num_dimensions, T > &)
 Compute centre of gravity of an Array but without dividing by its sum. More...
 
template<int num_dimensions, class T >
BasicCoordinate< num_dimensions, T > find_centre_of_gravity (const Array< num_dimensions, T > &)
 Compute centre of gravity of an Array. More...
 
template<class T >
void find_centre_of_gravity_in_mm_per_plane (VectorWithOffset< CartesianCoordinate3D< float >> &allCoG, VectorWithOffset< T > &weights, const VoxelsOnCartesianGrid< T > &image)
 Computes centre of gravity for each plane. More...
 
template<class T >
CartesianCoordinate3D< float > find_centre_of_gravity_in_mm (const VoxelsOnCartesianGrid< T > &image)
 Computes centre of gravity of an image. More...
 
template void find_centre_of_gravity_in_mm_per_plane (VectorWithOffset< CartesianCoordinate3D< float >> &allCoG, VectorWithOffset< float > &weights, const VoxelsOnCartesianGrid< float > &image)
 
template CartesianCoordinate3D< float > find_centre_of_gravity_in_mm (const VoxelsOnCartesianGrid< float > &image)
 
int time_zone_offset_in_secs ()
 returns the current time_zone in seconds (without DST)The result is independent of DST.
 
int current_time_zone_and_DST_offset_in_secs ()
 returns the current time_zone in seconds (taking DST into account) More...
 
std::string DICOM_date_time_to_DT (const std::string &date, const std::string &time, const std::string &TZ="")
 concatenate date, time and optional time_zone info.Minimal checks on format are performed, calling error() if input is incorrect.
 
double DICOM_datetime_to_secs_since_Unix_epoch (const std::string &str, bool silent=false)
 convert DICOM DT string to seconds since the Unix epoch (i.e. 1 Jan 1970 00:00:00 UTC) More...
 
std::string secs_since_Unix_epoch_to_DICOM_datetime (double secs, int time_zone_offset_in_secs=current_time_zone_and_DST_offset_in_secs())
 convert epoch to DICOM DT string in specified time zone (+3600 is CET)
 
DateTimeStrings DICOM_datetime_to_Interfile (const std::string &str)
 Convert from DICOM DT to Interfile.
 
std::string Interfile_datetime_to_DICOM (const DateTimeStrings &)
 Convert from Interfile to DICOM DT.
 
double Interfile_datetime_to_secs_since_Unix_epoch (const DateTimeStrings &, bool silent=false)
 convert Interfile DateTime strings to seconds since the Unix epoch (i.e. 1 Jan 1970 00:00:00 UTC)Interfile uses a format year 1900:01:01, time 02:01:00.00. More...
 
DateTimeStrings secs_since_Unix_epoch_to_Interfile_datetime (double secs, int time_zone_offset_in_secs=current_time_zone_and_DST_offset_in_secs())
 convert epoch to Interfile date-times string in specified time zone (+3600 is CET)
 
void error (const char *const s,...)
 Print error with format string a la printf and throw exception. More...
 
template<class elemT >
std::list< ResolutionIndex< 3, float > > find_fwhm_in_image (DiscretisedDensity< 3, elemT > &input_image, const unsigned int num_maxima, const float level, const int dimension, const bool nema)
 Finds FWHM, FWTM etc (in mm) for a number of point sources or a line source. More...
 
template<class elemT >
BasicCoordinate< 3, int > maximum_location_per_slice (const Array< 3, elemT > &input_array, const int slice, const int dimension)
 finds the maximum of the Input_Array in the given slice at the given dimension (z=1, y=2, x=3), and returns its location as a vector in BasicCoordinate Field (only 3D implementation).
 
template<class elemT >
Array< 1, elemT > interpolate_line (const Array< 3, elemT > &input_array, const BasicCoordinate< 3, int > &max_location, const BasicCoordinate< 3, bool > &do_direction, const int dimension)
 extract a line from the given array after determining its locatin with a parabolic fit More...
 
template<class RandomAccessIterType >
float parabolic_3points_fit (const RandomAccessIterType &begin_iter, const RandomAccessIterType &end_iter)
 
template<class RandomAccessIterType >
float parabolic_3points_fit_x0 (const RandomAccessIterType &begin_iter, const RandomAccessIterType &end_iter)
 
template std::list< ResolutionIndex< 3, float > > find_fwhm_in_image (DiscretisedDensity< 3, float > &input_image, const unsigned int num_maxima, const float level, const int dimension, const bool nema)
 
std::string find_STIR_config_file (const std::string &filename)
 find full path of a config file More...
 
std::string get_STIR_config_dir ()
 find string with the (full) path of the directory where looks for STIR configuration files More...
 
std::string get_STIR_doc_dir ()
 find string with the (full) path of the directory where the STIR documentation was installed More...
 
std::string get_STIR_examples_dir ()
 find string with the (full) path of the directory where the STIR examples are installed More...
 
string standardise_interfile_keyword (const std::string &keyword)
 Put a (Interfile) keyword into a standard form. More...
 
Succeeded inverse_SSRB (ProjData &proj_data_4D, const ProjData &proj_data_3D)
 Perform Inverse Single Slice Rebinning and write output to ProjData4D format. More...
 
template<>
Succeeded get_param_from_string (string &param, const string &s)
 
template<>
Succeeded get_vparam_from_string (vector< string > &param, const string &s)
 
void make_det_pair_data (DetPairData &det_pair_data, const ProjDataInfo &proj_data_info, const int segment_num, const int ax_pos_num)
 Makes a DetPairData of appropriate dimensions and fills it with 0.
 
void make_det_pair_data (DetPairData &det_pair_data, const ProjData &proj_data, const int segment_num, const int ax_pos_num)
 
void apply_block_norm (DetPairData &det_pair_data, const BlockData &block_data, const bool apply)
 
void apply_geo_norm (DetPairData &det_pair_data, const GeoData &geo_data, const bool apply)
 
void apply_efficiencies (DetPairData &det_pair_data, const Array< 1, float > &efficiencies, const bool apply)
 
void make_fan_sum_data (Array< 1, float > &data_fan_sums, const DetPairData &det_pair_data)
 
void make_geo_data (GeoData &geo_data, const DetPairData &det_pair_data)
 
void make_block_data (BlockData &block_data, const DetPairData &det_pair_data)
 
void iterate_efficiencies (Array< 1, float > &efficiencies, const Array< 1, float > &data_fan_sums, const DetPairData &model)
 
void iterate_geo_norm (GeoData &norm_geo_data, const GeoData &measured_geo_data, const DetPairData &model)
 
void iterate_block_norm (BlockData &norm_block_data, const BlockData &measured_block_data, const DetPairData &model)
 
double KL (const DetPairData &d1, const DetPairData &d2, const double threshold)
 
std::ostream & operator<< (std::ostream &s, const GeoData3D &geo_data)
 
std::istream & operator>> (std::istream &s, GeoData3D &geo_data)
 
std::ostream & operator<< (std::ostream &s, const FanProjData &fan_data)
 
std::istream & operator>> (std::istream &s, FanProjData &fan_data)
 
void get_fan_info (int &num_rings, int &num_detectors_per_ring, int &max_ring_diff, int &fan_size, const ProjDataInfo &proj_data_info)
 
void set_det_pair_data (ProjData &proj_data, const DetPairData &det_pair_data, const int segment_num, const int ax_pos_num)
 
void make_fan_data_remove_gaps (FanProjData &fan_data, const ProjData &proj_data)
 
void set_fan_data_add_gaps (ProjData &proj_data, const FanProjData &fan_data, const float gap_value)
 
void apply_block_norm (FanProjData &fan_data, const BlockData3D &block_data, const bool apply)
 
void apply_geo_norm (FanProjData &fan_data, const GeoData3D &geo_data, const bool apply)
 
void apply_efficiencies (FanProjData &fan_data, const DetectorEfficiencies &efficiencies, const bool apply)
 
void make_fan_sum_data (Array< 2, float > &data_fan_sums, const FanProjData &fan_data)
 
void make_fan_sum_data (Array< 2, float > &data_fan_sums, const ProjData &proj_data)
 
void make_fan_sum_data (Array< 2, float > &data_fan_sums, const DetectorEfficiencies &efficiencies, const int max_ring_diff, const int half_fan_size)
 
void make_geo_data (GeoData3D &geo_data, const FanProjData &fan_data)
 
void make_block_data (BlockData3D &block_data, const FanProjData &fan_data)
 
void iterate_efficiencies (DetectorEfficiencies &efficiencies, const Array< 2, float > &data_fan_sums, const FanProjData &model)
 
void iterate_efficiencies (DetectorEfficiencies &efficiencies, const Array< 2, float > &data_fan_sums, const int max_ring_diff, const int half_fan_size)
 
void iterate_geo_norm (GeoData3D &norm_geo_data, const GeoData3D &measured_geo_data, const FanProjData &model)
 
void iterate_block_norm (BlockData3D &norm_block_data, const BlockData3D &measured_block_data, const FanProjData &model)
 
double KL (const FanProjData &d1, const FanProjData &d2, const double threshold)
 
template<class TProjDataInfo >
void multiply_crystal_factors_help (ProjData &proj_data, const TProjDataInfo &proj_data_info, const Array< 2, float > &efficiencies, float global_factor)
 
void multiply_crystal_factors (ProjData &proj_data, const Array< 2, float > &efficiencies, const float global_factor)
 Construct proj-data as a multiple of crystal efficiencies (or singles) More...
 
template void multiply_crystal_factors_help (ProjData &, const ProjDataInfoCylindricalNoArcCorr &, const Array< 2, float > &, const float)
 
template void multiply_crystal_factors_help (ProjData &, const ProjDataInfoBlocksOnCylindricalNoArcCorr &, const Array< 2, float > &, const float)
 
int get_max_num_threads ()
 Get current maximum number of threads. More...
 
void set_num_threads (const int num_threads=0)
 Set current number of threads. More...
 
int get_default_num_threads ()
 Get default number of threads. More...
 
void set_default_num_threads ()
 set current number of threads to the default More...
 
template<typename T >
void overlap_interpolate (VectorWithOffset< T > &out_data, const VectorWithOffset< T > &in_data, const float zoom, const float offset, const bool assign_rest_with_zeroes=true)
 'overlap' interpolation (i.e. count preserving) for vectors. More...
 
template void overlap_interpolate (VectorWithOffset< float > &out_data, const VectorWithOffset< float > &in_data, const float zoom, const float offset, const bool assign_rest_with_zeroes)
 
template void overlap_interpolate (VectorWithOffset< double > &out_data, const VectorWithOffset< double > &in_data, const float zoom, const float offset, const bool assign_rest_with_zeroes)
 
template void overlap_interpolate (VectorWithOffset< Array< 1, float >> &out_data, const VectorWithOffset< Array< 1, float >> &in_data, const float zoom, const float offset, const bool assign_rest_with_zeroes)
 
template void overlap_interpolate (VectorWithOffset< Array< 2, float >> &out_data, const VectorWithOffset< Array< 2, float >> &in_data, const float zoom, const float offset, const bool assign_rest_with_zeroes)
 
void truncate_rim (Viewgram< float > &viewgram, const int rim_truncation_sino)
 sets the first and last rim_truncation_sino bins at the 'edges' to zero
 
void truncate_rim (SegmentByView< float > &seg, const int rim_truncation_sino)
 sets the first and last rim_truncation_sino bins at the 'edges' to zero
 
void truncate_rim (SegmentBySinogram< float > &seg, const int rim_truncation_sino)
 
void truncate_rim (DiscretisedDensity< 3, float > &image_input, const int rim_truncation_image, const bool strictly_less_than_radius=true)
 sets to zero voxels within rim_truncation_image of the FOV rim
 
void divide_and_truncate (Viewgram< float > &numerator, const Viewgram< float > &denominator, const int rim_truncation_sino, int &count, int &count2, double *f=NULL)
 divide viewgrams and set 'edge bins' to zero, put answer in numerator
 
void divide_and_truncate (RelatedViewgrams< float > &numerator, const RelatedViewgrams< float > &denominator, const int rim_truncation_sino, int &count, int &count2, double *f=NULL)
 divide related viewgrams and set 'edge bins' to zero, put answer in numerator
 
void divide_array (SegmentByView< float > &numerator, const SegmentByView< float > &denominator)
 simple division of two sinograms, x/0 = 0
 
void divide_array (DiscretisedDensity< 3, float > &numerator, const DiscretisedDensity< 3, float > &denominator)
 simple division of two images, x/0 = 0
 
void accumulate_loglikelihood (Viewgram< float > &projection_data, const Viewgram< float > &estimated_projections, const int rim_truncation_sino, double *accum)
 compute the log term of the loglikelihood function for given part of the projection space
 
void multiply_and_add (DiscretisedDensity< 3, float > &image_res, const DiscretisedDensity< 3, float > &image_scaled, float scalar)
 
float neg_trunc (float x)
 truncates negative values to zero
 
void truncate_end_planes (DiscretisedDensity< 3, float > &input_image, int input_num_planes=1)
 sets the end planes of the image to zero
 
Succeeded scale_sinograms (ProjData &output_proj_data, const ProjData &input_proj_data, const Array< 2, float > scale_factors_per_sinogram)
 apply a scale factor for every sinogram More...
 
Array< 2, float > get_scale_factors_per_sinogram (const ProjData &numerator_proj_data, const ProjData &denominator_proj_data, const ProjData &weights_proj_data)
 find scale factors between two different sinograms More...
 
template<typename elemT >
void build_gauss (VectorWithOffset< elemT > &kernel, int res, float s2, float sampling_interval)
 
template<typename elemT >
void build_metz (VectorWithOffset< elemT > &kernel, float N, float fwhm, float MmPerVox, int max_kernel_size)
 
ProjDataInfoSSRB (const ProjDataInfo &in_proj_data_info, const int num_segments_to_combine, const int num_views_to_combine=1, const int num_tangential_poss_to_trim=0, const int max_in_segment_num_to_process=-1, const int num_tof_bins_to_combine=1)
 construct new ProjDataInfo that is appropriate for rebinned data More...
 
void SSRB (const std::string &output_filename, const ProjData &in_projdata, const int num_segments_to_combine, const int num_views_to_combine=1, const int num_tangential_poss_to_trim=0, const bool do_normalisation=true, const int max_in_segment_num_to_process=-1, const int num_tof_bins_to_combine=1)
 Perform Single Slice Rebinning and write output to file. More...
 
void SSRB (ProjData &out_projdata, const ProjData &in_projdata, const bool do_normalisation=true)
 Perform Single Slice Rebinning and write output to ProjData. More...
 
void writeText (const char *text, OUTPUT_CHANNEL channel)
 
template<class FSTREAM >
void ask_filename_and_open (FSTREAM &s, const string &prompt, const string &default_extension, ios::openmode mode, bool abort_if_failed)
 
template void ask_filename_and_open (ifstream &s, const string &prompt, const string &default_extension, ios::openmode mode, bool abort_if_failed)
 
template void ask_filename_and_open (ofstream &s, const string &prompt, const string &default_extension, ios::openmode mode, bool abort_if_failed)
 
template void ask_filename_and_open (fstream &s, const string &prompt, const string &default_extension, ios::openmode mode, bool abort_if_failed)
 
void * read_stream_in_memory (istream &input, streamsize &file_size)
 
void warning (const char *const s,...)
 Print warning with format string a la printf. More...
 
void randoms_from_singles (ProjData &proj_data, const SinglesRates &singles, float coincidence_time_window=-1.F, float radionuclide_halflife=-1.F)
 Estimate randoms from singles (RFS) More...
 
template<class elemT , class SCALE , class CHARP >
void display_bitmap (const Array< 3, elemT > &plane_stack, const VectorWithOffset< SCALE > &scale_factors, const VectorWithOffset< CHARP > &text, double maxi, const char *const title, int scale)
 
template<class elemT , class SCALE , class CHARP >
void display_mathlink (const Array< 3, elemT > &plane_stack, const VectorWithOffset< SCALE > &scale_factors, const VectorWithOffset< CHARP > &text, double maxi, const char *const title, int scale)
 
template<class elemT , class SCALE , class CHARP >
void display_pgm (const Array< 3, elemT > &plane_stack, const VectorWithOffset< SCALE > &scale_factors, const VectorWithOffset< CHARP > &text, double maxi, const char *const title, int scale)
 
template<class elemT , class SCALE , class CHARP >
void display (const Array< 3, elemT > &plane_stack, const VectorWithOffset< SCALE > &scale_factors, const VectorWithOffset< CHARP > &text, double maxi, const char *const title, int scale)
 
template<class elemT >
void display (const RelatedViewgrams< elemT > &v1, double maxi=0, const char *const title=0, int zoom=0)
 Convenience function to display all viewgrams in a RelatedViewgrams object.
 
void display (const DetPairData &det_pair_data, const char *const title)
 
void display (const FanProjData &fan_data, const char *const title)
 
template void display (const Array< 3, short > &plane_stack, const VectorWithOffset< short > &scale_factors, const VectorWithOffset< char *> &text, double maxi, const char *const title, int scale)
 
template void display (const Array< 3, short > &plane_stack, const VectorWithOffset< float > &scale_factors, const VectorWithOffset< char *> &text, double maxi, const char *const title, int scale)
 
template void display (const Array< 3, float > &plane_stack, const VectorWithOffset< float > &scale_factors, const VectorWithOffset< char *> &text, double maxi, const char *const title, int scale)
 
template void display (const Array< 3, short > &plane_stack, const VectorWithOffset< short > &scale_factors, const VectorWithOffset< const char *> &text, double maxi, const char *const title, int scale)
 
template void display (const Array< 3, short > &plane_stack, const VectorWithOffset< float > &scale_factors, const VectorWithOffset< const char *> &text, double maxi, const char *const title, int scale)
 
template void display (const Array< 3, float > &plane_stack, const VectorWithOffset< float > &scale_factors, const VectorWithOffset< const char *> &text, double maxi, const char *const title, int scale)
 
template void display (const RelatedViewgrams< float > &vs, double maxi, const char *const title, int zoom)
 
void find_inverse_and_bck_densels (DiscretisedDensity< 3, float > &image, VectorWithOffset< SegmentByView< float > *> &all_segments, VectorWithOffset< SegmentByView< float > *> &attenuation_segmnets, const int min_z, const int max_z, const int min_y, const int max_y, const int min_x, const int max_x, ProjMatrixByDensel &proj_matrix, bool do_attenuation, const float threshold, bool normalize_result)
 
void do_segments_densels_fwd (const VoxelsOnCartesianGrid< float > &image, ProjData &proj_data, VectorWithOffset< SegmentByView< float > *> &all_segments, const int min_z, const int max_z, const int min_y, const int max_y, const int min_x, const int max_x, ProjMatrixByDensel &proj_matrix)
 
void fwd_densels_all (VectorWithOffset< SegmentByView< float > *> &all_segments, shared_ptr< ProjMatrixByDensel > proj_matrix_ptr, shared_ptr< ProjData > proj_data_ptr, const int min_z, const int max_z, const int min_y, const int max_y, const int min_x, const int max_x, const DiscretisedDensity< 3, float > &in_density)
 
void divide_complex_arrays (Array< 1, float > &out_array, const Array< 1, float > &array_nom, const Array< 1, float > &array_denom)
 
void mulitply_complex_arrays (Array< 1, float > &out_array, const Array< 1, float > &array_nom, const Array< 1, float > &array_denom)
 
void mulitply_complex_arrays (Array< 1, float > &array_nom, const Array< 1, float > &array_denom)
 
void divide_complex_arrays (Array< 1, float > &array_nom, const Array< 1, float > &array_denom)
 
void create_kernel_3d (Array< 3, float > &kernel_3d, const VectorWithOffset< float > &kernel_1d)
 
void create_kernel_2d (Array< 2, float > &kernel_2d, const VectorWithOffset< float > &kernel_1d)
 
void padd_filter_coefficients_3D_and_make_them_symmetric (VectorWithOffset< VectorWithOffset< VectorWithOffset< float >>> &padded_filter_coefficients_3D, VectorWithOffset< VectorWithOffset< VectorWithOffset< float >>> &filter_coefficients)
 
void convert_array_3D_into_1D_array (Array< 1, float > &out_array, const Array< 3, float > &in_array)
 
void convert_array_1D_into_3D_array (Array< 3, float > &out_array, const Array< 1, float > &in_array)
 
void convert_array_2D_into_1D_array (Array< 1, float > &out_array, Array< 2, float > &in_array)
 
void convert_array_1D_into_2D_array (Array< 2, float > &out_array, Array< 1, float > &in_array)
 
void precompute_filter_coefficients_for_second_apporach (VoxelsOnCartesianGrid< float > &precomputed_coefficients, const VoxelsOnCartesianGrid< float > &input_image, VoxelsOnCartesianGrid< float > &sensitivity_image, VoxelsOnCartesianGrid< float > &normalised_bck)
 
void construct_scaled_filter_coefficients_3D (VectorWithOffset< VectorWithOffset< VectorWithOffset< float >>> &new_filter_coefficients_3D_array, VectorWithOffset< float > kernel_1d, const float kapa0_over_kapa1)
 
void construct_scaled_filter_coefficients_2D (Array< 2, float > &new_filter_coefficients_2D_array, VectorWithOffset< float > kernel_1d, const float kapa0_over_kapa1)
 
void construct_scaled_filter_coefficients_3D (Array< 3, float > &new_filter_coefficients_3D_array, VectorWithOffset< float > kernel_1d, const float kapa0_over_kapa1)
 
void construct_scaled_filter_coefficients_2D (Array< 2, float > &new_filter_coefficients_2D_array, Array< 2, float > &kernel_2d, const float kapa0_over_kapa1, int number_of_coefficients_before_padding)
 
void construct_scaled_filter_coefficients_3D (Array< 3, float > &new_filter_coefficients_2D_array, Array< 3, float > &kernel_3d, const float kapa0_over_kapa1)
 
RigidObject3DTransformation compose (const RigidObject3DTransformation &apply_last, const RigidObject3DTransformation &apply_first)
 Composition of 2 transformations. More...
 
std::ostream & operator<< (std::ostream &out, const RigidObject3DTransformation &rigid_object_transformation)
 Output to (text) stream. More...
 
std::istream & operator>> (std::istream &, RigidObject3DTransformation &rigid_object_transformation)
 Input from (text) stream. More...
 
Succeeded transform_3d_object (DiscretisedDensity< 3, float > &out_density, const DiscretisedDensity< 3, float > &in_density, const RigidObject3DTransformation &transformation_in_to_out)
 transform image data More...
 
Succeeded transpose_of_transform_3d_object (DiscretisedDensity< 3, float > &out_density, const DiscretisedDensity< 3, float > &in_density, const RigidObject3DTransformation &transformation_in_to_out)
 transform image data using transposed matrix More...
 
Array< 3, BasicCoordinate< 3, float > > find_grid_coords_of_transformed_centres (const DiscretisedDensity< 3, float > &source_density, const DiscretisedDensity< 3, float > &target_density, const ObjectTransformation< 3, float > &transformation_source_to_target)
 
Array< 3, std::pair< BasicCoordinate< 3, float >, float > > find_grid_coords_of_transformed_centres_and_jacobian (const DiscretisedDensity< 3, float > &source_density, const DiscretisedDensity< 3, float > &target_density, const ObjectTransformation< 3, float > &transformation_source_to_target)
 
Succeeded transform_3d_object (ProjData &out_proj_data, const ProjData &in_proj_data, const RigidObject3DTransformation &object_transformation)
 transform projection data More...
 
Succeeded transform_3d_object (ProjData &out_proj_data, const ProjData &in_proj_data, const RigidObject3DTransformation &rigid_object_transformation, const int min_in_segment_num_to_process, const int max_in_segment_num_to_process)
 transform projection data More...
 
int sign (const float x)
 
float trapezoid_integral (const float s, const float m2, const float m3)
 
template<typename T >
cube (const T x)
 
float convolution_2_trapezoids (const float x, const float m21, const float m31, const float m22, const float m32)
 
float VOI (const float s_voxel, const float half_bin_size, const float halfcosminsin, const float halfcosplussin)
 
float SA_rotated_voxel (const float s_voxel, const float half_voxel_size, const float m2, const float m3)
 
float SAapprox (const float s_voxel, const float half_voxel_size, const float m2, const float m3, const float halfcosminsin, const float halfcosplussin)
 
float SA (const float s_voxel, const float half_voxel_size, const float m2, const float m3, const float halfcosminsin, const float halfcosplussin)
 
template<typename T >
bool coordinates_less (const BasicCoordinate< 3, T > &el1, const BasicCoordinate< 3, T > &el2)
 
template<typename elemT >
void discrete_fourier_transform (VectorWithOffset< elemT > &data, int isign)
 
float rand1 ()
 
void do_block (vector< Bin > &list_of_bins_in_block, const int axial_block_num, const int tangential_block_num, const ProjDataInfoCylindricalNoArcCorr &proj_data_info, const int axial_num_crystals_in_block, const int tangential_num_crystals_in_block)
 
bool bin_coordinates_by_view_less (const Bin &b1, const Bin &b2)
 
void sort_and_make_unique (vector< Bin > &list_of_bins)
 
void find_inverse (ProjData *proj_data_ptr_out, const ProjData *proj_data_ptr_in)
 
void do_segments (DiscretisedDensity< 3, float > &image, ProjData &proj_data_org, const int start_segment_num, const int end_segment_num, const int start_view, const int end_view, BackProjectorByBin &back_projector, bool fill_with_1)
 
void find_inverse (ProjData &proj_data_out, const ProjData &proj_data_in, const int min_segment_num, const int max_segment_num)
 
template<int num_dimensions, typename elemT >
const Array< num_dimensions - 1, elemT > & get (const Array< num_dimensions, elemT > &a, const BasicCoordinate< 1, int > &c)
 
template<class elemT >
Array< 1, elemT > & in_place_log (Array< 1, elemT > &v)
 Replace elements by their logarithm, 1D version. More...
 
template<int num_dimensions, class elemT >
Array< num_dimensions, elemT > & in_place_log (Array< num_dimensions, elemT > &v)
 apply log to each element of the multi-dimensional array More...
 
template<class elemT >
Array< 1, elemT > & in_place_exp (Array< 1, elemT > &v)
 Replace elements by their exponentiation, 1D version. More...
 
template<int num_dimensions, class elemT >
Array< num_dimensions, elemT > & in_place_exp (Array< num_dimensions, elemT > &v)
 apply exp to each element of the multi-dimensional array More...
 
template<class elemT >
Array< 1, elemT > & in_place_abs (Array< 1, elemT > &v)
 Replace elements by their absolute value, 1D version. More...
 
template<int num_dimensions, class elemT >
Array< num_dimensions, elemT > & in_place_abs (Array< num_dimensions, elemT > &v)
 store absolute value of each element of the multi-dimensional array More...
 
template<class T , class FUNCTION >
T & in_place_apply_function (T &v, FUNCTION f)
 apply any function(object) to each element of the multi-dimensional array More...
 
template<int num_dim, typename elemT , typename FunctionObjectPtr >
void in_place_apply_array_function_on_1st_index (Array< num_dim, elemT > &array, FunctionObjectPtr f)
 Apply a function object on all possible 1d arrays extracted by keeping all indices fixed, except the first one. More...
 
template<int num_dim, typename elemT , typename FunctionObjectPtr >
void apply_array_function_on_1st_index (Array< num_dim, elemT > &out_array, const Array< num_dim, elemT > &in_array, FunctionObjectPtr f)
 apply any function(object) to each element of the multi-dimensional array, storing results in a different array More...
 
template<int num_dim, typename elemT , typename FunctionObjectPtrIter >
void in_place_apply_array_functions_on_each_index (Array< num_dim, elemT > &array, FunctionObjectPtrIter start, FunctionObjectPtrIter stop)
 Apply a sequence of 1d array-function objects on every dimension of the input array. More...
 
template<typename elemT , typename FunctionObjectPtrIter >
void in_place_apply_array_functions_on_each_index (Array< 1, elemT > &array, FunctionObjectPtrIter start, FunctionObjectPtrIter stop)
 1d specialisation of the above.
 
template<int num_dim, typename elemT , typename FunctionObjectPtrIter >
void apply_array_functions_on_each_index (Array< num_dim, elemT > &out_array, const Array< num_dim, elemT > &in_array, FunctionObjectPtrIter start, FunctionObjectPtrIter stop)
 Apply a sequence of 1d array-function objects on every dimension of the input array, store in output array. More...
 
template<int num_dim, typename elemT >
void apply_array_functions_on_each_index (Array< num_dim, elemT > &out_array, const Array< num_dim, elemT > &in_array, ActualFunctionObjectPtrIter start, ActualFunctionObjectPtrIter stop)
 Apply a sequence of 1d array-function objects of a specific type on every dimension of the input array, store in output array. More...
 
template<typename elemT >
void apply_array_functions_on_each_index (Array< 1, elemT > &out_array, const Array< 1, elemT > &in_array, ActualFunctionObjectPtrIter start, ActualFunctionObjectPtrIter stop)
 1d specialisation of above
 
template<typename elemT , typename FunctionObjectPtrIter >
void apply_array_functions_on_each_index (Array< 1, elemT > &out_array, const Array< 1, elemT > &in_array, FunctionObjectPtrIter start, FunctionObjectPtrIter stop)
 1d specialisation for general function objects
 
template<int num_dim, typename elemT >
void transform_array_to_periodic_indices (Array< num_dim, elemT > &out_array, const Array< num_dim, elemT > &in_array)
 
template<int num_dim, typename elemT >
void transform_array_from_periodic_indices (Array< num_dim, elemT > &out_array, const Array< num_dim, elemT > &in_array)
 
template<int num_dimensions, typename elemT >
void transform_array_to_periodic_indices (Array< num_dimensions, elemT > &out_array, const Array< num_dimensions, elemT > &in_array)
 
template<int num_dimensions, typename elemT >
void transform_array_from_periodic_indices (Array< num_dimensions, elemT > &out_array, const Array< num_dimensions, elemT > &in_array)
 
template<class elemT >
void assign_to_subregion (Array< 3, elemT > &input_array, const BasicCoordinate< 3, int > &mask_location, const BasicCoordinate< 3, int > &half_size, const elemT &value)
 assign a value to a sub-region of an array More...
 
template<int num_dimensions, typename coordT >
coordT inner_product (const BasicCoordinate< num_dimensions, coordT > &p1, const BasicCoordinate< num_dimensions, coordT > &p2)
 compute sum_i p1[i] * p2[i] More...
 
template<int num_dimensions, typename coordT >
double norm_squared (const BasicCoordinate< num_dimensions, coordT > &p1)
 compute (inner_product(p1,p1)) More...
 
template<int num_dimensions, typename coordT >
double norm (const BasicCoordinate< num_dimensions, coordT > &p1)
 compute sqrt(inner_product(p1,p1)) More...
 
template<int num_dimensions, typename coordT >
double angle (const BasicCoordinate< num_dimensions, coordT > &p1, const BasicCoordinate< num_dimensions, coordT > &p2)
 compute angle between 2 directions More...
 
template<int num_dimensions, typename coordT >
double cos_angle (const BasicCoordinate< num_dimensions, coordT > &p1, const BasicCoordinate< num_dimensions, coordT > &p2)
 compute cos of the angle between 2 directions More...
 
template<int num_dimensions, typename coordT >
BasicCoordinate< num_dimensions+1, coordT > join (const coordT &a, const BasicCoordinate< num_dimensions, coordT > &c)
 make a longer BasicCoordinate, by prepending c with the single coordT More...
 
template<int num_dimensions, class coordT >
BasicCoordinate< num_dimensions+1, coordT > join (const BasicCoordinate< num_dimensions, coordT > &c, const coordT &a)
 make a longer BasicCoordinate, by appending the coordT to c More...
 
template<int num_dimensions, class coordT >
BasicCoordinate< num_dimensions - 1, coordT > cut_last_dimension (const BasicCoordinate< num_dimensions, coordT > &c)
 make a shorter BasicCoordinate, by cutting the last element from c More...
 
template<int num_dimensions, typename coordT >
BasicCoordinate< num_dimensions - 1, coordT > cut_first_dimension (const BasicCoordinate< num_dimensions, coordT > &c)
 make a shorter BasicCoordinate, by cutting the first element from c More...
 
template<int num_dimensions>
BasicCoordinate< num_dimensions, float > convert_int_to_float (const BasicCoordinate< num_dimensions, int > &cint)
 converts a BasicCoordinate<int> to BasicCoordinate<float> More...
 
template<class NUMBER >
NUMBER square (const NUMBER &x)
 returns the square of a number, templated. More...
 
template<int num_dimensions, class T1 , class T2 , class scaleT >
void find_scale_factor (scaleT &scale_factor, const Array< num_dimensions, T1 > &data_in, const NumericInfo< T2 > info_for_out_type)
 A function that finds a scale factor to use when converting data to a new type. More...
 
template<int num_dimensions, class T1 , class T2 , class scaleT >
Array< num_dimensions, T2 > convert_array (scaleT &scale_factor, const Array< num_dimensions, T1 > &data_in, const NumericInfo< T2 > info2)
 A function that returns a new Array (of the same dimension) with elements of type T2. More...
 
template<int num_dimensions, class T1 , class T2 , class scaleT >
void convert_array (Array< num_dimensions, T2 > &data_out, scaleT &scale_factor, const Array< num_dimensions, T1 > &data_in)
 Converts the data_in Array to data_out (with elements of different types) such that data_in == data_out * scale_factor. More...
 
template<class InputIteratorT , class T2 , class scaleT >
void find_scale_factor (scaleT &scale_factor, const InputIteratorT &begin, const InputIteratorT &end, const NumericInfo< T2 > info_for_out_type)
 A function that finds a scale factor to use when converting data to a new type. More...
 
template<class OutputIteratorT , class InputIteratorT , class scaleT >
void convert_range (const OutputIteratorT &out_begin, scaleT &scale_factor, const InputIteratorT &in_begin, const InputIteratorT &in_end)
 Converts the data in the input range to the output range (with elements of different types) such that data_in == data_out * scale_factor. More...
 
template<class IteratorT , class scaleT >
void convert_range (const IteratorT &out_begin, scaleT &scale_factor, const IteratorT &in_begin, const IteratorT &in_end)
 
template<typename T , typename iterT >
iterT copy_to (const T &stir_object, iterT iter)
 Copy all bins to a range specified by a iterator. More...
 
template<typename T , typename iterT >
void fill_from (T &stir_object, iterT iter, iterT iter_end)
 set all elements of stir_object from an iterator More...
 
template<class coordT >
CartesianCoordinate3D< coordT > cross_product (const CartesianCoordinate3D< coordT > &a, const CartesianCoordinate3D< coordT > &b)
 the cross-product for 3-dimensional coordinates. More...
 
template<int num_dimensions, typename elemT >
void array_to_device (elemT *dev_data, const Array< num_dimensions, elemT > &stir_array)
 
template<int num_dimensions, typename elemT >
void array_to_host (Array< num_dimensions, elemT > &stir_array, const elemT *dev_data)
 
double decay_correction_factor (const double isotope_halflife, const double start_time, const double end_time)
 Compute decay-correction factor for a time frame. More...
 
double decay_correction_factor (const double isotope_halflife, const double rel_time)
 Computes the decay-correction factor for activity at a given time point. More...
 
template<class elemT , class scaleT , class CHARP >
void display (const Array< 3, elemT > &plane_stack, const VectorWithOffset< scaleT > &scale_factors, const VectorWithOffset< CHARP > &text, double maxi, const char *const title, int zoom)
 
template<class elemT , class scaleT , class CHARP >
void display (const Array< 3, elemT > &plane_stack, const VectorWithOffset< scaleT > &scale_factors, const VectorWithOffset< CHARP > &text, double maxi, const char *const title)
 
template<class elemT , class scaleT , class CHARP >
void display (const Array< 3, elemT > &plane_stack, const VectorWithOffset< scaleT > &scale_factors, const VectorWithOffset< CHARP > &text, double maxi)
 
template<class elemT , class scaleT , class CHARP >
void display (const Array< 3, elemT > &plane_stack, const VectorWithOffset< scaleT > &scale_factors, const VectorWithOffset< CHARP > &text)
 
template<class elemT >
void display (const Array< 3, elemT > &plane_stack, double maxi, const char *const title, int zoom)
 
template<class elemT >
void display (const Array< 3, elemT > &plane_stack, double maxi, const char *const title)
 
template<class elemT >
void display (const Array< 3, elemT > &plane_stack, double maxi)
 
template<class elemT >
void display (const Array< 3, elemT > &plane_stack)
 
template<class elemT >
void display (const Array< 2, elemT > &plane, const char *const text, double maxi, int zoom)
 
template<class elemT >
void display (const Array< 2, elemT > &plane, const char *const text, double maxi)
 
template<class elemT >
void display (const Array< 2, elemT > &plane, const char *const text)
 
template<class elemT >
void display (const Array< 2, elemT > &plane)
 
template<typename iterT >
void fill_from (DynamicProjData &stir_object, iterT iter, iterT)
 set all elements of a MultipleProjData from an iterator More...
 
template<class STRING >
void error (const STRING &string)
 Use this function for writing error messages and throwing an exception. More...
 
template<class elemT >
Array< 1, elemT > 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. More...
 
template<class RandomAccessIterType >
float find_level_width (const RandomAccessIterType &begin_iterator, const RandomAccessIterType &max_iterator, const RandomAccessIterType &end_iterator, const float level_height)
 find width at a level More...
 
template<class RandomAccessIterType >
float find_level_width (const RandomAccessIterType &begin_iterator, const RandomAccessIterType &end_iterator, const float level_height)
 find width at a level More...
 
template<class coordT >
coordT coordinate_between_2_lines (CartesianCoordinate3D< coordT > &result, const LORAs2Points< coordT > &line0, const LORAs2Points< coordT > &line1)
 find a point half-way between 2 lines and their distance More...
 
template<class coordT >
coordT distance_between_line_and_point (const LORAs2Points< coordT > &line, const CartesianCoordinate3D< coordT > &r1)
 find the distance between a point and a line
 
template<class coordT >
void project_point_on_a_line (const CartesianCoordinate3D< coordT > &p1, const CartesianCoordinate3D< coordT > &p2, CartesianCoordinate3D< coordT > &r1)
 Project a point on a line. More...
 
template<class elemT >
int index_at_maximum (const VectorWithOffset< elemT > &v)
 Finds the index where the maximum occurs in a (1-dimensional) vector. More...
 
template<class elemT >
BasicCoordinate< 3, int > indices_at_maximum (const Array< 3, elemT > &input_array)
 Finds the first (3-dimensional) index where the maximum occurs in a (3-dimensional) array. More...
 
template<class STRING >
void info (const STRING &string, const int verbosity_level=1)
 Use this function for writing informational messages. More...
 
bool is_interfile_signature (const char *const signature)
 Checks if the signature corresponds to the start of an interfile header. More...
 
VoxelsOnCartesianGrid< float > * read_interfile_image (std::istream &input, const std::string &directory_for_data="")
 This reads the first 3d image in an Interfile header file, given as a stream. More...
 
VoxelsOnCartesianGrid< float > * read_interfile_image (const std::string &filename)
 This reads the first 3d image in an Interfile header file, given as a filename. More...
 
DynamicDiscretisedDensityread_interfile_dynamic_image (std::istream &input, const std::string &directory_for_data)
 Read dynamic image.
 
DynamicDiscretisedDensityread_interfile_dynamic_image (const std::string &filename)
 Read dynamic image.
 
ParametricDiscretisedDensity< VoxelsOnCartesianGrid< KineticParameters< 2, float > > > * read_interfile_parametric_image (std::istream &input, const std::string &directory_for_data)
 Read parametric image.
 
ParametricDiscretisedDensity< VoxelsOnCartesianGrid< KineticParameters< 2, float > > > * read_interfile_parametric_image (const std::string &filename)
 Read parametric image.
 
Succeeded write_basic_interfile_image_header (const std::string &header_file_name, const std::string &image_file_name, const ExamInfo &exam_info, const IndexRange< 3 > &index_range, const CartesianCoordinate3D< float > &voxel_size, const CartesianCoordinate3D< float > &origin, const NumericType output_type, const ByteOrder byte_order, const VectorWithOffset< float > &scaling_factors, const VectorWithOffset< unsigned long > &file_offsets, const std::vector< std::string > &data_type_descriptions=std::vector< std::string >())
 This outputs an Interfile header for an image. More...
 
const VectorWithOffset< unsigned long > compute_file_offsets (int number_of_time_frames, const NumericType output_type, const Coordinate3D< int > &dim, unsigned long initial_offset=0)
 a utility function that computes the file offsets of subsequent images
 
template<class elemT >
Succeeded write_basic_interfile (const std::string &filename, const Array< 3, elemT > &image, const CartesianCoordinate3D< float > &voxel_size, const CartesianCoordinate3D< float > &origin, const NumericType output_type=NumericType::FLOAT, const float scale=0, const ByteOrder byte_order=ByteOrder::native)
 This outputs an Interfile header and data for a Array<3,elemT> object. More...
 
template<class elemT >
Succeeded write_basic_interfile (const std::string &filename, const ExamInfo &exam_info, const Array< 3, elemT > &image, const CartesianCoordinate3D< float > &voxel_size, const CartesianCoordinate3D< float > &origin, const NumericType output_type=NumericType::FLOAT, const float scale=0, const ByteOrder byte_order=ByteOrder::native)
 This outputs an Interfile header and data for a Array<3,elemT> object. More...
 
template<class elemT >
Succeeded write_basic_interfile (const std::string &filename, const Array< 3, elemT > &image, const NumericType output_type=NumericType::FLOAT, const float scale=0, const ByteOrder byte_order=ByteOrder::native)
 This outputs an Interfile header and data for a Array<3,elemT> object, assuming unit voxel sizes. More...
 
Succeeded write_basic_interfile (const std::string &filename, const VoxelsOnCartesianGrid< float > &image, const NumericType output_type=NumericType::FLOAT, const float scale=0, const ByteOrder byte_order=ByteOrder::native)
 This outputs an Interfile header and data for a VoxelsOnCartesianGrid<float> object. More...
 
Succeeded write_basic_interfile (const std::string &filename, const DiscretisedDensity< 3, float > &image, const NumericType output_type=NumericType::FLOAT, const float scale=0, const ByteOrder byte_order=ByteOrder::native)
 This outputs an Interfile header and data for a DiscretisedDensity<3,float> object. More...
 
Succeeded write_basic_interfile (const std::string &filename, const ParametricDiscretisedDensity< VoxelsOnCartesianGrid< KineticParameters< 2, float >>> &image, const NumericType output_type=NumericType::FLOAT, const float scale=0, const ByteOrder byte_order=ByteOrder::native)
 
Succeeded write_basic_interfile (const std::string &filename, const DynamicDiscretisedDensity &image, const NumericType output_type=NumericType::FLOAT, const float scale=0, const ByteOrder byte_order=ByteOrder::native)
 
ProjDataFromStreamread_interfile_PDFS (std::istream &input, const std::string &directory_for_data="", const std::ios::openmode openmode=std::ios::in)
 This reads the first 3D sinogram from an Interfile header, given as a stream. More...
 
ProjDataFromStreamread_interfile_PDFS (const std::string &filename, const std::ios::openmode open_mode)
 This reads the first 3D sinogram from an Interfile header, given as a filename. More...
 
Succeeded write_basic_interfile_PDFS_header (const std::string &header_filename, const std::string &data_filename, const ProjDataFromStream &pdfs)
 This writes an Interfile header appropriate for the ProjDataFromStream object. More...
 
Succeeded write_basic_interfile_PDFS_header (const std::string &data_filename, const ProjDataFromStream &pdfs)
 This function writes an Interfile header for the pdfs object. More...
 
template<int num_dimensions, class IStreamT , class elemT >
Succeeded read_data (IStreamT &s, Array< num_dimensions, elemT > &data, const ByteOrder byte_order=ByteOrder::native)
 Read the data of an Array from file. More...
 
template<int num_dimensions, class IStreamT , class elemT , class InputType , class ScaleT >
Succeeded read_data (IStreamT &s, Array< num_dimensions, elemT > &data, NumericInfo< InputType > input_type, ScaleT &scale_factor, const ByteOrder byte_order=ByteOrder::native)
 Read the data of an Array from file as a different type. More...
 
template<int num_dimensions, class IStreamT , class elemT , class ScaleT >
Succeeded read_data (IStreamT &s, Array< num_dimensions, elemT > &data, NumericType type, ScaleT &scale, const ByteOrder byte_order=ByteOrder::native)
 Read the data of an Array from file as a different type. More...
 
template<class DataT , class FileT >
unique_ptr< DataT > read_from_file (const FileSignature &signature, FileT file)
 Function that reads data from file using the default InputFileFormatRegistry, using the provided FileSignature to find the matching file format. More...
 
template<class DataT , class FileT >
unique_ptr< DataT > read_from_file (FileT file)
 Function that reads data from file using the default InputFileFormatRegistry. More...
 
template<int num_dimensions, class OStreamT , class elemT >
Succeeded write_data (OStreamT &s, const Array< num_dimensions, elemT > &data, const ByteOrder byte_order=ByteOrder::native, const bool can_corrupt_data=false)
 Write the data of an Array to file. More...
 
template<int num_dimensions, class OStreamT , class elemT , class OutputType , class ScaleT >
Succeeded write_data (OStreamT &s, const Array< num_dimensions, elemT > &data, NumericInfo< OutputType > output_type, ScaleT &scale_factor, const ByteOrder byte_order=ByteOrder::native, const bool can_corrupt_data=false)
 Write the data of an Array to file as a different type. More...
 
template<int num_dimensions, class OStreamT , class elemT , class OutputType , class ScaleT >
Succeeded write_data_with_fixed_scale_factor (OStreamT &s, const Array< num_dimensions, elemT > &data, NumericInfo< OutputType > output_type, const ScaleT scale_factor, const ByteOrder byte_order=ByteOrder::native, const bool can_corrupt_data=false)
 Write the data of an Array to file as a different type but using a given scale factor. More...
 
template<int num_dimensions, class OStreamT , class elemT , class ScaleT >
Succeeded write_data (OStreamT &s, const Array< num_dimensions, elemT > &data, NumericType type, ScaleT &scale, const ByteOrder byte_order=ByteOrder::native, const bool can_corrupt_data=false)
 Write the data of an Array to file as a different type. More...
 
template<class DataT >
std::string write_to_file (const std::string &filename, const DataT &data)
 Function that writes data to file using the default OutputFileFormat. More...
 
template<class Value , class DataType , class CoordinatesType >
void 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. More...
 
template<class Value , class DataIter , class CoordinatesIter , class WeightsIter >
void 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. More...
 
template<class ValueIter , class DataIter , class CoordinatesIter , class WeightsIter >
void linear_regression (ValueIter regression_values_begin, DataIter data_begin, DataIter data_end, CoordinatesIter coords_begin, WeightsIter weights_begin, const bool use_estimated_variance=true)
 
template<class coordT1 , class coordT2 >
Succeeded find_LOR_intersections_with_cylinder (LORInCylinderCoordinates< coordT1 > &, const LORAs2Points< coordT2 > &, const double radius)
 Given an LOR, find its intersection with a (infintely long) cylinder. More...
 
template<class coordT1 , class coordT2 >
Succeeded find_LOR_intersections_with_cylinder (LORAs2Points< coordT1 > &intersection_coords, const LORAs2Points< coordT2 > &coords, const double radius)
 Given an LOR, find its intersection with a (infintely long) cylinder. More...
 
template<class coordT1 , class coordT2 >
Succeeded find_LOR_intersections_with_cylinder (LORInAxialAndNoArcCorrSinogramCoordinates< coordT1 > &lor, const LORAs2Points< coordT2 > &cart_coords, const double radius)
 Given an LOR, find its intersection with a (infintely long) cylinder. More...
 
template<class coordT1 , class coordT2 >
Succeeded find_LOR_intersections_with_cylinder (LORInAxialAndSinogramCoordinates< coordT1 > &lor, const LORAs2Points< coordT2 > &cart_coords, const double radius)
 Given an LOR, find its intersection with a (infintely long) cylinder. More...
 
template<class T >
VectorWithOffset< T > make_vector (const T &a0)
 
template<class T >
VectorWithOffset< T > make_vector (const T &a0, const T &a1)
 
template<class T >
VectorWithOffset< T > make_vector (const T &a0, const T &a1, const T &a2)
 
template<class T >
VectorWithOffset< T > make_vector (const T &a0, const T &a1, const T &a2, const T &a3)
 
template<class T >
VectorWithOffset< T > make_vector (const T &a0, const T &a1, const T &a2, const T &a3, const T &a4)
 
template<class T >
VectorWithOffset< T > make_vector (const T &a0, const T &a1, const T &a2, const T &a3, const T &a4, const T &a5)
 
template<class T >
VectorWithOffset< T > make_vector (const T &a0, const T &a1, const T &a2, const T &a3, const T &a4, const T &a5, const T &a6)
 
template<class T >
VectorWithOffset< T > make_vector (const T &a0, const T &a1, const T &a2, const T &a3, const T &a4, const T &a5, const T &a6, const T &a7)
 
template<class T >
VectorWithOffset< T > make_vector (const T &a0, const T &a1, const T &a2, const T &a3, const T &a4, const T &a5, const T &a6, const T &a7, const T &a8)
 
template<class T >
VectorWithOffset< T > make_vector (const T &a0, const T &a1, const T &a2, const T &a3, const T &a4, const T &a5, const T &a6, const T &a7, const T &a8, const T &a9)
 
template<class T >
Array< 1, T > make_1d_array (const T &a0)
 
template<class T >
Array< 1, T > make_1d_array (const T &a0, const T &a1)
 
template<class T >
Array< 1, T > make_1d_array (const T &a0, const T &a1, const T &a2)
 
template<class T >
Array< 1, T > make_1d_array (const T &a0, const T &a1, const T &a2, const T &a3)
 
template<class T >
Array< 1, T > make_1d_array (const T &a0, const T &a1, const T &a2, const T &a3, const T &a4)
 
template<class T >
Array< 1, T > make_1d_array (const T &a0, const T &a1, const T &a2, const T &a3, const T &a4, const T &a5)
 
template<class T >
Array< 1, T > make_1d_array (const T &a0, const T &a1, const T &a2, const T &a3, const T &a4, const T &a5, const T &a6)
 
template<class T >
Array< 1, T > make_1d_array (const T &a0, const T &a1, const T &a2, const T &a3, const T &a4, const T &a5, const T &a6, const T &a7)
 
template<class T >
Array< 1, T > make_1d_array (const T &a0, const T &a1, const T &a2, const T &a3, const T &a4, const T &a5, const T &a6, const T &a7, const T &a8)
 
template<class T >
Array< 1, T > make_1d_array (const T &a0, const T &a1, const T &a2, const T &a3, const T &a4, const T &a5, const T &a6, const T &a7, const T &a8, const T &a9)
 
template<int num_dimensions, class T >
Array< num_dimensions+1, T > make_array (const Array< num_dimensions, T > &a0)
 
template<int num_dimensions, class T >
Array< num_dimensions+1, T > make_array (const Array< num_dimensions, T > &a0, const Array< num_dimensions, T > &a1)
 
template<int num_dimensions, class T >
Array< num_dimensions+1, T > make_array (const Array< num_dimensions, T > &a0, const Array< num_dimensions, T > &a1, const Array< num_dimensions, T > &a2)
 
template<int num_dimensions, class T >
Array< num_dimensions+1, T > make_array (const Array< num_dimensions, T > &a0, const Array< num_dimensions, T > &a1, const Array< num_dimensions, T > &a2, const Array< num_dimensions, T > &a3)
 
template<int num_dimensions, class T >
Array< num_dimensions+1, T > make_array (const Array< num_dimensions, T > &a0, const Array< num_dimensions, T > &a1, const Array< num_dimensions, T > &a2, const Array< num_dimensions, T > &a3, const Array< num_dimensions, T > &a4)
 
template<int num_dimensions, class T >
Array< num_dimensions+1, T > make_array (const Array< num_dimensions, T > &a0, const Array< num_dimensions, T > &a1, const Array< num_dimensions, T > &a2, const Array< num_dimensions, T > &a3, const Array< num_dimensions, T > &a4, Array< num_dimensions, T > &a5)
 
template<int num_dimensions, class T >
Array< num_dimensions+1, T > make_array (const Array< num_dimensions, T > &a0, const Array< num_dimensions, T > &a1, const Array< num_dimensions, T > &a2, const Array< num_dimensions, T > &a3, const Array< num_dimensions, T > &a4, Array< num_dimensions, T > &a5, const Array< num_dimensions, T > &a6)
 
template<int num_dimensions, class T >
Array< num_dimensions+1, T > make_array (const Array< num_dimensions, T > &a0, const Array< num_dimensions, T > &a1, const Array< num_dimensions, T > &a2, const Array< num_dimensions, T > &a3, const Array< num_dimensions, T > &a4, Array< num_dimensions, T > &a5, const Array< num_dimensions, T > &a6, const Array< num_dimensions, T > &a7)
 
template<int num_dimensions, class T >
Array< num_dimensions+1, T > make_array (const Array< num_dimensions, T > &a0, const Array< num_dimensions, T > &a1, const Array< num_dimensions, T > &a2, const Array< num_dimensions, T > &a3, const Array< num_dimensions, T > &a4, Array< num_dimensions, T > &a5, const Array< num_dimensions, T > &a6, const Array< num_dimensions, T > &a7, const Array< num_dimensions, T > &a8)
 
template<int num_dimensions, class T >
Array< num_dimensions+1, T > make_array (const Array< num_dimensions - 1, T > &a0, const Array< num_dimensions - 1, T > &a1, const Array< num_dimensions - 1, T > &a2, const Array< num_dimensions - 1, T > &a3, const Array< num_dimensions - 1, T > &a4, Array< num_dimensions - 1, T > &a5, const Array< num_dimensions - 1, T > &a6, const Array< num_dimensions - 1, T > &a7, const Array< num_dimensions - 1, T > &a8, const Array< num_dimensions - 1, T > &a9)
 
template<int num_dimensions, class T >
Array< num_dimensions+1, T > make_array (const Array< num_dimensions, T > &a0, const Array< num_dimensions, T > &a1, const Array< num_dimensions, T > &a2, const Array< num_dimensions, T > &a3, const Array< num_dimensions, T > &a4, Array< num_dimensions, T > &a5, const Array< num_dimensions, T > &a6, const Array< num_dimensions, T > &a7, const Array< num_dimensions, T > &a8, const Array< num_dimensions, T > &a9)
 
template<typename ForwardIter_t >
ForwardIter_t min_positive_element (ForwardIter_t start, ForwardIter_t end)
 Finds where the smallest strictly positive element occurs. More...
 
double KL (const double a, const double b, const double threshold_a=0)
 
template<int num_dimensions, typename elemT >
double KL (const Array< num_dimensions, elemT > &a, const Array< num_dimensions, elemT > &b, const double threshold_a=0)
 
template<int num_dimensions, class T , class T2 >
void assign (KineticParameters< num_dimensions, T > &v, const T2 &y)
 
template<class iterT >
iterT abs_max_element (iterT start, iterT end)
 Like std::max_element, but comparing after taking absolute value. More...
 
template<class IterT , class elemT >
elemT sum (IterT start, IterT end, elemT init)
 Compute the sum of a sequence using operator+=(), using an initial value. More...
 
template<class IterT >
std::iterator_traits< IterT >::value_type sum (IterT start, IterT end)
 Compute the sum of a sequence using operator+=(). More...
 
template<class IterT >
std::iterator_traits< IterT >::value_type average (IterT start, IterT end)
 Compute the average of a sequence using sum(start,end). More...
 
template<typename iterT >
void fill_from (MultipleProjData &stir_object, iterT iter, iterT)
 set all elements of a MultipleProjData from an iterator More...
 
template<class elemT >
elemT determinant (const Array< 2, elemT > &m)
 Compute the determinant of a matrix. More...
 
template<class NumeratorIterT , class DenominatorIterT , class small_numT >
void divide (const NumeratorIterT &numerator_begin, const NumeratorIterT &numerator_end, const DenominatorIterT &denominator_begin, const small_numT small_num)
 division of two ranges, 0/0 = 0 More...
 
template<typename T >
void fourier (T &c, const int sign=1)
 Compute multi-dimensional discrete fourier transform. More...
 
template<typename T >
void inverse_fourier (T &c, const int sign=1)
 Compute the inverse of the multi-dimensional discrete fourier transform. More...
 
template<typename T >
void fourier_1d (T &c, const int sign)
 Compute one-dimensional discrete fourier transform of an array. More...
 
template<typename T >
void inverse_fourier_1d (T &c, const int sign=1)
 Compute the inverse of the one-dimensional discrete fourier transform. More...
 
template<typename T >
Array< 1, std::complex< T > > fourier_1d_for_real_data (const Array< 1, T > &c, const int sign=1)
 Compute one-dimensional discrete fourier transform of a real array (of even size). More...
 
template<typename T >
Array< 1, T > inverse_fourier_1d_for_real_data (const Array< 1, std::complex< T >> &c, const int sign=1)
 Compute the inverse of the one-dimensional discrete fourier transform of a real array (of even size). More...
 
template<typename T >
Array< 1, T > inverse_fourier_1d_for_real_data_corrupting_input (Array< 1, std::complex< T >> &c, const int sign)
 As inverse_fourier_1d_for_real_data(), but avoiding the copy of the input array. More...
 
template<int num_dimensions, typename T >
Array< num_dimensions, std::complex< T > > fourier_for_real_data (const Array< num_dimensions, T > &c, const int sign=1)
 Compute discrete fourier transform of a real array (with the last dimensions of even size). More...
 
template<int num_dimensions, typename T >
Array< num_dimensions, T > inverse_fourier_for_real_data (const Array< num_dimensions, std::complex< T >> &c, const int sign=1)
 Compute the inverse of the discrete fourier transform of a real array (with the last dimension of even size). More...
 
template<int num_dimensions, typename T >
Array< num_dimensions, T > inverse_fourier_for_real_data_corrupting_input (Array< num_dimensions, std::complex< T >> &c, const int sign=1)
 As inverse_fourier_for_real_data(), but avoiding the copy of the input array. More...
 
template<int num_dimensions, typename T >
Array< num_dimensions, std::complex< T > > pos_frequencies_to_all (const Array< num_dimensions, std::complex< T >> &c)
 Adds negative frequencies to the last dimension of a complex array by complex conjugation. More...
 
template<typename elemT >
elemT integrate_discrete_function (const std::vector< elemT > &coordinates, const std::vector< elemT > &values, const int interpolation_order=1)
 numerical integration of a 1D functionThis is a simple integral implementation using rectangular (=0) or trapezoidal (=1) approximation. It currently integrates over the complete range specified. More...
 
template<class RandIter1 , class RandIter2 , class RandIter3 , class RandIter4 >
void IIR_filter (RandIter1 output_begin_iterator, RandIter1 output_end_iterator, const RandIter2 input_begin_iterator, const RandIter2 input_end_iterator, const RandIter3 input_factor_begin_iterator, const RandIter3 input_factor_end_iterator, const RandIter4 pole_begin_iterator, const RandIter4 pole_end_iterator, const bool if_initial_exists)
 
template<class RandIter1 , class RandIter2 , class RandIter3 >
void FIR_filter (RandIter1 output_begin_iterator, RandIter1 output_end_iterator, const RandIter2 input_begin_iterator, const RandIter2 input_end_iterator, const RandIter3 input_factor_begin_iterator, const RandIter3 input_factor_end_iterator, const bool if_initial_exists)
 
template<class elemT >
std::complex< elemT > inner_product (const Array< 1, std::complex< elemT >> &v1, const Array< 1, std::complex< elemT >> &v2)
 
template<int num_dimensions, class elemT >
BasicCoordinate< num_dimensions, elemT > matrix_multiply (const Array< 2, elemT > &m, const BasicCoordinate< num_dimensions, elemT > &vec)
 
template<class elemT >
Succeeded absolute_max_eigenvector_using_power_method (elemT &max_eigenvalue, Array< 1, elemT > &max_eigenvector, const Array< 2, elemT > &m, const Array< 1, elemT > &start, const double tolerance=.01, const unsigned long max_num_iterations=10000UL)
 Compute the eigenvalue with the largest absolute value and corresponding eigenvector of a matrix by using the power method. More...
 
template<class elemT >
Succeeded absolute_max_eigenvector_using_shifted_power_method (elemT &max_eigenvalue, Array< 1, elemT > &max_eigenvector, const Array< 2, elemT > &m, const Array< 1, elemT > &start, const elemT shift, const double tolerance=.03, const unsigned long max_num_iterations=10000UL)
 Compute the eigenvalue with the largest absolute value and corresponding eigenvector of a matrix by using the shifted power method. More...
 
template<class elemT >
Succeeded max_eigenvector_using_power_method (elemT &max_eigenvalue, Array< 1, elemT > &max_eigenvector, const Array< 2, elemT > &m, const Array< 1, elemT > &start, const double tolerance=.03, const unsigned long max_num_iterations=10000UL)
 Compute the eigenvalue with the largest value and corresponding eigenvector of a matrix by using the power method. More...
 
template<typename out_iter_t , typename out_coord_iter_t , typename in_iter_t , typename in_coord_iter_t >
void overlap_interpolate (const out_iter_t out_begin, const out_iter_t out_end, const out_coord_iter_t out_coord_begin, const out_coord_iter_t out_coord_end, const in_iter_t in_begin, in_iter_t in_end, const in_coord_iter_t in_coord_begin, const in_coord_iter_t in_coord_end, const bool only_add_to_output=false, const bool assign_rest_with_zeroes=true)
 'overlap' interpolation for iterators, with arbitrary 'bin' sizes. More...
 
template<class FunctionType , class elemT , class positionT >
void sample_function_on_regular_grid (Array< 3, elemT > &out, FunctionType func, const BasicCoordinate< 3, positionT > &offset, const BasicCoordinate< 3, positionT > &step)
 Generic function to get the values of a 3D function on a regular grid. More...
 
template<typename elemT , typename FunctionType , typename Lambda >
void sample_function_using_index_converter (Array< 3, elemT > &out, FunctionType func, Lambda &&index_converter)
 Generic function to get the values of a 3D function on a grid. More...
 
double norm (const ProjDataInMemory &p)
 
double norm_squared (const ProjDataInMemory &p)
 
void setup_distributable_computation (const shared_ptr< ProjectorByBinPair > &proj_pair_sptr, const shared_ptr< const ExamInfo > &exam_info_sptr, const shared_ptr< const ProjDataInfo > proj_data_info_sptr, const shared_ptr< const DiscretisedDensity< 3, float >> &target_sptr, const bool zero_seg0_end_planes, const bool distributed_cache_enabled)
 set-up parameters before calling distributable_computation() More...
 
void end_distributable_computation ()
 clean-up after a sequence of computations More...
 
void distributable_computation (const shared_ptr< ForwardProjectorByBin > &forward_projector_sptr, const shared_ptr< BackProjectorByBin > &back_projector_sptr, const shared_ptr< DataSymmetriesForViewSegmentNumbers > &symmetries_sptr, DiscretisedDensity< 3, float > *output_image_ptr, const DiscretisedDensity< 3, float > *input_image_ptr, const shared_ptr< ProjData > &proj_data_ptr, const bool read_from_proj_data, int subset_num, int num_subsets, int min_segment_num, int max_segment_num, bool zero_seg0_end_planes, double *double_out_ptr, const shared_ptr< ProjData > &additive_binwise_correction, const shared_ptr< BinNormalisation > normalise_sptr, const double start_time_of_frame, const double end_time_of_frame, RPC_process_related_viewgrams_type *RPC_process_related_viewgrams, DistributedCachingInformation *caching_info_ptr, int min_timing_pos_num, int max_timing_pos_num)
 This function essentially implements a loop over segments and all views in the current subset.Output is in output_image_ptr and in float_out_ptr (but only if they are not NULL). What the output is, is really determined by the call-back function RPC_process_related_viewgrams. More...
 
template<typename CallBackT >
void LM_distributable_computation (const shared_ptr< ProjMatrixByBin > PM_sptr, const shared_ptr< ProjDataInfo > &proj_data_info_sptr, DiscretisedDensity< 3, float > *output_image_ptr, const DiscretisedDensity< 3, float > *input_image_ptr, const std::vector< BinAndCorr > &record_cache, const int subset_num, const int num_subsets, const bool has_add, const bool accumulate, double *double_out_ptr, CallBackT &&call_back)
 This function essentially implements a loop over a cached listmode file. More...
 
void ML_estimate_component_based_normalisation (const std::string &out_filename_prefix, const ProjData &measured_data, const ProjData &model_data, int num_eff_iterations, int num_iterations, bool do_geo, bool do_block, bool do_symmetry_per_block, bool do_KL, bool do_display)
 Find normalisation factors using a maximum likelihood approach.
 
bool operator== (const ProjMatrixElemsForOneBinValue &el1, const ProjMatrixElemsForOneBinValue &el2)
 
bool operator< (const ProjMatrixElemsForOneBinValue &el1, const ProjMatrixElemsForOneBinValue &el2)
 
bool operator== (const ProjMatrixElemsForOneDenselValue &el1, const ProjMatrixElemsForOneDenselValue &el2)
 
bool operator< (const ProjMatrixElemsForOneDenselValue &el1, const ProjMatrixElemsForOneDenselValue &el2)
 
void RayTraceVoxelsOnCartesianGrid (ProjMatrixElemsForOneBin &lor, const CartesianCoordinate3D< float > &start_point, const CartesianCoordinate3D< float > &end_point, const CartesianCoordinate3D< float > &voxel_size, const float normalisation_constant=1.F)
 RayTraceVoxelsOnCartesianGrid finds the Length of Intersections (LOIs) of an LOR with a grid of voxels and appends them to the ProjMatrixElemsForOneBin object. More...
 
template<typename integerT >
void round_to (integerT &result, const double x)
 
void round_to (unsigned &result, const double x)
 
void round_to (unsigned long &result, const double x)
 
VoxelsOnCartesianGrid< float > warp_image (const shared_ptr< DiscretisedDensity< 3, float >> &density_sptr, const shared_ptr< DiscretisedDensity< 3, float >> &motion_x_sptr, const shared_ptr< DiscretisedDensity< 3, float >> &motion_y_sptr, const shared_ptr< DiscretisedDensity< 3, float >> &motion_z_sptr, const BSpline::BSplineType spline_type, const bool extend_borders)
 
template<typename elemT >
std::ostream & operator<< (std::ostream &str, const VectorWithOffset< elemT > &v)
 Outputs a VectorWithOffset to a stream. More...
 
template<int num_dimensions, typename coordT >
std::ostream & operator<< (std::ostream &str, const BasicCoordinate< num_dimensions, coordT > &v)
 Outputs a BasicCoordinate to a stream. More...
 
template<typename elemT >
std::ostream & operator<< (std::ostream &str, const std::vector< elemT > &v)
 Outputs a vector to a stream. More...
 
std::ostream & operator<< (std::ostream &out, const Bin &bin)
 Outputs a Bin to a stream.Output is of the form. More...
 
template<class T >
std::ostream & operator<< (std::ostream &out, const DetectionPosition< T > &det_pos)
 Outputs a DetectionPosition to a stream.Output is of the form. More...
 
template<class T >
std::ostream & operator<< (std::ostream &out, const DetectionPositionPair< T > &det_pos)
 Outputs a DetectionPosition to a stream.Output is of the form. More...
 
template<typename elemT >
std::istream & operator>> (std::istream &str, std::vector< elemT > &v)
 Inputs a vector from a stream. More...
 
template<typename elemT >
std::istream & operator>> (std::istream &str, VectorWithOffset< elemT > &v)
 Inputs a VectorWithOffset from a stream. More...
 
template<int num_dimensions, typename coordT >
std::istream & operator>> (std::istream &str, BasicCoordinate< num_dimensions, coordT > &v)
 Inputs a coordinate from a stream. More...
 
double mm_to_tof_delta_time (const float dist)
 
float tof_delta_time_to_mm (const double delta_time)
 
char * strupr (char *const str)
 make C-string uppercase
 
template<class STRING >
void warning (const STRING &string, const int verbosity_level=1)
 Use this function for writing warning messages. More...
 
void four1 (Array< 1, float > &data, int nn, int isign)
 1-dimensional FFT More...
 
void fourn (Array< 1, float > &data, Array< 1, int > &nn, int ndim, int isign)
 n-dimensional FFT More...
 
void convlvC (Array< 1, float > &data, const Array< 1, float > &filter, int n)
 Convolve data with a filter which is given in frequency space. More...
 
void rlft3 (Array< 3, float > &data, Array< 2, float > &speq, int nn1, int nn2, int nn3, int isign)
 3D FFT of real numbers
 
void realft (Array< 1, float > &data, int n, int isign)
 Calculates the Fourier Transform of a set of 2n real-valued data points. More...
 
void fwd_project (ProjData &proj_data, VoxelsOnCartesianGrid< float > *vox_image_ptr, const int start_segment_num, const int end_segment_num, const int start_axial_pos_num, const int end_axial_pos_num, const int start_view, const int end_view, const int start_tang_pos_num, const int end_tang_pos_num)
 
Coordinate4D< int > sign (const Coordinate4D< float > &c)
 
Coordinate4D< float > abs (const Coordinate4D< float > &c)
 
void add_to_bin (VectorWithOffset< shared_ptr< SegmentByView< float >>> &segments, const Bin &bin, const float value)
 
template<class ObjectTransformationT , class PushInterpolatorT >
Succeeded transform_3d_object_push_interpolation (DiscretisedDensity< 3, float > &out_density, const DiscretisedDensity< 3, float > &in_density, const ObjectTransformationT &transformation_in_to_out, const PushInterpolatorT &interpolator, const bool do_jacobian)
 transform image data More...
 
template<class ObjectTransformationT , class PullInterpolatorT >
Succeeded transform_3d_object_pull_interpolation (DiscretisedDensity< 3, float > &out_density, const DiscretisedDensity< 3, float > &in_density, const ObjectTransformationT &transformation_out_to_in, const PullInterpolatorT &interpolator, const bool do_jacobian)
 transform image data More...
 
template<class T2 >
void assign (std::pair< BasicCoordinate< 3, float >, float > &x, T2 y)
 
template<typename in_elemT >
void linear_extrapolation (std::vector< in_elemT > &input_vector)
 
template<class elemT , class positionT >
elemT pull_nearest_neighbour_interpolate (const Array< 3, elemT > &in, const BasicCoordinate< 3, positionT > &point_in_input_coords)
 Pull value from the input array using nearest neigbour interpolation. More...
 
template<int num_dimensions, class elemT , class positionT , class valueT >
void push_nearest_neighbour_interpolate (Array< num_dimensions, elemT > &out, const BasicCoordinate< num_dimensions, positionT > &point_in_output_coords, valueT value)
 Push value into the output array using nearest neigbour interpolation. More...
 
template<class elemT , class positionT >
elemT pull_linear_interpolate (const Array< 3, elemT > &in, const BasicCoordinate< 3, positionT > &point_in_input_coords)
 Returns an interpolated value according to point_in_input_coords.
 
template<class elemT , class positionT , class valueT >
void push_transpose_linear_interpolate (Array< 3, elemT > &out, const BasicCoordinate< 3, positionT > &point_in_output_coords, valueT value)
 Push value into the output array using the transpose of linear interpolation.
 
template<typename coordT >
Quaternion< coordT > conjugate (const Quaternion< coordT > &)
 
template<typename coordT >
Quaternion< coordT > inverse (const Quaternion< coordT > &)
 
template<typename coordT >
coordT norm_squared (const Quaternion< coordT > &q)
 
template<typename coordT >
coordT norm (const Quaternion< coordT > &q)
 
template<class NUMBER >
Succeeded write_basic_interfile (const string &filename, const ExamInfo &exam_info, const Array< 3, NUMBER > &image, const CartesianCoordinate3D< float > &voxel_size, const CartesianCoordinate3D< float > &origin, const NumericType output_type, const float scale, const ByteOrder byte_order)
 
template<class NUMBER >
Succeeded write_basic_interfile (const string &filename, const Array< 3, NUMBER > &image, const CartesianCoordinate3D< float > &voxel_size, const CartesianCoordinate3D< float > &origin, const NumericType output_type, const float scale, const ByteOrder byte_order)
 
Succeeded write_basic_interfile (const string &filename, const ParametricVoxelsOnCartesianGrid &image, const NumericType output_type, const float scale, const ByteOrder byte_order)
 
ProjDataFromStreamread_interfile_PDFS_Siemens (istream &input, const string &directory_for_data, const ios::openmode open_mode)
 
ProjDataFromStreamread_interfile_PDFS (istream &input, const string &directory_for_data, const ios::openmode open_mode)
 
ProjDataFromStreamread_interfile_PDFS (const string &filename, const ios::openmode open_mode)
 
template Succeeded write_basic_interfile (const string &filename, const Array< 3, signed short > &, const CartesianCoordinate3D< float > &voxel_size, const CartesianCoordinate3D< float > &origin, const NumericType output_type, const float scale, const ByteOrder byte_order)
 
template Succeeded write_basic_interfile (const string &filename, const Array< 3, unsigned short > &, const CartesianCoordinate3D< float > &voxel_size, const CartesianCoordinate3D< float > &origin, const NumericType output_type, const float scale, const ByteOrder byte_order)
 
template Succeeded write_basic_interfile (const string &filename, const Array< 3, float > &, const CartesianCoordinate3D< float > &voxel_size, const CartesianCoordinate3D< float > &origin, const NumericType output_type, const float scale, const ByteOrder byte_order)
 
template Succeeded write_basic_interfile (const string &filename, const Array< 3, signed short > &image, const NumericType output_type, const float scale, const ByteOrder byte_order)
 
template Succeeded write_basic_interfile (const string &filename, const Array< 3, unsigned short > &image, const NumericType output_type, const float scale, const ByteOrder byte_order)
 
template Succeeded write_basic_interfile (const string &filename, const Array< 3, float > &image, const NumericType output_type, const float scale, const ByteOrder byte_order)
 
void find_segment_sequence (vector< int > &segment_sequence, VectorWithOffset< int > &sorted_num_rings_per_segment, VectorWithOffset< int > &sorted_min_ring_diff, VectorWithOffset< int > &sorted_max_ring_diff, vector< int > &num_rings_per_segment, const vector< int > &min_ring_difference, const vector< int > &max_ring_difference)
 
template<>
STIRImageMultiConcrete::full_value_type ITK_pixel_to_STIR_pixel (typename ITKImageMulti::PixelType itk_pixel, const STIRImageMultiConcrete &stir_image, bool is_displacement_field)
 
template<typename ITKImageType >
ITKImageType::Pointer orient_ITK_image (const typename ITKImageType::Pointer itk_image_orig, const shared_ptr< ExamInfo > exam_info_sptr)
 
template<>
STIRImageSingleread_file_itk (const std::string &filename)
 
template<>
STIRImageMultiread_file_itk (const std::string &filename)
 
template float determinant (const Array< 2, float > &)
 
template double determinant (const Array< 2, double > &)
 
template std::complex< float > determinant (const Array< 2, std::complex< float >> &)
 
template std::complex< double > determinant (const Array< 2, std::complex< double >> &)
 
template void fourier (Array< 3, std::complex< float >> &c, const int sign)
 
template void fourier (Array< 2, std::complex< float >> &c, const int sign)
 
template void fourier (Array< 1, std::complex< float >> &c, const int sign)
 
template void fourier (VectorWithOffset< std::complex< float >> &c, const int sign)
 
 INSTANTIATE (1, float)
 
 INSTANTIATE (2, float)
 
 INSTANTIATE (3, float)
 
void check_values (const shared_ptr< const ProjDataInfoCylindricalArcCorr > proj_data_info_sptr, const float delta, const double cphi, const double sphi, const int s, const int ring0, const int X1, const int Y1, const int Z1, const double ds, const double dz, const float num_planes_per_axial_pos, const float axial_pos_to_z_offset)
 
template<class dataType >
dataType * create_heap_array (const unsigned numel, const dataType val=dataType(0))
 
void get_stir_indices_and_dims (int stir_dim[3], Coordinate3D< int > &min_indices, Coordinate3D< int > &max_indices, const DiscretisedDensity< 3, float > &stir)
 
unsigned convert_NiftyPET_im_3d_to_1d_idx (const unsigned x, const unsigned y, const unsigned z)
 
std::vector< int > get_buckets (unsigned int *bck, const unsigned B, const unsigned nitag)
 Get bucket singles (from mmrhist.py)
 
void check_im_sizes (const int stir_dim[3], const int np_dim[3])
 
void check_voxel_spacing (const DiscretisedDensity< 3, float > &stir)
 
void get_vals_for_proj_data_conversion (std::vector< int > &sizes, std::vector< int > &segment_sequence, int &num_sinograms, int &min_view, int &max_view, int &min_tang_pos, int &max_tang_pos, const ProjDataInfo &proj_data_info, const std::vector< float > &np_vec)
 
void get_stir_segment_and_axial_pos_from_NiftyPET_sino (int &segment, int &axial_pos, const unsigned np_sino, const std::vector< int > &sizes, const std::vector< int > &segment_sequence)
 
void get_NiftyPET_sino_from_stir_segment_and_axial_pos (unsigned &np_sino, const int segment, const int axial_pos, const std::vector< int > &sizes, const std::vector< int > &segment_sequence)
 
template<bool do_gradient, bool do_value>
void LM_gradient_and_value (DiscretisedDensity< 3, float > &output_image, const ProjMatrixElemsForOneBin &row, const float add_term, const Bin &measured_bin, const DiscretisedDensity< 3, float > &input_image, double *value_ptr)
 
void LM_Hessian (DiscretisedDensity< 3, float > &output_image, const ProjMatrixElemsForOneBin &row, const float add_term, const Bin &measured_bin, const DiscretisedDensity< 3, float > &input_image, const DiscretisedDensity< 3, float > &rhs)
 
void LM_gradient_distributable_computation (const shared_ptr< ProjMatrixByBin > PM_sptr, const shared_ptr< ProjDataInfo > &proj_data_info_sptr, DiscretisedDensity< 3, float > *output_image_ptr, const DiscretisedDensity< 3, float > *input_image_ptr, const std::vector< BinAndCorr > &record_ptr, const int subset_num, const int num_subsets, const bool has_add, const bool accumulate, double *value_ptr)
 
void LM_Hessian_distributable_computation (const shared_ptr< ProjMatrixByBin > PM_sptr, const shared_ptr< ProjDataInfo > &proj_data_info_sptr, DiscretisedDensity< 3, float > *output_image_ptr, const DiscretisedDensity< 3, float > *input_image_ptr, const DiscretisedDensity< 3, float > *rhs_ptr, const std::vector< BinAndCorr > &record_ptr, const int subset_num, const int num_subsets, const bool has_add, const bool accumulate)
 
void distributable_compute_gradient (const shared_ptr< ForwardProjectorByBin > &forward_projector_sptr, const shared_ptr< BackProjectorByBin > &back_projector_sptr, const shared_ptr< DataSymmetriesForViewSegmentNumbers > &symmetries_sptr, DiscretisedDensity< 3, float > &output_image, const DiscretisedDensity< 3, float > &input_image, const shared_ptr< ProjData > &proj_dat, int subset_num, int num_subsets, int min_segment, int max_segment, bool zero_seg0_end_planes, double *log_likelihood_ptr, shared_ptr< ProjData > const &additive_binwise_correction, shared_ptr< BinNormalisation > const &normalisation_sptr, DistributedCachingInformation *caching_info_ptr, int min_timing_pos_num, int max_timing_pos_num, const bool add_sensitivity)
 
void distributable_accumulate_loglikelihood (const shared_ptr< ForwardProjectorByBin > &forward_projector_sptr, const shared_ptr< BackProjectorByBin > &back_projector_sptr, const shared_ptr< DataSymmetriesForViewSegmentNumbers > &symmetries_sptr, const DiscretisedDensity< 3, float > &input_image, const shared_ptr< ProjData > &proj_dat, int subset_num, int num_subsets, int min_segment, int max_segment, bool zero_seg0_end_planes, double *log_likelihood_ptr, shared_ptr< ProjData > const &additive_binwise_correction, shared_ptr< BinNormalisation > const &normalisation_sptr, const double start_time_of_frame, const double end_time_of_frame, DistributedCachingInformation *caching_info_ptr, int min_timing_pos_num, int max_timing_pos_num)
 
void distributable_sensitivity_computation (const shared_ptr< BackProjectorByBin > &back_projector_sptr, const shared_ptr< DataSymmetriesForViewSegmentNumbers > &symmetries_sptr, DiscretisedDensity< 3, float > &sensitivity, const DiscretisedDensity< 3, float > &input_image, const shared_ptr< ProjData > &proj_dat, int subset_num, int num_subsets, int min_segment, int max_segment, bool zero_seg0_end_planes, double *log_likelihood_ptr, shared_ptr< ProjData > const &additive_binwise_correction, shared_ptr< BinNormalisation > const &normalisation_sptr, const double start_time_of_frame, const double end_time_of_frame, DistributedCachingInformation *caching_info_ptr, int min_timing_pos_num, int max_timing_pos_num)
 
template<bool add_sensitivity>
void RPC_process_related_viewgrams_gradient (const shared_ptr< ForwardProjectorByBin > &forward_projector_sptr, const shared_ptr< BackProjectorByBin > &back_projector_sptr, RelatedViewgrams< float > *measured_viewgrams_ptr, int &count, int &count2, double *log_likelihood_ptr, const RelatedViewgrams< float > *additive_binwise_correction_ptr, const RelatedViewgrams< float > *mult_viewgrams_ptr)
 
void RPC_process_related_viewgrams_accumulate_loglikelihood (const shared_ptr< ForwardProjectorByBin > &forward_projector_sptr, const shared_ptr< BackProjectorByBin > &back_projector_sptr, RelatedViewgrams< float > *measured_viewgrams_ptr, int &count, int &count2, double *log_likelihood_ptr, const RelatedViewgrams< float > *additive_binwise_correction_ptr, const RelatedViewgrams< float > *mult_viewgrams_ptr)
 
void RPC_process_related_viewgrams_sensitivity_computation (const shared_ptr< ForwardProjectorByBin > &forward_projector_sptr, const shared_ptr< BackProjectorByBin > &back_projector_sptr, RelatedViewgrams< float > *measured_viewgrams_ptr, int &count, int &count2, double *log_likelihood_ptr, const RelatedViewgrams< float > *additive_binwise_correction_ptr, const RelatedViewgrams< float > *mult_viewgrams_ptr)
 
void do_segments (DiscretisedDensity< 3, float > &image, ProjData &proj_data_org, const int start_timing_num, const int end_timing_num, const int start_segment_num, const int end_segment_num, const int start_axial_pos_num, const int end_axial_pos_num, const int start_tang_pos_num, const int end_tang_pos_num, const int start_view, const int end_view, BackProjectorByBin *back_projector_ptr, bool fill_with_1)
 
template<typename T >
shared_ptr< T[]> vec_to_shared (std::vector< T > &v)
 
void set_Gaussian_filter_fwhm (SeparableCartesianMetzImageFilter< float > &filter, const float fwhm_z, const float fwhm_y, const float fwhm_x)
 
void michelogram (const ProjDataInfoCylindrical &proj_data_info)
 
std::vector< int > _calc_regularly_sampled_views_for_subset (int subset_n, int num_subsets, int num_views)
 
void update_comparison (SegmentByView< float > &input1, const SegmentByView< float > &input2, float &max_pos_error, float &max_neg_error, float &amplitude)
 
void do_math (enum options operation, SegmentByView< float > &sino1, SegmentByView< float > &sino2, float &accum_max, float &accum_min, float &accum_sum, bool accumulators_initialized)
 
void do_math (enum options operation, SegmentByView< float > &sino1, SegmentBySinogram< float > &seg_sinogram, float &accum_max, float &accum_min, float &accum_sum, bool accumulators_initialized, float scalar=0.0)
 
void make_buffer_header (const char *data_filename, const char *header_filename, ProjData &input_sino, int limit_segments, NumericType::Type output_type=NumericType::FLOAT)
 
void show_math_menu ()
 
float pos_indicate (float x)
 
shared_ptr< ProjDataask_proj_data (const char *const input_query)
 
template<typename STIRImageType >
STIRImageType * ask_image (const char *const input_query)
 
template<typename STIRImageType >
shared_ptr< OutputFileFormat< STIRImageType > > set_up_output_format (const std::string &filename)
 
Array< 3, float > extend_segment (const SegmentBySinogram< float > &segment, const int view_extension=5, const int axial_extension=5, const int tangential_extension=5)
 Extension of direct projection data. More...
 
Succeeded interpolate_projdata (ProjData &proj_data_out, const ProjData &proj_data_in, const BSpline::BSplineType spline_type, const bool remove_interleaving=false)
 Perform B-Splines Interpolation. More...
 
Succeeded interpolate_projdata (ProjData &proj_data_out, const ProjData &proj_data_in, const BasicCoordinate< 3, BSpline::BSplineType > &these_types, const bool remove_interleaving)
 
Functions for user input
bool ask (const std::string &prompt, bool default_value)
 A function to ask a yes/no question from the user. More...
 
string ask_string (const std::string &prompt, const std::string &default_value="")
 A function to ask a string from the user.
 
string ask_filename_with_extension (const std::string &prompt, const std::string &default_extension)
 Asks for a filename (appending an extension if none is provided). More...
 
char * ask_filename_with_extension (char *file_in_directory_name, const std::string &prompt, const std::string &default_extension)
 Asks for a filename (appending an extension if none is provided) and stores the string where file_in_directory_name points to. More...
 
template<class NUMBER >
NUMBER ask_num (const std::string &prompt, NUMBER minimum_value, NUMBER maximum_value, NUMBER default_value)
 A function to ask a number from the user. More...
 
template<class FSTREAM >
void ask_filename_and_open (FSTREAM &s, const std::string &prompt, const std::string &default_extension, std::ios::openmode mode, bool abort_if_failed)
 Asks for a filename (with default extension) and opens the stream s with mode giving the specifics. More...
 
template<class FSTREAM >
void ask_filename_and_open (FSTREAM &s, const std::string &prompt, const std::string &default_extension, std::ios::openmode mode)
 as above, but with default abort_if_failed = true
 
Functions for stream/file manipulations
FILE *& open_read_binary (FILE *&fptr, const std::string &name)
 opens a FILE for reading binary data. Calls error() when it does not succeed. More...
 
FILE *& open_write_binary (FILE *&fptr, const std::string &name)
 opens a FILE for writing binary data. Calls error() when it does not succeed. More...
 
void close_file (FILE *&fptr)
 closes a FILE without error checking. More...
 
streamsize find_remaining_size (std::istream &input)
 Find number of remaining characters in the stream. More...
 
void * read_stream_in_memory (std::istream &input, std::streamsize &file_size)
 reads data into memory, returning a pointer to the memory More...
 
template<class IFSTREAM >
IFSTREAM & open_read_binary (IFSTREAM &s, const std::string &name)
 opens a stream for reading binary data. Calls error() when it does not succeed. More...
 
template<class OFSTREAM >
OFSTREAM & open_write_binary (OFSTREAM &s, const std::string &name)
 opens a stream for writing binary data. Calls error() when it does not succeed. More...
 
template<class FSTREAM >
void close_file (FSTREAM &s)
 closes a stream without error checking. More...
 
Functions for filename manipulations

These functions work on different platforms, i.e. Unix, VAX, Windows. Also on older MacOS versions.

Warning
Functions that work on char* might be removed at some point.
const char * find_filename (const char *const filename_with_directory)
 return a pointer to the start of the filename (i.e. after directory specifications) More...
 
string::size_type find_pos_of_filename (const std::string &filename_with_directory)
 return the position of the start of the filename (i.e. after directory specifications) More...
 
string get_filename (const std::string &filename_with_directory)
 return a std::string containing only the filename (i.e. after directory specifications) More...
 
char * get_directory_name (char *directory_name, const char *const filename_with_directory)
 Copies the directory part from 'filename_with_directory' into 'directory_name' and returns the 'directory_name' pointer. More...
 
string get_directory_name (const std::string &filename_with_directory)
 Returns a string with the directory part from 'filename_with_directory'. More...
 
string::size_type find_pos_of_extension (const std::string &file_in_directory_name)
 find the position of the '.' of the extension More...
 
string & add_extension (std::string &file_in_directory_name, const std::string &extension)
 Append extension if none present.
 
string & replace_extension (std::string &file_in_directory_name, const std::string &extension)
 Replace extension (or append if none present)
 
bool is_absolute_pathname (const char *const filename_with_directory)
 Checks if the filename points to an absolute location, or is a relative (e.g. to current directory) pathname.
 
bool is_absolute_pathname (const std::string &filename_with_directory)
 Checks if the filename points to an absolute location, or is a relative (e.g. to current directory) pathname.
 
char * prepend_directory_name (char *filename_with_directory, const char *const directory_name)
 Prepend directory_name to the filename, but only if !is_absolute_pathname(filename_with_directory) More...
 
Functions for interpolating data to new pixel/bin sizes
void zoom_viewgrams (RelatedViewgrams< float > &viewgrams, const float zoom, const int min_tang_pos_num, const int max_tang_pos_num, const float x_offset_in_mm=0, const float y_offset_in_mm=0)
 zoom a RelatedViewgrams object, replacing it with the new data More...
 
void zoom_viewgram (Viewgram< float > &viewgram, const float zoom, const int min_tang_pos_num, const int max_tang_pos_num, const float x_offset_in_mm=0, const float y_offset_in_mm=0)
 zoom viewgram, replacing it with the new data More...
 
void zoom_viewgram (Viewgram< float > &out_viewgram, const Viewgram< float > &in_viewgram, const float x_offset_in_mm=0, const float y_offset_in_mm=0)
 zoom in_viewgram, replacing out_viewgram with the new data More...
 
void zoom_image_in_place (VoxelsOnCartesianGrid< float > &image, const float zoom, const float x_offset_in_mm, const float y_offset_in_mm, const int new_size, const ZoomOptions=ZoomOptions::preserve_sum)
 zoom image, replacing the first argument with the new data More...
 
VoxelsOnCartesianGrid< float > zoom_image (const VoxelsOnCartesianGrid< float > &image, const float zoom, const float x_offset_in_mm, const float y_offset_in_mm, const int new_size, const ZoomOptions=ZoomOptions::preserve_sum)
 zoom image, replacing the first argument with the new data More...
 
void zoom_image_in_place (VoxelsOnCartesianGrid< float > &image, const CartesianCoordinate3D< float > &zooms, const CartesianCoordinate3D< float > &offsets_in_mm, const BasicCoordinate< 3, int > &new_sizes, const ZoomOptions=ZoomOptions::preserve_sum)
 zoom image, replacing the first argument with the new data. Full 3D shifts and zooms. More...
 
VoxelsOnCartesianGrid< float > zoom_image (const VoxelsOnCartesianGrid< float > &image, const CartesianCoordinate3D< float > &zooms, const CartesianCoordinate3D< float > &offsets_in_mm, const BasicCoordinate< 3, int > &new_sizes, const ZoomOptions=ZoomOptions::preserve_sum)
 zoom image, returning the new image More...
 
void zoom_image (VoxelsOnCartesianGrid< float > &image_out, const VoxelsOnCartesianGrid< float > &image_in, const ZoomOptions=ZoomOptions::preserve_sum)
 zoom image_in according to dimensions, origin and voxel_size of image_out. More...
 
void zoom_image (PixelsOnCartesianGrid< float > &image2D_out, const PixelsOnCartesianGrid< float > &image2D_in, const ZoomOptions=ZoomOptions::preserve_sum)
 zoom image2D_in according to dimensions, origin and pixel_size of image2D_out. More...
 
Functions to compute ROI values

Shapes can be first discretised using Shape3D::construct_volume or a Shape3D parsed. This can make fuzzy boundaries (when the num_samples argument is not (1,1,1), or when DiscretisedShape3D needs zooming). Mean and stddev are computed using weighted versions, taking this smoothness into account, while ROI_min and max are ignore those weights.

void compute_ROI_values_per_plane (VectorWithOffset< ROIValues > &values, const DiscretisedDensity< 3, float > &density, const Shape3D &shape, const CartesianCoordinate3D< int > &num_samples)
 
void compute_ROI_values_per_plane (VectorWithOffset< ROIValues > &values, const DiscretisedDensity< 3, float > &density, const DiscretisedDensity< 3, float > &discretised_shape)
 
ROIValues compute_total_ROI_values (const VectorWithOffset< ROIValues > &values)
 
ROIValues compute_total_ROI_values (const DiscretisedDensity< 3, float > &image, const Shape3D &shape, const CartesianCoordinate3D< int > &num_samples)
 
ROIValues compute_total_ROI_values (const DiscretisedDensity< 3, float > &image, const DiscretisedDensity< 3, float > &discretised_shape)
 
void compute_plane_range_ROI_values_per_plane (VectorWithOffset< ROIValues > &values, const DiscretisedDensity< 3, float > &density, const CartesianCoordinate2D< int > &plane_range, const Shape3D &shape, const CartesianCoordinate3D< int > &num_samples)
 
float compute_CR_hot (ROIValues &val1, ROIValues &val2)
 
float compute_CR_cold (ROIValues &val1, ROIValues &val2)
 
float compute_uniformity (ROIValues &val)
 
VectorWithOffset< float > compute_CR_hot_per_plane (VectorWithOffset< ROIValues > &val1, VectorWithOffset< ROIValues > &val2)
 
VectorWithOffset< float > compute_CR_cold_per_plane (VectorWithOffset< ROIValues > &val1, VectorWithOffset< ROIValues > &val2)
 
VectorWithOffset< float > compute_uniformity_per_plane (VectorWithOffset< ROIValues > &val)
 
numerical operations for arrays of complex numbers
template<int num_dimensions, typename elemT >
Array< num_dimensions, std::complex< elemT > > & operator*= (Array< num_dimensions, std::complex< elemT >> &lhs, const elemT &rhs)
 
template<int num_dimensions, typename elemT >
Array< num_dimensions, std::complex< elemT > > & operator/= (Array< num_dimensions, std::complex< elemT >> &lhs, const elemT &rhs)
 
template<int num_dimensions, typename elemT >
Array< num_dimensions, std::complex< elemT > > & operator+= (Array< num_dimensions, std::complex< elemT >> &lhs, const elemT &rhs)
 
template<int num_dimensions, typename elemT >
Array< num_dimensions, std::complex< elemT > > & operator-= (Array< num_dimensions, std::complex< elemT >> &lhs, const elemT &rhs)
 
void assign (std::complex< double > &x, const int y)
 
void assign (std::complex< float > &x, const int y)
 
template<int num_dimensions, int num_dimensions2, typename elemT >
const Array< num_dimensions - num_dimensions2, elemT > & get (const Array< num_dimensions, elemT > &a, const BasicCoordinate< num_dimensions2, int > &c)
 an alternative for array indexing using BasicCoordinate objects More...
 
template<int num_dimensions, typename elemT >
const elemT & get (const Array< num_dimensions, elemT > &a, const BasicCoordinate< num_dimensions, int > &c)
 an alternative for array indexing using BasicCoordinate objects More...
 
template<int num_dimensions, typename T >
BasicCoordinate< num_dimensions, int > get_min_indices (const Array< num_dimensions, T > &a)
 Get the first multi-dimensional index of the array. More...
 
template<int num_dimensions, typename T , int num_dimensions2>
bool next (BasicCoordinate< num_dimensions, int > &indices, const Array< num_dimensions2, T > &a)
 Given an index into an array, increment it to the next one. More...
 
templated functions for assigning values

When writing templated code, it is sometimes not possible to use operator=() for assignment, e.g. when the classes do not support that operator. The assign template tries to alleviate this problem by providing several overloads when the first argument is a (STIR) container.

Usage
assign(x,y); // logically equivalent to x=y;
Design consideration
We could have overloaded operator=() instead, but that would probably lead to surprising conversions.
template<class T , class T2 >
void assign (T &x, const T2 &y)
 
template<class T , class T2 >
void assign (std::vector< T > &v, const T2 &y)
 
template<int num_dimensions, class T , class T2 >
void assign (BasicCoordinate< num_dimensions, T > &v, const T2 &y)
 
template<class T , class T2 >
void assign (VectorWithOffset< T > &v, const T2 &y)
 
template<int num_dimensions, class T , class T2 >
void assign (Array< num_dimensions, T > &v, const T2 &y)
 
void assign (double &x, const int y)
 
void assign (float &x, const int y)
 
Utility functions to make BasicCoordinate objects.
Warning
Because of template rules of C++, all arguments of the make_coordinate function have to have exactly the same type. For instance,
const BasicCoordinate<3,float> a = make_coordinate(1.F,2.F,0.F);
template<class T >
BasicCoordinate< 1, T > make_coordinate (const T &a1)
 
template<class T >
BasicCoordinate< 2, T > make_coordinate (const T &a1, const T &a2)
 
template<class T >
BasicCoordinate< 3, T > make_coordinate (const T &a1, const T &a2, const T &a3)
 
template<class T >
BasicCoordinate< 4, T > make_coordinate (const T &a1, const T &a2, const T &a3, const T &a4)
 
template<class T >
BasicCoordinate< 5, T > make_coordinate (const T &a1, const T &a2, const T &a3, const T &a4, const T &a5)
 
template<class T >
BasicCoordinate< 6, T > make_coordinate (const T &a1, const T &a2, const T &a3, const T &a4, const T &a5, const T &a6)
 
testing of (smart) pointers

A utility function that checks if an ordinary or smart pointer is null with identical syntax for all types.

template<typename T >
bool is_null_ptr (T const *const ptr)
 
template<typename T >
bool is_null_ptr (shared_ptr< T > const &sptr)
 
template<typename T >
bool is_null_ptr (unique_ptr< T > const &aptr)
 
bool is_null_ptr (const std::nullptr_t)
 
Functions for modulo computations
double modulo (const double a, const double b)
 Like std::fmod() but with guaranteed nonnegative result. More...
 
float modulo (const float a, const float b)
 modulo for floats More...
 
int modulo (const int a, const int b)
 Like the normal modulus operator (%) but with guaranteed nonnegative result. More...
 
template<int num_dimensions, typename T >
BasicCoordinate< num_dimensions, T > modulo (const BasicCoordinate< num_dimensions, T > &a, const BasicCoordinate< num_dimensions, T > &b)
 Performs the modulus operation on each element of the coordinates. More...
 
template<typename FloatOrDouble >
FloatOrDouble from_min_pi_plus_pi_to_0_2pi (const FloatOrDouble phi)
 A function to convert an angle from one range to another. More...
 
template<typename FloatOrDouble >
FloatOrDouble to_0_2pi (const FloatOrDouble phi)
 Convert angle to standard range. More...
 
A collection of error functions.

The erf() is a high precision implementation of the error function. The erfc() is the complementary of the erf(), which should be equal to 1-erf(), but with higher precision when erf is close to 1.

Todo:
replace with boost::erf
double erf (double)
 
double erfc (double)
 
functions specific for 1D Arrays
template<class elemT >
elemT inner_product (const Array< 1, elemT > &v1, const Array< 1, elemT > &v2)
 Inner product of 2 1D arrays. More...
 
template<class elemT >
double angle (const Array< 1, elemT > &v1, const Array< 1, elemT > &v2)
 angle between 2 1D arrays
 
functions for matrices
template<class elemT >
Array< 1, elemT > matrix_multiply (const Array< 2, elemT > &m, const Array< 1, elemT > &vec)
 matrix with vector multiplication More...
 
template<int dimension, class elemT >
BasicCoordinate< dimension, elemT > matrix_multiply (const Array< 2, elemT > &m, const BasicCoordinate< dimension, elemT > &vec)
 matrix multiplication with vector (given as BasicCoordinate) More...
 
template<class elemT >
Array< 2, elemT > matrix_multiply (const Array< 2, elemT > &m1, const Array< 2, elemT > &m2)
 matrix multiplication More...
 
template<class elemT >
Array< 2, elemT > matrix_transpose (const Array< 2, elemT > &m)
 matrix transposition
 
template<class elemT >
Array< 2, elemT > diagonal_matrix (const unsigned dimension, const elemT value)
 construct a diagonal matrix with all elements on the diagonal equal More...
 
template<int dimension, class elemT >
Array< 2, elemT > diagonal_matrix (const BasicCoordinate< dimension, elemT > &values)
 construct a diagonal matrix More...
 
Functions to compute the norm
template<typename elemT >
double norm_squared (const elemT t)
 Returns the square of the norm of a number. More...
 
template<typename elemT >
double norm (const elemT t)
 Returns the norm of a number. More...
 
double norm (const double t)
 
double norm (const float t)
 
template<class Iter >
double norm_squared (Iter begin, Iter end)
 Returns the square of the l2-norm of a sequence. More...
 
template<class Iter >
double norm (Iter begin, Iter end)
 Returns the l2-norm of a sequence. More...
 
template<class elemT >
double norm (const Array< 1, elemT > &v1)
 l2 norm of a 1D array More...
 
template<class elemT >
double norm_squared (const Array< 1, elemT > &v1)
 square of the l2 norm of a 1D array More...
 
functions to convert from data in Numerical Recipes format to STIR arrays.
void stir_to_nr (const VectorWithOffset< std::complex< float >> &c, VectorWithOffset< float > &nr_data)
 
void stir_to_nr (const Array< 2, std::complex< float >> &c2d, VectorWithOffset< float > &nr_data)
 
void stir_to_nr (const VectorWithOffset< Array< 1, std::complex< float >>> &c2d, VectorWithOffset< float > &nr_data)
 
void nr_to_stir (const VectorWithOffset< float > &nr_data, VectorWithOffset< std::complex< float >> &c)
 
void nr_to_stir (const VectorWithOffset< float > &nr_data, Array< 2, std::complex< float >> &c2d)
 
void nr_to_stir (const VectorWithOffset< float > &nr_data, VectorWithOffset< Array< 1, std::complex< float >>> &c2d)
 
int distributable_main (int argc, char **argv)
 
void distributable_computation_cache_enabled (const shared_ptr< ForwardProjectorByBin > &forward_projector_ptr, const shared_ptr< BackProjectorByBin > &back_projector_ptr, const shared_ptr< DataSymmetriesForViewSegmentNumbers > &symmetries_ptr, DiscretisedDensity< 3, float > *output_image_ptr, const DiscretisedDensity< 3, float > *input_image_ptr, const shared_ptr< ProjData > &proj_data_sptr, const bool read_from_proj_data, int subset_num, int num_subsets, int min_segment_num, int max_segment_num, bool zero_seg0_end_planes, double *double_out_ptr, const shared_ptr< ProjData > &additive_binwise_correction, const shared_ptr< BinNormalisation > normalise_sptr, const double start_time_of_frame, const double end_time_of_frame, RPC_process_related_viewgrams_type *RPC_process_related_viewgrams, DistributedCachingInformation *caching_info_ptr, int min_timing_pos_num, int max_timing_pos_num)
 This function essentially implements a loop over segments and all views in the current subset in the parallel case. More...
 
void test_image_estimate (shared_ptr< stir::DiscretisedDensity< 3, float >> input_image_ptr)
 
Functions for rounding floating point numbers
int round (const float x)
 Implements rounding of floating point numbers. More...
 
int round (const double x)
 Implements rounding of double numbers. More...
 
template<int num_dimensions, class elemT >
BasicCoordinate< num_dimensions, int > round (const BasicCoordinate< num_dimensions, elemT > &x)
 Implements rounding of a BasicCoordinate object. More...
 
template<typename integerT >
void round_to (integerT &result, const float x)
 Implements rounding of floating point numbers to other integer types. More...
 
template<int num_dimensions, class integerT , class elemT >
void round_to (BasicCoordinate< num_dimensions, integerT > &result, const BasicCoordinate< num_dimensions, elemT > &x)
 Implements rounding of a BasicCoordinate object to other integer types. More...
 
Functions for thresholding numbers and sequences
template<typename forw_iterT , typename elemT >
void threshold_upper_lower (forw_iterT begin, forw_iterT end, const elemT new_min, const elemT new_max)
 Threshold a sequence from above and below. More...
 
template<typename forw_iterT , typename elemT >
void threshold_upper (forw_iterT begin, forw_iterT end, const elemT new_max)
 Threshold a sequence from above. More...
 
template<typename forw_iterT , typename elemT >
void threshold_lower (forw_iterT begin, forw_iterT end, const elemT new_min)
 Threshold a sequence from below. More...
 
template<typename ForwardIter_t , typename elemT >
void threshold_min_to_small_positive_value (ForwardIter_t begin, ForwardIter_t end, const elemT &small_number)
 sets non-positive values in the sequence to small positive ones More...
 

Variables

const int LINE_ERROR = -1
 
const int LINE_OK = 0
 
const float SMALL_NUM = 0.000001F
 
const float ZERO_TOL = 0.000001F
 
const double TPI = 6.28318530717958647692
 
const double MAX_INTERVAL_DIFFERENCE = 0.05
 
template DAVArrayFilter3D< float >
 
template DAVImageFilter3D< float >
 
template ModifiedInverseAveragingImageFilterAll< float >
 
template ModifiedInverseAverigingArrayFilter< 3, float >
 
template ModifiedInverseAverigingImageFilter< float >
 
template NonseparableSpatiallyVaryingFilters< float >
 
template NonseparableSpatiallyVaryingFilters3D< float >
 
template SeparableLowPassArrayFilter< 3, float >
 
template SeparableLowPassImageFilter< float >
 
const int FORWARDFFT = 1
 
const int INVERSEFFT = -1
 
constexpr double speed_of_light_in_mm_per_ps = 0.299792458
 Define the speed of light in mm / ps.
 
constexpr double speed_of_light_in_mm_per_ps_div2 = speed_of_light_in_mm_per_ps * 0.5
 This ratio is used often.
 
const int 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&)
 
constexpr float max_quotient = 10000.F
 
const int rim_truncation_sino = 0
 
const float cache_init_value = -1234567.89E10F
 
Task-ids currently understood by stir::DistributedWorker
const int task_stop_processing = 0
 
const int task_setup_distributable_computation = 200
 
const int task_do_distributable_gradient_computation = 42
 
const int task_do_distributable_loglikelihood_computation = 43
 
const int task_do_distributable_sensitivity_computation = 44
 
Tag-names currently used by stir::distributable_computation and related functions
const int AVAILABLE_NOTIFICATION_TAG = 2
 
const int END_ITERATION_TAG = 3
 
const int END_RECONSTRUCTION_TAG = 4
 
const int END_NOTIFICATION_TAG = 5
 
const int BINWISE_CORRECTION_TAG = 6
 
const int BINWISE_MULT_TAG = 66
 
const int REUSE_VIEWGRAM_TAG = 10
 
const int NEW_VIEWGRAM_TAG = 11
 
const int USE_DOUBLE_ARG_TAG = 70
 
const int USE_OUTPUT_IMAGE_ARG_TAG = 71
 

Detailed Description

Namespace for the STIR library (and some/most of its applications)

Test class for exporting and importing ProjData as arrays.

Addition for SAFIR listmode input file format.

Declaration of class stir::DistributedCachingInformation.

A class in that reads the radionuclide information from a Json file.

implementation of stir::sample_function_on_regular_grid and stir::sample_function_using_index_converter

This namespace encompasses the whole library. All classes, functions and symbols are in this namespace. This has the effect that conflicts with any other library is impossible (except if that library uses the same namespace...).

Author
Kris Thielemans
Charalampos Tsoumpas
Markus Jehl

Values for half life branching ratio are taken from: http://www.lnhb.fr/donnees-nucleaires/donnees-nucleaires-tableau/

The class also supports using "aliases" for radionuclide names. This is useful as different manufacturers use different conventions.

STIR comes with a default database and lookup table. The database uses DICOM conventions for the names. The lookup table provides alternatives for GE and Siemens (in STIR 5.0).

Format of the radionuclide database

This file is in JSON format. An example is distributed with STIR, a brief extract follows

{
    "nuclides": [

        {
            "name":  "^18^Fluorine",
            "decays": [
                {  "modality": "PET",
                   "keV": 511,
                   "branching_ratio": 0.9686,
                   "half_life": 6584.04
                }
            ]
        },
        {
            "name": "^99m^Technetium",
            "decays": [
                {  "modality": "nucmed",
                   "keV": 140.511,
                   "branching_ratio": 0.885,
                   "half_life": 21624.12
                }
            ]

        },
      # more entries like the above
   ]
}
Format of the radionuclide name look-up database

This file is in JSON format. An example is distributed with STIR, a brief extract follows

[
     [ "^18^Fluorine", "18F", "F-18" ],
     [ "^11^Carbon", "11C", "C-11" ]
]

The first name is the one that will be used to find an entry in the radionuclide database.

Note that both files need to have the same number of radionuclides..

Author
Tobias Beisel
Kris Thielemans

Addition for ROOT support - Nikos Efthimiou

Author
Nikos Efthimiou
Kris Thielemans

Typedef Documentation

◆ AxTangPosNumbers

AxTangPosNumbers as a class that provides the 2 remaining coordinates for a Bin, aside from ViewSegmentNumbers.

TODO? something more sofisticated than a typedef

Function Documentation

◆ standardise_interfile_keyword()

std::string stir::standardise_interfile_keyword ( const std::string &  keyword)

Put a (Interfile) keyword into a standard form.

This follows Interfile 3.3 conventions:

  • The characters space, tab, underscore, ! are all treated as white space.
  • Starting and trailing white space is trimmed.
  • Repeated white space is replaced with a single space
  • All letters are made lowercase.

Referenced by stir::SAFIRCListmodeInputFileFormat< EventDataType >::can_read(), DICOM_date_time_to_DT(), DICOM_datetime_to_secs_since_Unix_epoch(), stir::ImagingModality::get_name(), stir::Scanner::get_scanner_from_name(), Interfile_datetime_to_DICOM(), is_interfile_signature(), stir::ProjMatrixByBinFromFile::ProjMatrixByBinFromFile(), and stir::KeyParser::standardise_keyword().

◆ ask()

bool stir::ask ( const std::string &  prompt,
bool  default_value 
)

A function to ask a yes/no question from the user.

Parameters
prompta text string which is supposed to be a question
default_valueWhen set to true , the default is Yes.

The question is currently presented as

prompt [Y/N D:default_value]:

Simply pressing 'enter' will select the default value. Otherwise, the first charachter of the response will be checked against y/Y/n/N to determine the return value. If it is none of these, the question will be asked again.

Referenced by stir::ProjDataInfo::ask_parameters(), stir::OSSPSReconstruction< TargetT >::ask_parameters(), stir::OSMAPOSLReconstruction< TargetT >::ask_parameters(), stir::IterativeReconstruction< TargetT >::ask_parameters(), stir::VoxelsOnCartesianGrid< elemT >::grow_z_range(), stir::Scanner::list_names(), and stir::ProjDataFromStream::set_segment().

◆ open_read_binary() [1/2]

FILE *& stir::open_read_binary ( FILE *&  fptr,
const std::string &  name 
)

◆ open_write_binary() [1/2]

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.

Warning
probably does not work if you are not in the C-locale

References error().

Referenced by stir::ProjMatrixByBin::get_cached_proj_matrix_elems_for_one_bin().

◆ close_file() [1/2]

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.

◆ find_filename()

const char * stir::find_filename ( const char *const  filename_with_directory)

return a pointer to the start of the filename (i.e. after directory specifications)

The returned pointer is between filename_with_directory and (filename_with_directory+strlen(filename_with_directory)+1). This highest value is used when it looks like a directory name.

Deprecated:
use find_pos_of_filename()
Warning
This function works only with string manipulations. There is no check if the 'filename' part actually corresponds to a directory on disk.

Referenced by add_extension(), find_pos_of_extension(), get_directory_name(), stir::FilenameTests::run_tests(), stir::ecat::ecat7::write_basic_interfile_header_for_ECAT7(), and write_basic_interfile_PDFS_header().

◆ find_pos_of_filename()

std::string::size_type stir::find_pos_of_filename ( const std::string &  filename_with_directory)

return the position of the start of the filename (i.e. after directory specifications)

The returned number is between 0 and filename_with_directory.size()+1. This highest value is used when it's a directory name.

Warning
This function works only with string manipulations. There is no check if the 'filename' part actually corresponds to a directory on disk.

Referenced by find_pos_of_extension(), get_directory_name(), get_filename(), and stir::FilenameTests::run_tests().

◆ get_filename()

std::string stir::get_filename ( const std::string &  filename_with_directory)

return a std::string containing only the filename (i.e. after directory specifications)

Warning
This function works only with string manipulations. There is no check if the 'filename' part actually corresponds to a directory on disk.

References find_pos_of_filename().

Referenced by stir::FilePath::get_filename_no_extension(), and stir::RigidObject3DMotionFromPolaris::synchronise().

◆ get_directory_name() [1/2]

char * stir::get_directory_name ( char *  directory_name,
const char *const  filename_with_directory 
)

Copies the directory part from 'filename_with_directory' into 'directory_name' and returns the 'directory_name' pointer.

Warning
This function works only with string manipulations. There is no check if the 'filename' part actually corresponds to a directory on disk.
assumes that directory_name points to enough allocated space
Deprecated:
Use get_directory_name(const std::string&)

References find_filename().

Referenced by stir::ecat::CListModeDataECAT8_32bit::get_empty_record_sptr(), read_interfile_dynamic_image(), read_interfile_image(), read_interfile_parametric_image(), stir::FilenameTests::run_tests(), and stir::ecat::BinNormalisationFromECAT8::set_up().

◆ get_directory_name() [2/2]

std::string stir::get_directory_name ( const std::string &  filename_with_directory)

Returns a string with the directory part from 'filename_with_directory'.

If there was no directory information present, the return value is the string "." (i.e. the current directory). (It was the empty string prior to STIR 3.0).

Warning
This function works only with string manipulations. There is no check if the 'filename' part actually corresponds to a directory on disk.

References find_pos_of_filename().

◆ find_pos_of_extension()

std::string::size_type stir::find_pos_of_extension ( const std::string &  file_in_directory_name)

◆ prepend_directory_name()

char * stir::prepend_directory_name ( char *  filename_with_directory,
const char *const  directory_name 
)

Prepend directory_name to the filename, but only if !is_absolute_pathname(filename_with_directory)

If necessary, a directory separator is inserted. If 'directory_name' == 0, nothing happens.

Returns
a pointer to the start of the new filename
Warning
this function assumes that filename_with_directory points to sufficient allocated space to contain the new string.

References is_absolute_pathname().

Referenced by stir::ecat::CListModeDataECAT8_32bit::get_empty_record_sptr(), stir::FilenameTests::run_tests(), and stir::ecat::BinNormalisationFromECAT8::set_up().

◆ ask_filename_with_extension() [1/2]

std::string stir::ask_filename_with_extension ( const std::string &  prompt,
const std::string &  default_extension 
)

Asks for a filename (appending an extension if none is provided).

Example:

std::string filename =
ask_filename_with_extension("Input file name ?", ".img");
Warning
starting or ending spaces are NOT stripped.

References add_extension().

Referenced by stir::OSSPSReconstruction< TargetT >::ask_parameters(), stir::IterativeReconstruction< TargetT >::ask_parameters(), stir::AnalyticReconstruction::initialise_keymap(), and stir::ProjDataFromStream::set_segment().

◆ ask_filename_with_extension() [2/2]

char * stir::ask_filename_with_extension ( char *  file_in_directory_name,
const std::string &  prompt,
const std::string &  default_extension 
)

Asks for a filename (appending an extension if none is provided) and stores the string where file_in_directory_name points to.

Deprecated:
Use ask_filename_with_extension(const std::string&, const std::string&);

Example:

char filename[max_filename_length];
ask_filename_with_extension(filename, "Input file name ?", ".img");
Warning
file_in_directory_name has to be preallocated (with size max_filename_length)
starting or ending spaces are NOT stripped.

◆ find_remaining_size()

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.

Warning
Works only properly for binary streams.

Referenced by ask_filename_and_open(), stir::VoxelsOnCartesianGrid< elemT >::grow_z_range(), and stir::ProjDataFromStream::set_segment().

◆ zoom_viewgrams()

void stir::zoom_viewgrams ( RelatedViewgrams< float > &  viewgrams,
const float  zoom,
const int  min_tang_pos_num,
const int  max_tang_pos_num,
const float  x_offset_in_mm = 0,
const float  y_offset_in_mm = 0 
)

◆ zoom_viewgram() [1/2]

void stir::zoom_viewgram ( Viewgram< float > &  viewgram,
const float  zoom,
const int  min_tang_pos_num,
const int  max_tang_pos_num,
const float  x_offset_in_mm = 0,
const float  y_offset_in_mm = 0 
)

◆ zoom_viewgram() [2/2]

void stir::zoom_viewgram ( Viewgram< float > &  out_viewgram,
const Viewgram< float > &  in_viewgram,
const float  x_offset_in_mm = 0,
const float  y_offset_in_mm = 0 
)

zoom in_viewgram, replacing out_viewgram with the new data

This version of zoom_viewgram gets the info on the new sizes, sampling etc. from out_viewgram.

See also
zoom.h for parameter info

References stir::Viewgram< elemT >::get_max_axial_pos_num(), stir::Viewgram< elemT >::get_min_axial_pos_num(), stir::Viewgram< elemT >::get_proj_data_info_sptr(), stir::Viewgram< elemT >::get_segment_num(), stir::Viewgram< elemT >::get_timing_pos_num(), and stir::Viewgram< elemT >::get_view_num().

Referenced by zoom_viewgram(), and zoom_viewgrams().

◆ zoom_image_in_place() [1/2]

void stir::zoom_image_in_place ( VoxelsOnCartesianGrid< float > &  image,
const float  zoom,
const float  x_offset_in_mm,
const float  y_offset_in_mm,
const int  new_size,
const ZoomOptions  = ZoomOptions::preserve_sum 
)

zoom image, replacing the first argument with the new data

See also
zoom.h for parameter info

References zoom_image().

◆ zoom_image() [1/4]

VoxelsOnCartesianGrid< float > stir::zoom_image ( const VoxelsOnCartesianGrid< float > &  image,
const float  zoom,
const float  x_offset_in_mm,
const float  y_offset_in_mm,
const int  new_size,
const ZoomOptions  = ZoomOptions::preserve_sum 
)

◆ zoom_image_in_place() [2/2]

void stir::zoom_image_in_place ( VoxelsOnCartesianGrid< float > &  image,
const CartesianCoordinate3D< float > &  zooms,
const CartesianCoordinate3D< float > &  offsets_in_mm,
const BasicCoordinate< 3, int > &  new_sizes,
const ZoomOptions  = ZoomOptions::preserve_sum 
)

zoom image, replacing the first argument with the new data. Full 3D shifts and zooms.

See also
zoom.h for parameter info.

Zooming is done such that the physical coordinates of a point (as returned by DiscretisedDensity<3,float>::get_physical_coordinates_for_indices) remain the same.

The index range of the new image is according to the standard STIR conventions (z starts from 0, but x and y from -(new_size/2)). The origin is then chosen such that the geometric centres of the images satisfy

offsets_in_mm == new_middle - old_middle

The geometric centre is determined by the average of the physical coordinates of the min and max indices.

Warning
: For even-sized images, this convention can lead to somewhat non-intuitive results (half-pixel shifts etc).

References zoom_image().

◆ zoom_image() [2/4]

VoxelsOnCartesianGrid< float > stir::zoom_image ( const VoxelsOnCartesianGrid< float > &  image,
const CartesianCoordinate3D< float > &  zooms,
const CartesianCoordinate3D< float > &  offsets_in_mm,
const BasicCoordinate< 3, int > &  new_sizes,
const ZoomOptions  = ZoomOptions::preserve_sum 
)

zoom image, returning the new image

See also
zoom.h for parameter info
zoom_image_in_place

◆ zoom_image() [3/4]

void stir::zoom_image ( VoxelsOnCartesianGrid< float > &  image_out,
const VoxelsOnCartesianGrid< float > &  image_in,
const ZoomOptions  = ZoomOptions::preserve_sum 
)

zoom image_in according to dimensions, origin and voxel_size of image_out.

See also
zoom.h for parameter info

Zooming is done such that the physical coordinates of a point (as returned by DiscretisedDensity<3,float>::get_physical_coordinates_for_indices) remain the same.

The code also provides for three possible rescaling options: (i) preserving the image values: should be used when zooming an attenuation image (ii) preserving the image projectors: should be used when zooming an activity image (iii) preserving the image sum: default

References stir::ExamData::set_exam_info().

◆ zoom_image() [4/4]

void stir::zoom_image ( PixelsOnCartesianGrid< float > &  image2D_out,
const PixelsOnCartesianGrid< float > &  image2D_in,
const ZoomOptions  = ZoomOptions::preserve_sum 
)

zoom image2D_in according to dimensions, origin and pixel_size of image2D_out.

See also
zoom.h for parameter info

References stir::DiscretisedDensity< num_dimensions, elemT >::get_origin(), stir::PixelsOnCartesianGrid< elemT >::get_pixel_size(), overlap_interpolate(), and stir::ExamData::set_exam_info().

Referenced by zoom_image_in_place().

◆ get() [1/2]

template<int num_dimensions, int num_dimensions2, typename elemT >
const Array< num_dimensions - num_dimensions2, elemT > & stir::get ( const Array< num_dimensions, elemT > &  a,
const BasicCoordinate< num_dimensions2, int > &  c 
)
inline

an alternative for array indexing using BasicCoordinate objects

Case where the index has lower dimension than the array

References cut_first_dimension().

Referenced by info(), and warning().

◆ get() [2/2]

template<int num_dimensions, typename elemT >
const elemT & stir::get ( const Array< num_dimensions, elemT > &  a,
const BasicCoordinate< num_dimensions, int > &  c 
)
inline

an alternative for array indexing using BasicCoordinate objects

Case where the index has the same dimension as the array

◆ get_min_indices()

template<int num_dimensions, typename T >
BasicCoordinate< num_dimensions, int > stir::get_min_indices ( const Array< num_dimensions, T > &  a)
inline

Get the first multi-dimensional index of the array.

Todo:
If the array
  • a is empty, we return an object where all indices are 0. It would be better to throw an exception.

◆ next()

template<int num_dimensions, typename T , int num_dimensions2>
bool stir::next ( BasicCoordinate< num_dimensions, int > &  indices,
const Array< num_dimensions2, T > &  a 
)
inline

Given an index into an array, increment it to the next one.

Returns
true if the next index was still within the array, false otherwise

This can be used to iterate through an array using code such as

Array<num_dimensions2, T> array = ...;
BasicCoordinate<num_dimensions, int> indices =
do
{ something with indices }
while (next(indices, array));
Warning
The above loop will fail for empty arrays

◆ display() [1/2]

template<class elemT >
void stir::display ( const Array< 3, elemT > &  plane_stack,
double  maxi,
const char *const  title,
int  zoom 
)
inline
See also
Display functions(const Array<3,elemT>&, const VectorWithOffset<scaleT>& , const VectorWithOffset<CHARP>& , double, const char * const , int zoom) for more info. This function sets the 'text' parameter to a sequence of numbers.

◆ display() [2/2]

template<class elemT >
void stir::display ( const Array< 2, elemT > &  plane,
const char *const  text,
double  maxi,
int  zoom 
)
inline
See also
Display functions(const Array<3,elemT>&, const VectorWithOffset<scaleT>& , const VectorWithOffset<CHARP>& , double, const char * const , int zoom) for more info.

◆ index_at_maximum()

template<class elemT >
int stir::index_at_maximum ( const VectorWithOffset< elemT > &  v)

Finds the index where the maximum occurs in a (1-dimensional) vector.

If the maximum occurs more than once, the smallest index is returned.

If the vector is empty, the function returns 0.

Todo:
make iterator version, or something that works on std::vector

◆ indices_at_maximum()

template<class elemT >
BasicCoordinate<3, int> stir::indices_at_maximum ( const Array< 3, elemT > &  input_array)

Finds the first (3-dimensional) index where the maximum occurs in a (3-dimensional) array.

Todo:

generalise to arbitrary dimensions

implementation currently cycles through the data twice

References stir::Array< num_dimensions, elemT >::find_max(), stir::VectorWithOffset< T >::get_max_index(), and stir::VectorWithOffset< T >::get_min_index().

Referenced by maximum_location_per_slice(), and stir::MatchTrackerAndScanner::run().

◆ modulo() [1/4]

double stir::modulo ( const double  a,
const double  b 
)
inline

Like std::fmod() but with guaranteed nonnegative result.

std::fmod(a,b) return a number of the same sign as a. This is often inconvenient as the result of this is that the range of std::fmod(a,b) is from -fabs(b) to +fabs(b).

In contrast, modulo(a,b) always returns a nonnegative result. To be precise:

modulo(a,b) returns the value a-i*b, for the integer i such that, if b is nonzero, the result is greater or equal to 0 and less than the magnitude of b.

Error handling (i.e. b=0) is as for std::fmod().

Warning
When assigning the result to a float, the implied rounding might give you float which is (a tiny bit) larger than fabs(b).

Referenced by stir::ProjDataInfoCylindricalNoArcCorr::find_scanner_coordinates_given_cartesian_coordinates(), and stir::ProjDataInfoCylindricalNoArcCorr::get_bin().

◆ modulo() [2/4]

float stir::modulo ( const float  a,
const float  b 
)
inline

modulo for floats

See also
modulo(double,double) The reason for this function is that rounding from double to float might make the result of the calculation with doubles larger than b.
Warning
Because of C++ promotion of floats to doubles, it is very easy to call the modulo(double,double) version inadvertently. So, you should probably not rely too much on the result being less than b.

References modulo().

◆ modulo() [3/4]

int stir::modulo ( const int  a,
const int  b 
)
inline

Like the normal modulus operator (%) but with guaranteed nonnegative result.

Result will be larger than or equal to 0, and (strictly) smaller than abs(b).

◆ modulo() [4/4]

template<int num_dimensions, typename T >
BasicCoordinate<num_dimensions, T> stir::modulo ( const BasicCoordinate< num_dimensions, T > &  a,
const BasicCoordinate< num_dimensions, T > &  b 
)
inline

Performs the modulus operation on each element of the coordinates.

Returns
A BasicCoordinate such that for all d
result[d] = modulo(a[d], b[d]

Referenced by modulo(), and to_0_2pi().

◆ from_min_pi_plus_pi_to_0_2pi()

template<typename FloatOrDouble >
FloatOrDouble stir::from_min_pi_plus_pi_to_0_2pi ( const FloatOrDouble  phi)
inline

A function to convert an angle from one range to another.

This is mainly useful for converting results from e.g. std::atan2 to a range $[0,2\pi)$.

References _PI.

Referenced by stir::LORAs2Points< float >::change_representation_for_block(), find_LOR_intersections_with_cylinder(), and stir::DetectorCoordinateMap::set_detector_map().

◆ to_0_2pi()

template<typename FloatOrDouble >
FloatOrDouble stir::to_0_2pi ( const FloatOrDouble  phi)
inline

◆ fill_from()

template<typename iterT >
void stir::fill_from ( MultipleProjData &  stir_object,
iterT  iter,
iterT   
)

set all elements of a MultipleProjData from an iterator

Implementation that resorts to MultipleProjData::fill_from

Warning
there is no size/range-check on iter

◆ matrix_multiply() [1/3]

template<class elemT >
Array< 1, elemT > stir::matrix_multiply ( const Array< 2, elemT > &  m,
const Array< 1, elemT > &  vec 
)
inline

matrix with vector multiplication

Index ranges have to be compatible (checked with assert).

Referenced by absolute_max_eigenvector_using_power_method(), stir::RigidObject3DTransformation::transform_point(), and stir::Shape3DWithOrientation::transform_to_shape_coords().

◆ matrix_multiply() [2/3]

template<int dimension, class elemT >
BasicCoordinate<dimension, elemT> stir::matrix_multiply ( const Array< 2, elemT > &  m,
const BasicCoordinate< dimension, elemT > &  vec 
)
inline

matrix multiplication with vector (given as BasicCoordinate)

matrix size has to be compatible with dimension. Matrix index range has to start from 1. All of this is only checked with assert().

◆ matrix_multiply() [3/3]

template<class elemT >
Array< 2, elemT > stir::matrix_multiply ( const Array< 2, elemT > &  m1,
const Array< 2, elemT > &  m2 
)
inline

matrix multiplication

Index ranges have to be compatible (checked with assert).

◆ diagonal_matrix() [1/2]

template<class elemT >
Array< 2, elemT > stir::diagonal_matrix ( const unsigned  dimension,
const elemT  value 
)
inline

construct a diagonal matrix with all elements on the diagonal equal

Parameters
[in]dimensionspecifies the size of the matrix
[in]valuegives the value on the diagonal. Note that its type determines the type of the return value.
Example
// a 3x3 identity matrix
Array<2,float> iden = diagonal_matrix(3, 1.F);

Index-range of the matrix will be 0 till dimensions-1.

Referenced by absolute_max_eigenvector_using_shifted_power_method(), stir::Shape3DWithOrientation::get_direction_vectors(), and stir::Shape3DWithOrientation::set_defaults().

◆ diagonal_matrix() [2/2]

template<int dimension, class elemT >
Array< 2, elemT > stir::diagonal_matrix ( const BasicCoordinate< dimension, elemT > &  values)
inline

construct a diagonal matrix

Parameters
[in]valuesgives the values on the diagonal. Note that its type determines the type of the return value.
Example
// a 3x3 diagonal matrix with values 1,2,3 on the diagonal
Array<2,float> diag = diagonal_matrix(Coordinate3D<float>(1,2,3));

Index-range of the matrix will be 0 till dimensions-1. (Note that this is different from values).

◆ norm_squared() [1/3]

template<typename elemT >
double stir::norm_squared ( const elemT  t)
inline

Returns the square of the norm of a number.

See also
norm(elemT)

◆ norm() [1/3]

template<typename elemT >
double stir::norm ( const elemT  t)
inline

Returns the norm of a number.

This is the same as the absolute value, but works also for std::complex<T>.

◆ norm_squared() [2/3]

template<class Iter >
double stir::norm_squared ( Iter  begin,
Iter  end 
)
inline

Returns the square of the l2-norm of a sequence.

The l2-norm is defined as the sqrt of the sum of squares of the norms of each element in the sequence.

References norm_squared().

◆ norm() [2/3]

template<class Iter >
double stir::norm ( Iter  begin,
Iter  end 
)
inline

Returns the l2-norm of a sequence.

The l2-norm is defined as the sqrt of the sum of squares of the norms of each element in the sequence.

See also
norm(const Array<1,elemT>&) for a convenience function for Array objects.

References norm_squared().

◆ norm() [3/3]

template<class elemT >
double stir::norm ( const Array< 1, elemT > &  v1)
inline

l2 norm of a 1D array

This returns the sqrt of the sum of the square of the absolute values of the elements of v1.

References stir::VectorWithOffset< T >::begin(), stir::VectorWithOffset< T >::end(), and norm().

◆ norm_squared() [3/3]

template<class elemT >
double stir::norm_squared ( const Array< 1, elemT > &  v1)
inline

square of the l2 norm of a 1D array

This returns the sum of the square of the absolute values of the elements of v1.

References stir::VectorWithOffset< T >::begin(), stir::VectorWithOffset< T >::end(), and norm_squared().

◆ round() [1/3]

int stir::round ( const float  x)
inline

Implements rounding of floating point numbers.

round() has the property that

round(x) == -round(-x)

The usual (int)(x+.5) has machine dependent behaviour for negative numbers.

.5 is rounded to 1 (and hence -.5 to -1).

Warning
There is no check on overflow (i.e. if x is too large to fit in an int).

Referenced by stir::Scanner::check_consistency(), stir::DiscretisedShape3D::construct_volume(), stir::DataSymmetriesForBins_PET_CartesianGrid::DataSymmetriesForBins_PET_CartesianGrid(), stir::DataSymmetriesForDensels_PET_CartesianGrid::DataSymmetriesForDensels_PET_CartesianGrid(), stir::ScatterSimulation::downsample_density_image_for_scatter_points(), stir::ScatterSimulation::downsample_scanner(), stir::DetectorCoordinateMap::find_detection_position_given_cartesian_coordinate(), stir::ProjDataInfoCylindricalNoArcCorr::find_scanner_coordinates_given_cartesian_coordinates(), stir::ProjDataInfoCylindricalArcCorr::get_bin(), stir::ProjDataInfoCylindricalNoArcCorr::get_bin(), stir::DiscretisedDensity< 3, float >::get_indices_closest_to_LPS_coordinates(), stir::DiscretisedDensity< 3, float >::get_indices_closest_to_relative_coordinates(), stir::DiscretisedShape3D::get_voxel_weight(), stir::ProjDataInfoCylindrical::ProjDataInfoCylindrical(), pull_linear_interpolate(), pull_nearest_neighbour_interpolate(), push_nearest_neighbour_interpolate(), push_transpose_linear_interpolate(), stir::SinglesRatesForTimeSlices::rebin(), stir::coordinateTests::run_tests(), secs_since_Unix_epoch_to_DICOM_datetime(), stir::GeneralisedPoissonNoiseGenerator::seed(), stir::DetectorCoordinateMap::set_detector_map(), stir::ForwardProjectorByBinUsingRayTracing::set_up(), stir::BackProjectorByBinUsingInterpolation::set_up(), SSRB(), time_zone_offset_in_secs(), stir::BackProjectorByBinUsingInterpolation::use_piecewise_linear_interpolation(), and stir::HUToMuImageProcessor< TargetT >::virtual_set_up().

◆ round() [2/3]

int stir::round ( const double  x)
inline

Implements rounding of double numbers.

See also
round(const float)

◆ round() [3/3]

template<int num_dimensions, class elemT >
BasicCoordinate< num_dimensions, int > stir::round ( const BasicCoordinate< num_dimensions, elemT > &  x)
inline

Implements rounding of a BasicCoordinate object.

See also
round(const float)

◆ round_to() [1/2]

template<typename integerT >
void stir::round_to ( integerT &  result,
const float  x 
)
inline

Implements rounding of floating point numbers to other integer types.

This function is templated in the output type for convenience of implementation.

Warning
if an unsigned type is used for integerT, the result for negative x will be system dependent
See also
round(const float)
Todo:
add code to check that integerT is really an integer type at compilation time

Referenced by stir::DynamicDiscretisedDensity::write_to_ecat7().

◆ round_to() [2/2]

template<int num_dimensions, class integerT , class elemT >
void stir::round_to ( BasicCoordinate< num_dimensions, integerT > &  result,
const BasicCoordinate< num_dimensions, elemT > &  x 
)
inline

Implements rounding of a BasicCoordinate object to other integer types.

See also
round_to(integerT, float)

◆ operator<<() [1/3]

template<typename elemT >
std::ostream & stir::operator<< ( std::ostream &  str,
const VectorWithOffset< elemT > &  v 
)
inline

Outputs a VectorWithOffset to a stream.

Output is of the form

{1, 2, 3}

with an endl at the end.

This can be used for higher dimensional arrays as well, where each 1D subobject will be on its own line.

◆ operator<<() [2/3]

template<int num_dimensions, typename coordT >
std::ostream & stir::operator<< ( std::ostream &  str,
const BasicCoordinate< num_dimensions, coordT > &  v 
)
inline

Outputs a BasicCoordinate to a stream.

Output is of the form

{1, 2, 3}

with no endl at the end.

◆ operator<<() [3/3]

template<typename elemT >
std::ostream & stir::operator<< ( std::ostream &  str,
const std::vector< elemT > &  v 
)
inline

Outputs a vector to a stream.

Output is of the form

{1, 2, 3}

with an endl at the end.

For each element of the vector std::ostream::operator<<() will be called.

◆ operator>>() [1/3]

template<typename elemT >
std::istream & stir::operator>> ( std::istream &  str,
std::vector< elemT > &  v 
)
inline

Inputs a vector from a stream.

Input is of the form

{1, 2, 3}

Input is stopped when either the beginning '{', an intermediate ',' or the trailing '}' is not found. The size of the vector will be the number of correctly read elemT elements.

For each element of the vector std::istream::operator>>(element) will be called.

elemT needs to have a default constructor.

◆ operator>>() [2/3]

template<typename elemT >
std::istream & stir::operator>> ( std::istream &  str,
VectorWithOffset< elemT > &  v 
)
inline

Inputs a VectorWithOffset from a stream.

Input is of the form

{1, 2, 3}

As Array<>'s are constructed from nested VectorWithOffset objects, you can input say a 2d array as

{{1,2}, {2,4,5}, {5}}

Input is stopped when either the beginning '{', an intermediate ',' or the trailing '}' is not found. The size of the vector will be the number of correctly read elemT elements.

v.get_min_index() will be 0 at the end of the call.

For each element of the vector std::istream::operator>>(element) will be called.

elemT needs to have a default constructor.

◆ operator>>() [3/3]

template<int num_dimensions, typename coordT >
std::istream & stir::operator>> ( std::istream &  str,
BasicCoordinate< num_dimensions, coordT > &  v 
)
inline

Inputs a coordinate from a stream.

Input is of the form

{1, 2, 3}

Input is stopped when either the beginning '{', an intermediate ',' or the trailing '}' is not found. If the number of correctly read elements is not num_dimensions, the last few will have undefined values.

For each element of the vector std::istream::operator>>(element) will be called.

elemT needs to have a default constructor.

Referenced by operator<<().

◆ threshold_upper_lower()

template<typename forw_iterT , typename elemT >
void stir::threshold_upper_lower ( forw_iterT  begin,
forw_iterT  end,
const elemT  new_min,
const elemT  new_max 
)
inline

Threshold a sequence from above and below.

Type requirements:
  • forw_iterT is a forward iterator
  • elemT must be assignable to *forw_iterT
  • bool operator>(*forw_iterT, elemT) must exist

Referenced by stir::stir_mathTests::run_tests(), and stir::OSSPSReconstruction< TargetT >::update_estimate().

◆ threshold_upper()

template<typename forw_iterT , typename elemT >
void stir::threshold_upper ( forw_iterT  begin,
forw_iterT  end,
const elemT  new_max 
)
inline

◆ threshold_lower()

template<typename forw_iterT , typename elemT >
void stir::threshold_lower ( forw_iterT  begin,
forw_iterT  end,
const elemT  new_min 
)
inline

◆ threshold_min_to_small_positive_value()

template<typename ForwardIter_t , typename elemT >
void stir::threshold_min_to_small_positive_value ( ForwardIter_t  begin,
ForwardIter_t  end,
const elemT &  small_number 
)

sets non-positive values in the sequence to small positive ones

Thresholds the sequence from below to *min_positive_element()*small_number. However, if all values are less than or equal to 0, they are set to small_number.

Parameters
beginstart of the sequence. Usually object.begin().
endend of the sequence in iterator sense (so actually one beyond the last element). Usually object.end().
small_numbersee above

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(), and threshold_lower().

Referenced by stir::OSSPSReconstruction< TargetT >::update_estimate().

◆ ask_num()

template<class NUMBER >
NUMBER stir::ask_num ( const std::string &  str,
NUMBER  minimum_value,
NUMBER  maximum_value,
NUMBER  default_value 
)
inline

A function to ask a number from the user.

The question is currently presented as

str_text : [minimum_value, maximum_value, D: default_value]:

Simply pressing 'enter' will select the default value. Otherwise, range checking is performed, and the question asked again if necessary.

Referenced by stir::ProjDataInfo::ask_parameters(), stir::ScatterSimulation::ask_parameters(), stir::OSSPSReconstruction< TargetT >::ask_parameters(), stir::OSMAPOSLReconstruction< TargetT >::ask_parameters(), stir::IterativeReconstruction< TargetT >::ask_parameters(), stir::VoxelsOnCartesianGrid< elemT >::grow_z_range(), stir::AnalyticReconstruction::initialise_keymap(), stir::Scanner::list_names(), and stir::ProjDataFromStream::set_segment().

◆ ask_filename_and_open()

template<class FSTREAM >
void stir::ask_filename_and_open ( FSTREAM &  s,
const std::string &  prompt,
const std::string &  default_extension,
std::ios::openmode  mode,
bool  abort_if_failed 
)

Asks for a filename (with default extension) and opens the stream s with mode giving the specifics.

Example: open a binary input file, aborting if it is not found

ifstream in;
ask_filename_and_open(s, "Input file ?", ".hv", std::ios::in | std::ios::binary);

Note: this function is templated to allow s to be of different types ifstream, ofstream, fstream

◆ read_stream_in_memory()

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.

Referenced by ask_filename_and_open().

◆ open_read_binary() [2/2]

template<class IFSTREAM >
IFSTREAM & stir::open_read_binary ( IFSTREAM &  s,
const std::string &  name 
)
inline

opens a stream for reading binary data. Calls error() when it does not succeed.

Warning
probably does not work if you are not in the C-locale

References error().

Referenced by ask_filename_and_open().

◆ open_write_binary() [2/2]

template<class OFSTREAM >
OFSTREAM & stir::open_write_binary ( OFSTREAM &  s,
const std::string &  name 
)
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.

Warning
probably does not work if you are not in the C-locale

References error().

Referenced by ask_filename_and_open().

◆ close_file() [2/2]

template<class FSTREAM >
void stir::close_file ( FSTREAM &  s)
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.

Referenced by ask_filename_and_open().

◆ four1()

void stir::four1 ( Array< 1, float > &  data,
int  nn,
int  isign 
)

1-dimensional FFT

Replaces data by its discrete Fourier transform, if isign is input as 1; or replaces data by nn times its inverse discrete Fourier transform, if isign is input as -1. data is a complex array of length nn, input as a real array data[1..2*nn]. nn MUST be an integer power of 2 ( this is not checked for !).

◆ fourn()

void stir::fourn ( Array< 1, float > &  data,
Array< 1, int > &  nn,
int  ndim,
int  isign 
)

n-dimensional FFT

Replaces data by its ndim-dimensional discrete Fourier transform, if isign is input as 1. nn[1..ndim] is an integer array containing the lengths of each dimension (number of complex values), which MUST all be powers of 2. data is a real array of length twice the product of thes lengths, in which the data are stored as in a multidimensional complex array: real and imaginary parts of each element are in consecutive locations , and the rightmost index of the array increases most rapidly as one proceeds along data. For a two-dimensional array, this is equivalent to storing the array by rows . If isign is in input as -1 , data is replaced by its inverse transform time the product of the lengths of all dimensions.

◆ convlvC()

void stir::convlvC ( Array< 1, float > &  data,
const Array< 1, float > &  filter,
int  n 
)

Convolve data with a filter which is given in frequency space.

Parameters
datahas to have a min_index == 1
filterhas to in the format produced by realft.
nhas to be equal to th elength of data
Warning
Currently, only the real elements of the filter will be used. (Historical reason?) So, the result will be incorrect of the filter has complex components (i.e. its spatial kernel is not symmetric).

◆ realft()

void stir::realft ( Array< 1, float > &  data,
int  n,
int  isign 
)

Calculates the Fourier Transform of a set of 2n real-valued data points.

Replaces this data ( which is stored in array data[1..2n]) by the positive frequency half of its complex Fourier Transform. The real-valued first and last components of the complex transform are returned as element data[1] and data[2] respectively. n must be a power of 2. The routine also calculates the inverse transform of a complex data array if it is the transform of real data. (Result in this case must be multiplied by 1/n.)