ImFusion SDK 4.3
RegistrationResults Class Reference

#include <ImFusion/Reg/RegistrationResults.h>

Class responsible for managing and storing the results of data registration. More...

Detailed Description

Class responsible for managing and storing the results of data registration.

It provides functionality to add, remove, apply, and manage registration results.

Registration results can be saved to and loaded from ImFusion Registration Results (IRR) files. These files may include data source information, enabling the class to load missing data when necessary to apply the results. Each registration result contains a transformation matrix and, optionally, a deformation.

Classes

struct  DataResult
 Represents the registration result for a single data object. More...
 
struct  DataSource
 
struct  Result
 Represents a complete registration result, composed by multiple DataResult objects. More...
 

Public Member Functions

void add (const DataList &datalist, std::string name="", bool isGroundTruth=false, Properties regAlgConfig={})
 Adds a new registration result based on the current state of the provided data.
 
void add (Result &&res)
 Add a registration result Duplicates are not allowed by default.
 
bool remove (int index)
 Removes the registration result at the specified index.
 
DataList apply (int index)
 Applies the registration result at the specified index.
 
int size () const
 Number of results.
 
Resultget (int index)
 Get the result at index
 
const Resultget (int index) const
 
void configuration (Properties &prop, const Filesystem::Path &deformationFilePath="") const
 Serialize the list of results into Properties
 
int configure (const Properties &p, std::optional< Filesystem::Path > originPath=std::nullopt)
 Loads registration results from a Properties object.
 
bool save (const Filesystem::Path &path, bool includeDataNames=true) const
 Saves the registration results to an ImFusion Registration Results (IRR) file.
 
int load (const Filesystem::Path &path)
 Loads registration results from an ImFusion Registration Results (IRR) file.
 
std::vector< int > dataDeleted (Data *data)
 Handles the removal of a data object, updating all affected results.
 
void resolveData (const DataList &dataList)
 Resolves missing data by searching for it in the provided data list.
 
OwningDataList loadMissingData (int index=-1, Progress *progress=nullptr)
 Loads missing data for the specified result or all results.
 
bool someDataMissing () const
 Returns true if there is at least one result which misses some data.
 
int findResult (const DataList &data) const
 Finds the index of a result that matches the provided data.
 
void clear ()
 Clears all registration results.
 
void setGroundTruth (int index, bool isGroundTruth)
 Set the ground truth flag on the result at index
 
bool hasGroundTruth () const
 Whether there is at least one result marked as ground truth.
 
void setName (int index, std::string name)
 Set the name of the result at index
 
std::string name (int index) const
 Return the name of result at index
 
Filesystem::Path commonPath ()
 Find the longest common parent path of all the data included in the results.
 
const std::unordered_map< uint64_t, DataSource > & dataSources () const
 
std::optional< std::stringfilename () const
 Name of the file where the results were loaded from (if any)
 
std::optional< Filesystem::PathsourcePath () const
 Path of the file the results were loaded from (if any)
 

Static Public Member Functions

static mat4 getRegistrationMatrix (const Data *d)
 Gets the registration matrix of d
 

Public Attributes

Signal< int > s_resultAdded
 Signal emitted when a new result is added.
 
Signal< int > s_resultChanged
 Signal emitted when a result is changed.
 

Methods for iterating through results

std::vector< Result >::iterator begin ()
 
std::vector< Result >::iterator end ()
 
std::vector< Result >::const_iterator begin () const
 
std::vector< Result >::const_iterator end () const
 

Static methods for scanning a folder for results

static std::vector< RegistrationResultsscanFolder (const Filesystem::Directory &folder)
 
static std::unique_ptr< Threading::StoppableThreadscanFolderAsync (const Filesystem::Directory &folder, std::function< void(std::vector< RegistrationResults >)> callback)
 Recursively scans a folder in a background thread for .irr files.
 

Member Function Documentation

◆ add() [1/2]

void add ( const DataList & datalist,
std::string name = "",
bool isGroundTruth = false,
Properties regAlgConfig = {} )

Adds a new registration result based on the current state of the provided data.

Parameters
datalistList of data to include in the result.
nameName of the result. If empty, a name is generated automatically.
isGroundTruthFlag indicating whether the result is ground truth.
regAlgConfigConfiguration of the registration algorithm used to produce the result.

◆ add() [2/2]

void add ( Result && res)

Add a registration result Duplicates are not allowed by default.

Use setAllowDuplicates if you want to allow them.

◆ remove()

bool remove ( int index)

Removes the registration result at the specified index.

Parameters
indexIndex of the result to remove.
Returns
True if the result was successfully removed, false otherwise.

◆ apply()

DataList apply ( int index)

Applies the registration result at the specified index.

Parameters
indexIndex of the result to apply.
Returns
The list of data objects affected by the application.

◆ configuration()

void configuration ( Properties & prop,
const Filesystem::Path & deformationFilePath = "" ) const

Serialize the list of results into Properties

Parameters
propTarget Properties
deformationFilePathoptional, path to a file where the supporting images for deformations will be stored

◆ configure()

int configure ( const Properties & p,
std::optional< Filesystem::Path > originPath = std::nullopt )

Loads registration results from a Properties object.

Parameters
pSource Properties object.
originPathOptional path to the file the properties originated from of the properties, used for relative paths.
Returns
The number of results loaded.

◆ save()

bool save ( const Filesystem::Path & path,
bool includeDataNames = true ) const

Saves the registration results to an ImFusion Registration Results (IRR) file.

Parameters
pathPath to the target file.
includeNamesWhether to include current data names in the saved data sources
Returns
True if the save operation was successful, false otherwise.

◆ load()

int load ( const Filesystem::Path & path)

Loads registration results from an ImFusion Registration Results (IRR) file.

Parameters
pathPath to the source file.
Returns
The number of results loaded, or -1 on failure.

◆ dataDeleted()

std::vector< int > dataDeleted ( Data * data)

Handles the removal of a data object, updating all affected results.

Parameters
dataPointer to the data being removed.
Returns
A list of indices of affected results.

◆ resolveData()

void resolveData ( const DataList & dataList)

Resolves missing data by searching for it in the provided data list.

Parameters
dataListList of available data.

◆ loadMissingData()

OwningDataList loadMissingData ( int index = -1,
Progress * progress = nullptr )

Loads missing data for the specified result or all results.

Parameters
indexIndex of the result to consider, or -1 to consider all results.
progressOptional progress tracker.
Returns
An owning list of loaded data objects.

◆ findResult()

int findResult ( const DataList & data) const

Finds the index of a result that matches the provided data.

Parameters
dataList of data to match.
Returns
The index of the matching result, or -1 if no match is found.

◆ scanFolder()

static std::vector< RegistrationResults > scanFolder ( const Filesystem::Directory & folder)
static

Recursively scans a folder for .irr files, loads the RegistrationResults from them and returns them

◆ scanFolderAsync()

static std::unique_ptr< Threading::StoppableThread > scanFolderAsync ( const Filesystem::Directory & folder,
std::function< void(std::vector< RegistrationResults >)> callback )
static

Recursively scans a folder in a background thread for .irr files.

Parameters
folderThe folder to scan.
callbackThe callback to call when the scan is finished. Called by the background thread.
Returns
Unique pointer to the thread that is scanning the folder.

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