![]() |
ImFusion SDK 4.3
|
#include <ImFusion/Reg/RegistrationResults.h>
Class responsible for managing and storing the results of data registration. More...
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. | |
| Result & | get (int index) |
Get the result at index | |
| const Result & | get (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::string > | filename () const |
| Name of the file where the results were loaded from (if any) | |
| std::optional< Filesystem::Path > | sourcePath () 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< RegistrationResults > | scanFolder (const Filesystem::Directory &folder) |
| static std::unique_ptr< Threading::StoppableThread > | scanFolderAsync (const Filesystem::Directory &folder, std::function< void(std::vector< RegistrationResults >)> callback) |
Recursively scans a folder in a background thread for .irr files. | |
| 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.
| datalist | List of data to include in the result. |
| name | Name of the result. If empty, a name is generated automatically. |
| isGroundTruth | Flag indicating whether the result is ground truth. |
| regAlgConfig | Configuration of the registration algorithm used to produce the result. |
| void add | ( | Result && | res | ) |
Add a registration result Duplicates are not allowed by default.
Use setAllowDuplicates if you want to allow them.
| bool remove | ( | int | index | ) |
Removes the registration result at the specified index.
| index | Index of the result to remove. |
| DataList apply | ( | int | index | ) |
Applies the registration result at the specified index.
| index | Index of the result to apply. |
| void configuration | ( | Properties & | prop, |
| const Filesystem::Path & | deformationFilePath = "" ) const |
Serialize the list of results into Properties
| prop | Target Properties |
| deformationFilePath | optional, path to a file where the supporting images for deformations will be stored |
| int configure | ( | const Properties & | p, |
| std::optional< Filesystem::Path > | originPath = std::nullopt ) |
Loads registration results from a Properties object.
| p | Source Properties object. |
| originPath | Optional path to the file the properties originated from of the properties, used for relative paths. |
| bool save | ( | const Filesystem::Path & | path, |
| bool | includeDataNames = true ) const |
Saves the registration results to an ImFusion Registration Results (IRR) file.
| path | Path to the target file. |
| includeNames | Whether to include current data names in the saved data sources |
| int load | ( | const Filesystem::Path & | path | ) |
Loads registration results from an ImFusion Registration Results (IRR) file.
| path | Path to the source file. |
| std::vector< int > dataDeleted | ( | Data * | data | ) |
Handles the removal of a data object, updating all affected results.
| data | Pointer to the data being removed. |
| void resolveData | ( | const DataList & | dataList | ) |
Resolves missing data by searching for it in the provided data list.
| dataList | List of available data. |
| OwningDataList loadMissingData | ( | int | index = -1, |
| Progress * | progress = nullptr ) |
Loads missing data for the specified result or all results.
| index | Index of the result to consider, or -1 to consider all results. |
| progress | Optional progress tracker. |
| int findResult | ( | const DataList & | data | ) | const |
Finds the index of a result that matches the provided data.
| data | List of data to match. |
|
static |
Recursively scans a folder for .irr files, loads the RegistrationResults from them and returns them
|
static |
Recursively scans a folder in a background thread for .irr files.
| folder | The folder to scan. |
| callback | The callback to call when the scan is finished. Called by the background thread. |