ImFusion SDK 4.3
ConeBeamReconLoader Class Reference

#include <ImFusion/CT/ConeBeamReconLoader.h>

I/O algorithm for loading cone-beam reconstruction data. More...

+ Inheritance diagram for ConeBeamReconLoader:

Detailed Description

I/O algorithm for loading cone-beam reconstruction data.

Handles loading of projection data and reconstruction parameters from various formats.

Public Member Functions

 ConeBeamReconLoader ()
 Constructor.
 
 ~ConeBeamReconLoader () override
 Destructor.
 
void setFolder (const std::string &folder)
 Set the folder to load data from, or the base folder of a configuration.
 
void configure (const Properties *p) override
 Configure the loader using properties.
 
void setOptions (bool orig, bool downsample, int skip=-1, int rotate=-1, int flip=-1, int bits=-1, const vec4i &crop=vec4i::Zero())
 Set pre-processing options, possibly overriding some of the configured settings.
 
void onTaskUpdated (const Task *task) override
 Pass on progress and schedule pre-processing of a frame.
 
void load ()
 Load the data.
 
virtual void loadMatrices (SharedImageSet *data) const
 Tries to load the individual transformation matrices for a cone-beam data set.
 
const std::vector< SharedImageSet * > & data ()
 Access the loaded data.
 
void configuration (Properties *p) const override
 Store the configuration in properties.
 
void options (bool &orig, bool &downsample, int &skip, int &rotate, int &flip, int &bits) const
 Directly retrieve the main pre-processing options.
 
const ImageDescriptorvolDesc () const
 Retrieve the reconstruction volume descriptor.
 
int projWidth () const
 Return the configured projection image width in pixels.
 
int projHeight () const
 Return the configured projection image height in pixels.
 
int projNum () const
 Return the configured number of projection images.
 
ProjectionPreProcessingpreProcessing ()
 Return projection preprocessing.
 
void setPreProcessingEnabled (bool enabled)
 Enable/Disable projection preprocessing.
 
Propertiesproperties ()
 Get stored configuration properties.
 
void compute () override
 Execute the algorithm.
 
OwningDataList takeOutput () override
 Return any new Data that was created by the Algorithm during the last call to compute().
 
void setProgress (Progress *progress) override
 Sets a Progress interface the algorithm can use to notify observers about its computing progress.
 
- Public Member Functions inherited from IoAlgorithm
 IoAlgorithm (IoMode ioMode, int locationType)
 Constructor for initializing IO algorithm.
 
virtual IoMode ioMode () const
 Return IO mode.
 
virtual std::vector< std::stringsupportedFileExtensions () const
 Return supported file extensions (for file based IO)
 
virtual std::string suggestedSaveFileName () const
 Return a file name suggestion typically used by IoController to prefill the file name in the save file dialog (for file based write)
 
virtual bool canLoad (const Filesystem::Path &filepath) const
 Returns whether the algorithm is suitable for loading the indicated file.
 
virtual bool fail (int *errorCode=nullptr) const
 
int status () const override
 Indicates the status of the last call to compute().
 
virtual int supportedLocations () const
 Return combination of supported location types from LocationType enum.
 
virtual void setLocation (const std::string &location)
 Set location for subsequent loading/saving.
 
virtual std::string location () const
 Get location for loading/saving.
 
void configure (const Properties *p) override
 Set one or multiple properties.
 
void configuration (Properties *p) const override
 Retrieve the properties of this object.
 
std::unique_ptr< PropertiesuserOptions (bool includeReadOptions, bool includeWriteOptions) const
 Convenience method to retrieve all properties from this IoAlgorithm that are tagged as user options to be configured during load/save.
 
void configureFromGlobalSettings ()
 Convenience method to configure the algorithm's user options with the values stored in the global settings.
 
- Public Member Functions inherited from Algorithm
 Algorithm ()
 Default constructor will registers a single "compute" action that calls compute() and returns status().
 
Progressprogress () const
 Returns the progress interface if set.
 
virtual bool survivesDataDeletion (const Data *) const
 Indicates whether the algorithm can handle (partial) deletion of the specified data, by default this checks whether the data is in the input list.
 
const FactoryInfofactoryInfo () const
 Returns the record describing how this Algorithm was instantiated by the AlgorithmFactory.
 
void setFactoryInfo (const FactoryInfo &value)
 Sets the record describing how this Algorithm was instantiated by the AlgorithmFactory.
 
Status runAction (const std::string &id)
 Run the action with name id if it exists.
 
const std::vector< Action > & actions ()
 Get a mapping from Action id to Action as registered in this algorithm.
 
- Public Member Functions inherited from Configurable
virtual void configureDefaults ()
 Retrieve the properties of this object, replaces values with their defaults and sets it again.
 
void registerParameter (ParameterBase *param)
 Register the given Parameter or SubProperty, so that it will be configured during configure()/configuration().
 
void unregisterParameter (const ParameterBase *param)
 Remove the given Parameter or SubProperty from the list of registered parameters.
 
 Configurable (const Configurable &rhs)
 
 Configurable (Configurable &&rhs) noexcept
 
Configurableoperator= (const Configurable &)
 
Configurableoperator= (Configurable &&) noexcept
 
- Public Member Functions inherited from NestedProgress
 NestedProgress (Progress *parent=nullptr, Flags< TaskMode > taskFlags=TaskMode::Default)
 Creates a new NestedProgress instance.
 
void setParentProgress (Progress *parent)
 Updates the parent Progress instance to which progress updates should be forwarded to.
 
void cancelAllTasks ()
 Will cancel all tasks that were spawned from this NestedProgress instance.
 
- Public Member Functions inherited from Progress
Task addTask (int numSteps, const std::string &description)
 Create a new progress report for an operation with the given number of steps.
 
Task addBusyIndicator (const std::string &description)
 Create a busy indicator for an operation but does not have a predefined number of steps.
 

Protected Types

enum  LoaderType { FILE_LOADER = 0 , SHM_LOADER = 1 , IMFUSION_FILE_LOADER = 2 }
 Enum for projection loader type.
 

Protected Member Functions

virtual void createLoader ()
 Auxiliary method to create loader specialization.
 
virtual void initCalibration ()
 Auxiliary method to initialize the flat-field calibration.
 
void configureVolume (const Properties *p)
 Initialize the volume descriptor from the reconstruction parameters.
 
- Protected Member Functions inherited from IoAlgorithm
void recordToDataSourceComponent (Data &data, int indexInFile)
 Append the current configuration of the IoAlgorithm to the DataSourceComponent of a data.
 
- Protected Member Functions inherited from Algorithm
void loadDefaults ()
 
void registerAction (const std::string &id, const std::string &guiName, const std::function< Algorithm::Status(void)> &action)
 Register an action to be run via runAction.
 
template<typename D>
void registerAction (const std::string &id, const std::string &guiName, Algorithm::Status(D::*action)(void))
 Template version of runAction that can be used with a pointer to a member function.
 
void registerAction (const Action &action)
 Register an action.
 
- Protected Member Functions inherited from NestedProgress
void onTaskAdded (Task *task) override
 Function is called whenever a new Task has been created.
 
void onTaskUpdated (const Task *task) override
 Function is called whenever the state of a Task has changed and the reporter should update its UI.
 
bool onTaskRequestsThreadSafety (const Task *task) override
 Function is called by Task::requestThreadSafety() in order to check whether the parent reporter supports concurrent access.
 
void onTaskRemoved (const Task *task) override
 Function is called whenever a Task is about to be destroyed and its pointer will become invalid.
 

Protected Attributes

std::string m_folder
 Base folder to load data from.
 
std::string m_calPath
 Path to detector calibration files.
 
std::string m_matFile
 File for individual projection matrices.
 
std::string m_isoMatFile
 File for individual motion matrices.
 
std::string m_timestampFile
 File for individual timestamps per frame.
 
int m_calDepth
 Bit depth for flat-field calibration.
 
double m_binning
 Binning for the case that the projection matrices have been calibrated for a different number of pixel on the detector.
 
bool m_calInit
 Has the calibration been initialized.
 
int m_loadSkip
 Shall frames be skipped during load.
 
ImageDescriptor m_volDesc
 Reconstruction volume descriptor from configuration.
 
int m_projWidth
 Projection width in pixels, if configured.
 
int m_projHeight
 Projection height in pixels, if configured.
 
int m_projNum
 Number of projections, if configured.
 
std::vector< SharedImageSet * > m_data
 The CBCT data, not owned.
 
LoaderType m_loaderType
 Projection loader type.
 
ProjectionLoaderm_loader
 Projection loader instance.
 
ProjectionPreProcessingm_preProc
 Projection pre-processing instance.
 
bool m_preProcEnabled
 Projection pre-processing enabled.
 
DetectorCalibration * m_calib
 Flat-field calibration instance.
 
Propertiesm_loadProps
 Configuration properties.
 
bool m_optOverride
 Override pre-processing option.
 
bool m_optOrig
 Pre-processing load original values option.
 
bool m_optDownsample
 Pre-processing downsample option.
 
int m_optSkip
 Pre-processing skip option.
 
int m_optRotate
 Pre-processing rotate option.
 
int m_optFlip
 Pre-processing flip option.
 
int m_optBits
 Pre-processing bits option.
 
vec4i m_optCrop
 Pre-processing crop option.
 
- Protected Attributes inherited from IoAlgorithm
std::string m_location
 
IoMode m_ioMode
 
int m_locationType
 
bool m_fail
 
- Protected Attributes inherited from Algorithm
std::string m_name
 Algorithm name.
 
Progressm_progress = nullptr
 Non-owing pointer to a progress interface. May be a nullptr.
 
FactoryInfo m_factoryInfo = {}
 Record describing how this algorithm was instantiated by the AlgorithmFactory.
 
int m_status = Status::Unknown
 Algorithm status after last call to compute()
 
std::vector< Actionm_actions
 Map of key given by the id of the action, of the available actions of this algorithm.
 
- Protected Attributes inherited from Configurable
std::vector< Paramm_params
 List of all registered Parameter and SubProperty instances.
 
- Protected Attributes inherited from NestedProgress
Progressm_parent
 
const Flags< TaskModem_taskFlags
 
std::unique_ptr< std::mutexm_mutex
 
std::unique_ptr< Taskm_parentThreadSafetyGuard
 
std::vector< Task * > m_tasks
 

Additional Inherited Members

- Public Types inherited from IoAlgorithm
enum  IoMode { Read = 0 , Write = 1 }
 
enum  LocationType {
  File = 1 , Folder = 2 , URI = 4 , OpenIGTLink = 8 ,
  Device = 16
}
 
- Public Types inherited from Algorithm
enum  Status {
  Unknown = -1 , Success = 0 , Error = 1 , InvalidInput ,
  IncompleteInput , OutOfMemoryHost , OutOfMemoryGPU , UnsupportedGPU ,
  UnknownAction , AbortedByUser , User = 1000
}
 Status codes. More...
 
- Public Types inherited from NestedProgress
enum  TaskMode { Default = 0 , ThreadSafe = 1 << 0 , Hidden = 1 << 1 }
 Enumeration of possible invariants that should be ensured by NestedProgress. More...
 
- Static Public Member Functions inherited from IoAlgorithm
static std::unique_ptr< IoAlgorithmcreateFromLastDataSource (const DataSourceComponent &dsc)
 Virtual constructor that creates the IoAlgorithm recorded last in the DataSourceComponent.
 
- Static Public Member Functions inherited from Algorithm
static bool createCompatible (const DataList &data, Algorithm **a=nullptr)
 Factory function to check algorithm compatibility with input data and optionally instantiate it.
 
- Public Attributes inherited from Algorithm
Signal signalOutputChanged
 Signal should be emitted by Algorithms when their output/result has changed.
 
Signal signalParametersChanged
 Signal should be emitted by Algorithms when their parameter configuration has changed.
 
- Public Attributes inherited from Configurable
Signal signalParametersChanged
 Emitted whenever one of the registered Parameters' or SubPropertys' signalValueChanged signal was emitted.
 
- Public Attributes inherited from NestedProgress
ProtectedSignal< Task * > signalTaskAdded
 Signal emitted by the default implementation of NestedProgress::onTaskAdded().
 
ProtectedSignal< const Task * > signalTaskUpdated
 Signal emitted by the default implementation of NestedProgress::onTaskUpdated().
 

Member Function Documentation

◆ configure()

void configure ( const Properties * p)
overridevirtual

Configure the loader using properties.

Reimplemented from Configurable.

Reimplemented in ConeBeamReconLoaderExtra.

◆ setOptions()

void setOptions ( bool orig,
bool downsample,
int skip = -1,
int rotate = -1,
int flip = -1,
int bits = -1,
const vec4i & crop = vec4i::Zero() )

Set pre-processing options, possibly overriding some of the configured settings.

A value of -1 in the integer parameters means that this setting will not be changed.

◆ onTaskUpdated()

void onTaskUpdated ( const Task * task)
overridevirtual

Pass on progress and schedule pre-processing of a frame.

Implements Progress.

◆ loadMatrices()

virtual void loadMatrices ( SharedImageSet * data) const
virtual

Tries to load the individual transformation matrices for a cone-beam data set.

Reimplemented in ConeBeamReconLoaderExtra.

◆ configuration()

void configuration ( Properties * p) const
overridevirtual

Store the configuration in properties.

Reimplemented from Configurable.

Reimplemented in ConeBeamReconLoaderExtra.

◆ compute()

void compute ( )
overridevirtual

Execute the algorithm.

Implements Algorithm.

◆ takeOutput()

OwningDataList takeOutput ( )
overridevirtual

Return any new Data that was created by the Algorithm during the last call to compute().

The default implementation will return an empty list.

Note
Since ownership of the data is transferred, you can call this method only once between calls to compute().

Reimplemented from Algorithm.

◆ setProgress()

void setProgress ( Progress * progress)
overridevirtual

Sets a Progress interface the algorithm can use to notify observers about its computing progress.

Reimplemented from Algorithm.

◆ createLoader()

virtual void createLoader ( )
protectedvirtual

Auxiliary method to create loader specialization.

Reimplemented in ConeBeamReconLoaderExtra.

◆ initCalibration()

virtual void initCalibration ( )
protectedvirtual

Auxiliary method to initialize the flat-field calibration.

Reimplemented in ConeBeamReconLoaderExtra.


The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close