Skip to main content
Ctrl+K
Infinity-Tomographic-Reconstruction 0.1.0 documentation - Home

Site Navigation

  • Installation
  • Examples
  • API reference
  • Please cite
  • GitHub

Site Navigation

  • Installation
  • Examples
  • API reference
  • Please cite
  • GitHub

Section Navigation

  • toor package
    • toor.AnalyticalReconstruction package
    • toor.CalibrationWrapper package
    • toor.Corrections package
      • toor.Corrections.CT package
        • toor.Corrections.CT.Projector package
      • toor.Corrections.DualRotation package
        • toor.Corrections.DualRotation.Normalization package
        • toor.Corrections.DualRotation.SystemFocus package
      • toor.Corrections.General package
      • toor.Corrections.PET package
        • toor.Corrections.PET.Attenuation package
        • toor.Corrections.PET.DOI package
        • toor.Corrections.PET.DecayCorrection package
        • toor.Corrections.PET.EnergyCorrection package
        • toor.Corrections.PET.Projector package
    • toor.Designer package
    • toor.DetectionLayout package
      • toor.DetectionLayout.Collimators package
      • toor.DetectionLayout.Modules package
      • toor.DetectionLayout.Photodetectors package
        • toor.DetectionLayout.Photodetectors.Crystals package
        • toor.DetectionLayout.Photodetectors.SiPM package
      • toor.DetectionLayout.RadiationProducer package
      • toor.DetectionLayout.Semicondutors package
    • toor.Device package
    • toor.GateLink package
      • toor.GateLink.GateToTor package
      • toor.GateLink.RootToTor package
      • toor.GateLink.ToRToGate package
    • toor.Geometry package
      • toor.Geometry.LinearPET package
      • toor.Geometry.Standard package
      • toor.Geometry.dualRotationBased package
    • toor.ImageReader package
      • toor.ImageReader.DICOM package
      • toor.ImageReader.Interfile package
      • toor.ImageReader.RawData package
    • toor.Optimizer package
    • toor.Quantification package
    • toor.TORFilesReader package
  • API reference
  • toor.GateLink package
  • toor.GateLin...

toor.GateLink.RootToTor package#

Submodules#

toor.GateLink.RootToTor.addanglestorootfile module#

class toor.GateLink.RootToTor.addanglestorootfile.AddMotorInfoToRoot(filename=None, doubleScannerFormat=True, path_to_macs=None)[source]#

Bases: ReadRootFile

createMotorArrays()[source]#
readMotorFiles()[source]#
saveMotorArraysIntoRoot(array_keys)[source]#

toor.GateLink.RootToTor.findcoincidencesRoot2Numpy module#

class toor.GateLink.RootToTor.findcoincidencesRoot2Numpy.GenerateCoincidencesAndAnhnilationsPositions(filename=None, method='time_diff', coincidenceWindow=0.1)[source]#

Bases: ReadRootFile

This class is used to generate the coincidences and anhnilations positions from the root file data. The coincidences algorithm is based on the time of the events. It assumed that GATE digitizer is used to join multiple events that occur the same detector. For more information about the GATE digitizer, please refer to the GATE documentation. :type filename: :param filename: the path to the root file :type method: :param method: the method used to generate the coincidences. The options are:

SameID: the coincidence is generated when the events have the same ID SameTime: the coincidence is generated when the events have the same time

Parameters:
  • coincidenceWindow – the coincidence window in nano seconds

  • doubleScannerFormat – if the root file returns two arrays for the singles, one for each scanner

  • _filename – the path to the root file

  • _method – the method used to generate the coincidences. The options are: SameID: the coincidence is generated when the events have the same ID SameTime: the coincidence is generated when the events have the same time

  • _coincidenceWindow – the coincidence window in nano seconds

  • doubleScannerFormat – if the root file returns two arrays for the singles, one for each scanner

  • _fileBodyData – the list mode data

  • _coincidences – the coincidences data

  • _anhnilations – the anhnilations data

  • _singlesScanner1 – the singles data for the first module

  • _singlesScanner2 – the singles data for the second module

findCoincidences(coincidenceWindow=0.1, array_keys=None)[source]#

Slower version: This method is used to find the coincidences in the singles data. :type coincidenceWindow: :param coincidenceWindow: the coincidence window in nano seconds

findCoincidencesBigArrays(coincidenceWindow=1, array_keys=None)[source]#

This method is used to find the coincidences in the singles data.

findCoincidencesTrueEventID(array_keys=None)[source]#
printCoincidenceStats()[source]#
readCoincidencesNumpyRecordsArray()[source]#
saveCoincidencesAsNumpyRecordsArray(array_keys=None)[source]#
saveCoincidencesAsRootFile(array_keys=None, filename=None)[source]#

toor.GateLink.RootToTor.readroot module#

class toor.GateLink.RootToTor.readroot.ReadRootFile(filename=None)[source]#

Bases: object

Class to read root files :type filename: :param filename: str

Path to the root file

Parameters:
  • _filename – str Path to the root file

  • _partNumber – int Part number of the root file

  • _singlesScanner1 – ExtractSingles ExtractSingles object for the singles of the first scanner

  • _singlesScanner2 – ExtractSingles ExtractSingles object for the singles of the second scanner

  • _singles – ExtractSingles ExtractSingles object for the singles of the single scanner

  • _keysUsed – list List of the keys used to create the singles

  • _doubleScannerFormat – bool True if the root file is in double scanner format

property doubleScannerFormat#
property partNumber#
readRoot()[source]#
setArraysToConvert(obj=None, keys=None, arr=None)[source]#
setDoubleScannerFormat(value)[source]#
setPartNumber(partNumber)[source]#
property singles#
property singlesScanner1#
property singlesScanner2#

toor.GateLink.RootToTor.recreatedata module#

toor.GateLink.RootToTor.rootToTor module#

toor.GateLink.RootToTor.rootjoiner module#

class toor.GateLink.RootToTor.rootjoiner.RootJoiner(file_path, path_to_save=None, tree_name='Singles', double_scanner_format=False)[source]#

Bases: object

chooseJustFilteredData()[source]#
property globalArray#
property globalArray_scanner1#
property globalArray_scanner2#
join()[source]#

toor.GateLink.RootToTor.singlesstruct module#

class toor.GateLink.RootToTor.singlesstruct.ExtractSingles(parent=None)[source]#

Bases: object

This class is used to extract the singles data from the root file and to convert into numpy array. :type parent: :param parent: the uproot object containing the singles data

Parameters:
  • _parent – the uproot object containing the singles data

  • _runID – the run ID

  • _eventID – the event ID

  • _sourceID – the source ID

  • _sourcePosX – the source position in x

  • _sourcePosY – the source position in y

  • _sourcePosZ – the source position in z

  • _globalPosX – the global position in x

  • _globalPosY – the global position in y

  • _globalPosZ – the global position in z

  • _time – the time

  • _energy – the energy

  • _baseID – the base ID

  • _level1ID – the level 1 ID (moduleID)

  • _level2ID – the level 2 ID (submoduleID)

  • _level3ID – the level 3 ID (crystalID

  • _level4ID – the level 4 ID (pixelID)

  • _level5ID – the level 5 ID (?)

  • _comptonPhantom – the compton phantom

  • _comptonCrystal – the compton crystal

  • _comptonDetector – the compton detector

  • _comptonWorld – the compton world

_createAllTreeArrays()#

create all the tree arrays from the root file to numpy arrays

runID()#

get the run ID

setRunID()#

set the run ID

eventID()#

get the event ID

setEventID()#

set the event ID

sourceID()#

get the source ID

setSourceID()#

set the source ID

sourcePosX()#

get the source position in x

setSourcePosX()#

set the source position in x

sourcePosY()#

get the source position in y

setSourcePosY()#

set the source position in y

sourcePosZ()#

get the source position in z

setSourcePosZ()#

set the source position in z

globalPosX()#

get the global position in x

setGlobalPosX()#

set the global position in x

globalPosY()#

get the global position in y

setGlobalPosY()#

set the global position in y

globalPosZ()#

get the global position in z

setGlobalPosZ()#

set the global position in z

time()#

get the time

setTime()#

set the time

energy()#

get the energy

setEnergy()#

set the energy

baseID()#

get the base ID

setBaseID()#

set the base ID

level1ID()#

get the level 1 ID (moduleID)

setLevel1ID()#

set the level 1 ID (moduleID)

level2ID()#

get the level 2 ID (submoduleID)

setLevel2ID()#

set the level 2 ID (submoduleID)

level3ID()#

get the level 3 ID (crystalID)

setLevel3ID()#

set the level 3 ID (crystalID)

level4ID()#

get the level 4 ID (pixelID)

setLevel4ID()#

set the level 4 ID (pixelID)

level5ID()#

get the level 5 ID (?)

setLevel5ID()#

set the level 5 ID (?)

comptonPhantom()#

get the compton phantom

setComptonPhantom()#

set the compton phantom

comptonCrystal()#

get the compton crystal

setComptonCrystal()#

set the compton crystal

comptonDetector()#

get the compton detector

setComptonDetector()#

set the compton detector

comptonWorld()#

get the compton world

property baseID#
property comptonCrystal#
property comptonPhantom#
property energy#
property eventID#
property globalPosX#
property globalPosY#
property globalPosZ#
property level1ID#
property level2ID#
property level3ID#
property level4ID#
property level5ID#
property parent#
property runID#
property setBaseID#
property setComptonCrystal#
property setComptonPhantom#
property setEnergy#
property setEventID#
property setGlobalPosX#
property setGlobalPosY#
property setGlobalPosZ#
property setLevel1ID#
property setLevel2ID#
property setLevel3ID#
property setLevel4ID#
property setLevel5ID#
property setRunID#
property setSourceID#
property setSourcePosX#
property setSourcePosY#
property setSourcePosZ#
property setTime#
property sourceID#
property sourcePosX#
property sourcePosY#
property sourcePosZ#
property time#

toor.GateLink.RootToTor.validation_plots module#

class toor.GateLink.RootToTor.validation_plots.CoincidenceValidationPlots(listmode_file, array_keys, directory)[source]#

Bases: object

generateCharts()[source]#

Module contents#

previous

toor.GateLink.GateToTor package

next

toor.GateLink.ToRToGate package

On this page
  • Submodules
  • toor.GateLink.RootToTor.addanglestorootfile module
    • AddMotorInfoToRoot
      • AddMotorInfoToRoot.createMotorArrays()
      • AddMotorInfoToRoot.readMotorFiles()
      • AddMotorInfoToRoot.saveMotorArraysIntoRoot()
  • toor.GateLink.RootToTor.findcoincidencesRoot2Numpy module
    • GenerateCoincidencesAndAnhnilationsPositions
      • GenerateCoincidencesAndAnhnilationsPositions.findCoincidences()
      • GenerateCoincidencesAndAnhnilationsPositions.findCoincidencesBigArrays()
      • GenerateCoincidencesAndAnhnilationsPositions.findCoincidencesTrueEventID()
      • GenerateCoincidencesAndAnhnilationsPositions.printCoincidenceStats()
      • GenerateCoincidencesAndAnhnilationsPositions.readCoincidencesNumpyRecordsArray()
      • GenerateCoincidencesAndAnhnilationsPositions.saveCoincidencesAsNumpyRecordsArray()
      • GenerateCoincidencesAndAnhnilationsPositions.saveCoincidencesAsRootFile()
  • toor.GateLink.RootToTor.readroot module
    • ReadRootFile
      • ReadRootFile.doubleScannerFormat
      • ReadRootFile.partNumber
      • ReadRootFile.readRoot()
      • ReadRootFile.setArraysToConvert()
      • ReadRootFile.setDoubleScannerFormat()
      • ReadRootFile.setPartNumber()
      • ReadRootFile.singles
      • ReadRootFile.singlesScanner1
      • ReadRootFile.singlesScanner2
  • toor.GateLink.RootToTor.recreatedata module
  • toor.GateLink.RootToTor.rootToTor module
  • toor.GateLink.RootToTor.rootjoiner module
    • RootJoiner
      • RootJoiner.chooseJustFilteredData()
      • RootJoiner.globalArray
      • RootJoiner.globalArray_scanner1
      • RootJoiner.globalArray_scanner2
      • RootJoiner.join()
  • toor.GateLink.RootToTor.singlesstruct module
    • ExtractSingles
      • ExtractSingles._createAllTreeArrays()
      • ExtractSingles.runID()
      • ExtractSingles.setRunID()
      • ExtractSingles.eventID()
      • ExtractSingles.setEventID()
      • ExtractSingles.sourceID()
      • ExtractSingles.setSourceID()
      • ExtractSingles.sourcePosX()
      • ExtractSingles.setSourcePosX()
      • ExtractSingles.sourcePosY()
      • ExtractSingles.setSourcePosY()
      • ExtractSingles.sourcePosZ()
      • ExtractSingles.setSourcePosZ()
      • ExtractSingles.globalPosX()
      • ExtractSingles.setGlobalPosX()
      • ExtractSingles.globalPosY()
      • ExtractSingles.setGlobalPosY()
      • ExtractSingles.globalPosZ()
      • ExtractSingles.setGlobalPosZ()
      • ExtractSingles.time()
      • ExtractSingles.setTime()
      • ExtractSingles.energy()
      • ExtractSingles.setEnergy()
      • ExtractSingles.baseID()
      • ExtractSingles.setBaseID()
      • ExtractSingles.level1ID()
      • ExtractSingles.setLevel1ID()
      • ExtractSingles.level2ID()
      • ExtractSingles.setLevel2ID()
      • ExtractSingles.level3ID()
      • ExtractSingles.setLevel3ID()
      • ExtractSingles.level4ID()
      • ExtractSingles.setLevel4ID()
      • ExtractSingles.level5ID()
      • ExtractSingles.setLevel5ID()
      • ExtractSingles.comptonPhantom()
      • ExtractSingles.setComptonPhantom()
      • ExtractSingles.comptonCrystal()
      • ExtractSingles.setComptonCrystal()
      • ExtractSingles.comptonDetector()
      • ExtractSingles.setComptonDetector()
      • ExtractSingles.comptonWorld()
      • ExtractSingles.baseID
      • ExtractSingles.comptonCrystal
      • ExtractSingles.comptonPhantom
      • ExtractSingles.energy
      • ExtractSingles.eventID
      • ExtractSingles.globalPosX
      • ExtractSingles.globalPosY
      • ExtractSingles.globalPosZ
      • ExtractSingles.level1ID
      • ExtractSingles.level2ID
      • ExtractSingles.level3ID
      • ExtractSingles.level4ID
      • ExtractSingles.level5ID
      • ExtractSingles.parent
      • ExtractSingles.runID
      • ExtractSingles.setBaseID
      • ExtractSingles.setComptonCrystal
      • ExtractSingles.setComptonPhantom
      • ExtractSingles.setEnergy
      • ExtractSingles.setEventID
      • ExtractSingles.setGlobalPosX
      • ExtractSingles.setGlobalPosY
      • ExtractSingles.setGlobalPosZ
      • ExtractSingles.setLevel1ID
      • ExtractSingles.setLevel2ID
      • ExtractSingles.setLevel3ID
      • ExtractSingles.setLevel4ID
      • ExtractSingles.setLevel5ID
      • ExtractSingles.setRunID
      • ExtractSingles.setSourceID
      • ExtractSingles.setSourcePosX
      • ExtractSingles.setSourcePosY
      • ExtractSingles.setSourcePosZ
      • ExtractSingles.setTime
      • ExtractSingles.sourceID
      • ExtractSingles.sourcePosX
      • ExtractSingles.sourcePosY
      • ExtractSingles.sourcePosZ
      • ExtractSingles.time
  • toor.GateLink.RootToTor.validation_plots module
    • CoincidenceValidationPlots
      • CoincidenceValidationPlots.generateCharts()
  • Module contents

© Copyright 2025, Pedro Encarnação.

Created using Sphinx 7.4.7.

Built with the PyData Sphinx Theme 0.14.2.