OrsReconstruction

Tool to reconstruct projection (CT) data

author:ORS Team, Stoyan Asenov, Zacharie Legault, Emmanuelle Richer
contact:http://theobjects.com
email:info@theobjects.com
organization:Object Research Systems (ORS), Inc.
address:760 St-Paul West, suite 101, Montréal, Québec, Canada, H3C 1M4
copyright:Object Research Systems (ORS), Inc. All rights reserved 2021.
date:Jun 11 2018 15:29
dragonflyVersion:
 4.0.0.542 (D)
UUID:84da1d5ee44311e89d54448a5b5d70c0

Class Code

class OrsPythonPlugins.OrsReconstruction.OrsReconstruction.OrsReconstruction(varname=None)
classmethod OrsReconstruction_openToolbox()
UIDescriptors = [<ORSServiceClass.OrsPlugin.uidescriptor.UIDescriptor object>]
canImportFromPreview()
cleanup()

Deletes the variables managed by the plugin. It is the place to remove callbacks and other references to Python objects that would prevent them to be garbage collected. This method is called during the process of deletion of the plugin. It calls for the cleanup and deletion of the forms.

classmethod computePreview(inputDataset, reconstructionEngineInstance, outputDimensionDict, preprocessor, angularSamplingFactor=1, aProgress=None, logReconstructionInfo=True)

Generates a preview of the reconstruction from the central slice and selected parameters.

Parameters:
  • inputDataset (ORSModel.ors.Channel) – input dataset of projections be reconstructed
  • reconstructionEngineInstance (AbstractReconstructor) – an instance of the used reconstruction algorithm class
  • outputDimensionDict (dict) – output dimension dic with the following string keys [size_x, size_y, size_z, spacing_x, spacing_y, spacing_z, origin_x, origin_y, origin_z]
  • preprocessor (CTPreProcessor instance) – pre processor instance that knows the pre processing filter that will be applied
  • angularSamplingFactor (int) – angular sampling factor, 1 means no sampling
  • aProgress (ORSModel.ors.Progress) – an optional progress bar. Default value is None
  • logReconstructionInfo (bool) – log reconstruction info or not
Returns:
  • reconstructedDataset (ORSModel.ors.Channel) – the reconstructed dataset
  • errorMessage (str) – error details if an error occur
computePreviewAndPublish()

Reconstruct the input dataset from the set instance variables. If succeed, the reconstructed dataset will be published.

Returns:
  • succeed (bool) – true if the reconstruction and publish succeed, false otherwise.
  • errorMessage (str) – detail of the error when an error occur.
getAngularSamplingFactor()
classmethod getAvailableReconstructorEngineClassList()
getCanBeSavedOnDisk()
getInputChannel()
getIsPreview(selectedChannel)
getIsValidParameters()
classmethod getMainFormClass()

Gets the class of the main form

Returns:output
getMetadata()
getOutputDimensionDict()
getOutputDimensionsAsVisualBox()
getPreProcessingFilterInstanceList()
getPreviewCount()
classmethod getPreviewForSliceId(inputDataset, reconstructionEngineInstance, outputDimensionDict, preprocessor, previewSliceId, angularSamplingFactor=1, aProgress=None, logReconstructionInfo=True)

Generates a preview of the reconstruction from a specified slice and selected parameters

Parameters:
  • inputDataset (ORSModel.ors.Channel) – input dataset of projections be reconstructed
  • reconstructionEngineInstance (AbstractReconstructor) – an instance of the used reconstruction algorithm class
  • outputDimensionDict (dict) – output dimension dic with the following string keys [size_x, size_y, size_z, spacing_x, spacing_y, spacing_z, origin_x, origin_y, origin_z]
  • preprocessor (CTPreProcessor instance) – pre processor instance that knows the pre processing filter that will be applied
  • previewSliceId (int) – slice id of the preview
  • angularSamplingFactor (int) – angular sampling factor, 1 means no sampling
  • aProgress (ORSModel.ors.Progress) – an optional progress bar. Default value is None
  • logReconstructionInfo (bool) – log reconstruction info or not
Returns:
  • reconstructedDataset (ORSModel.ors.Channel) – the reconstructed dataset
  • errorMessage (str) – error details if an error occur
getPreviewOfReconstructionForSliceId(previewSliceID, logReconstructionInfo=True, angularSamplingFactor=1)
getReconstructorEngineInstance()
getUseCustomDimension()
getUseSinogram()
classmethod importAllLoggingClasses()

This method is called to make any class extension available for macro playing. It should:

  1. import all class extension;
  2. return a list of classes where logging is supported.
Returns:output (list of classes) – list of classes where logging is supported by the current plugin
keepAlive = False
multiple = False
classmethod reconstruct(inputDataset, reconstructionEngineInstance, outputDimensionDict, preprocessor, angularSamplingFactor=1, aProgress=None, logReconstructionInfo=True)

Reconstruct a dataset from sinogram data or projections.

Parameters:
  • inputDataset (ORSModel.ors.Channel) – input dataset of projections or sinogram to be reconstructed
  • reconstructionEngineInstance (AbstractReconstructor) – an instance of the used reconstruction algorithm class
  • outputDimensionDict (dict) – output dimension dic with the following string keys [size_x, size_y, size_z, spacing_x, spacing_y, spacing_z, origin_x, origin_y, origin_z]
  • preprocessor (CTPreProcessor instance) – pre processor instance that knows the pre processing filter that will be applied
  • angularSamplingFactor (int) – angular sample factor. 1 means no sampling
  • aProgress (ORSModel.ors.Progress) – an optional progress bar. Default value is None
  • logReconstructionInfo (bool) – log reconstruction info or not
Returns:
  • reconstructedDataset (ORSModel.ors.Channel) – the reconstructed dataset
  • errorMessage (str) – error details if an error occur
classmethod reconstructAndSaveAsTiff(inputDataset, reconstructionEngineInstance, outputDimensionDict, preprocessor, outputFileDirectory, angularSamplingFactor, aProgress, logReconstructionInfo=True)
reconstructAndSaveOnDiskAsTiff(anOutputFileDirectory)
reconstructDatasetAndPublish()

Reconstruct the input dataset from the set instance variables. If succeed, the reconstructed dataset will be published.

Returns:
  • succeed (bool) – true if the reconstruction and publish succeed, false otherwise.
  • errorMessage (str) – detail of the error when an error occur.
removeReferenceOnRotationFinderInstance()
savable = False
setAngularSamplingFactor(angularSamplingFactor)
setAsPreview(previewChannel)
setInputChannel(aChannel)
setOutputDimensionDict(aDict)
setOutputDimensionDictKeyValue(aKey, aValue)
setOutputDimensionsFromVisualBox(aVisualBox: ORSModel.ors.VisualBox)
setReconstructionPluginInstanceVariableFromSelectedPreview(selectedPreview)

Update reconstruction plugin instance from a selected preview (ORS Channel)

setReconstructorEngineInstance(aClass: OrsPythonPlugins.OrsReconstruction.algorithms.baseAlgorithm.AbstractReconstructor)
setUseCustomDimension(aBool)
setUseSinogram(aBool)
showOutputSection()
startRotationFinder()
classmethod startupDefault(openMainForm=True)

Creates an instance of the plugin class and opens the main form (if required) at the default position.

Returns:output (AbstractPlugin) – plugin instance
classmethod toolsMenu()
updatePreProcessingfilterInstanceListFromSelectedCTScan()
validGeometryParameters()

Valid geometry parameter, if false, return also a callable fct that take the contextual windows in agr to be callled.

Return:True if valid. False otherwise
Rtype:bool
Return:A callable function that take in arg the contextual