Skip to content

rshopa/jpet-kde-reconstruction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

Image reconstruction by multivariate kernel density estimation

The application, written in R language, is devoted to image reconstruction for J-PET, using multivariate kernel density estimation (KDE).

Prerequisites

Tested on Ubuntu 16.04 LTE with R version 3.4.4 installed. The script operates with a number of shell commands (for example, readlink -f <incomplete_path_to_file>), but. basically, all of them are standard.

Additional R packages are required:

Input data and parameters

The application proceeds with GOJA output format (16-column ASCII) as the input. The parameters of the reconstruction, as well as the geometry of the scanner, are stored in JSON format: it is self-describing and easy to undersand. Please refer to the example/ directory for the details.

Script architecture

The script is designed to work as quick as possible, hence, for data processing, R environments are utilised instead of classes:

  • SetMappingEnvironment.R
  • SetAnhPtsEnvironment.R
  • SetKDEEnvironment.R

In comparison, the performance is not crucial for the read of input parameters, so Reference classes are used for controllers (wrapped into a list by InitParamsFromJSON.R):

  • JSONReader.R
  • KDEController.R

More information on the performance of R classes and environments could be found here.

Usage

There are three main executables:

  • MapHitsToCentresOfStrips.R - remaps all XY-coordinates of hits to the centres of strips and saves the result to file, according to the format chosen (ASCII or .RData). Only first 8 columns are saved (pairs of coordinates and times of hits)
  • DetectAnnihilationPoints.R - remaps XY-coordinates of hits to the centres of strips and estimates exact positions of annihilation points, using time-of-flight (estimated from times of hits). The result - three columns for (X,Y,Z) - is stored according to the format chosen (ASCII or .RData).
  • EngageKDEReconstruction.R - executes KDE on the data for annihilation points. Depends strongly on input JSON file and requires DetectAnnihilationPoints.R to run first.

A single shared argument, a .json file with parameters is passed to all executables (see the example/ directory):

$ Rscript [--vanilla] MapHitsToCentresOfStrips.R <parameters.json>
$ Rscript [--vanilla] DetectAnnihilationPoints.R <parameters.json>
$ Rscript [--vanilla] EngageKDEReconstruction.R <parameters.json>

The option --vanilla prevents Rscript from reading R history, profile, or environment files, as well as reloading data or objects from previous sessions.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages