STIR  6.2.0
Classes | Namespaces | Functions
correct_projdata.cxx File Reference

A utility applying/undoing some corrections on projection data. More...

#include "stir/utilities.h"
#include "stir/CPUTimer.h"
#include "stir/VoxelsOnCartesianGrid.h"
#include "stir/ProjDataInterfile.h"
#include "stir/RelatedViewgrams.h"
#include "stir/ParsingObject.h"
#include "stir/ArcCorrection.h"
#include "stir/Succeeded.h"
#include "stir/recon_buildblock/TrivialBinNormalisation.h"
#include "stir/recon_buildblock/ChainedBinNormalisation.h"
#include "stir/recon_buildblock/BinNormalisationFromAttenuationImage.h"
#include "stir/TrivialDataSymmetriesForViewSegmentNumbers.h"
#include "stir/ArrayFunction.h"
#include "stir/TimeFrameDefinitions.h"
#include "stir/warning.h"
#include "stir/error.h"
#include "stir/recon_buildblock/ForwardProjectorByBinUsingProjMatrixByBin.h"
#include "stir/recon_buildblock/ProjMatrixByBinUsingRayTracing.h"
#include "stir/is_null_ptr.h"
#include <string>
#include <iostream>
#include <fstream>
#include <algorithm>

Classes

class  stir::CorrectProjDataApplication
 class to do precorrections More...
 

Namespaces

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

Functions

int main (int argc, char *argv[])
 

Detailed Description

A utility applying/undoing some corrections on projection data.

This is useful to precorrect projection data. There's also the option to undo the correction.

Here's a sample .par file

correct_projdata Parameters :=
  input file := trues.hs

  ; Current way of specifying time frames, pending modifications to
  ; STIR to read time info from the headers
  ; see class documentation for stir::TimeFrameDefinitions for the format of this file
  ; time frame definition filename :=  frames.fdef

  ; if a frame definition file is specified, you can say that the input data
  ; corresponds to a specific time frame
  ; the number should be between 1 and num_frames and defaults to 1
  ; this is currently only used to pass the relevant time to the normalisation
  ; time frame number := 1

  ; output file
  ; for future compatibility, do not use an extension in the name of
  ; the output file. It will be added automatically
  output filename := precorrected

  ; default value for next is -1, meaning 'all segments'
  ; maximum absolute segment number to process :=


  ; use data in the input file, or substitute data with all 1's
  ; (useful to get correction factors only)
  ; default is '1'
  ; use data (1) or set to one (0) :=

  ; precorrect data, or undo precorrection
  ; default is '1'
  ; apply (1) or undo (0) correction :=

  ; parameters specifying correction factors
  ; if no value is given, the corresponding correction will not be performed

  ; random coincidences estimate, subtracted before anything else is done
  ;randoms projdata filename := random.hs
  ; normalisation (or binwise multiplication, so can contain attenuation factors as well)
  Bin Normalisation type := from projdata
    Bin Normalisation From ProjData :=
    normalisation projdata filename:= norm.hs
    End Bin Normalisation From ProjData:=

  ; attenuation image, will be forward projected to get attenuation factors
  ; OBSOLETE
  ;attenuation image filename := attenuation_image.hv

  ; forward projector used to estimate attenuation factors, defaults to Ray Tracing
  ; OBSOLETE
  ;forward_projector type := Ray Tracing

  ; scatter term to be subtracted AFTER norm+atten correction
  ; defaults to 0
  ; - scatter which should NOT be used here (it would need to be added to randoms and used above)
  ; - additive_term which should be used here BUT already included the randoms
  ;scatter projdata filename := scatter.hs

  ; to interpolate to uniform sampling in 's', set value to 1
  ; arc correction := 1
END:=

Time frame definition is only necessary when the normalisation type uses this time info for dead-time correction.

Warning
arc-correction can currently not be undone.

The following gives a brief explanation of the non-obvious parameters.

Author
Kris Thielemans