ImFusion SDK 4.3
ImFusion::AlgorithmUtils Namespace Reference

Collection of convenience functions to work with ImFusion Algorithms. More...

Detailed Description

Collection of convenience functions to work with ImFusion Algorithms.

Functions

template<typename T>
std::optional< OwningDataListexecute (const DataList &input, const Properties &properties=Properties(), Progress *progress=nullptr)
 Convenience function to instantiate, configure and execute an Algorithm.
 
template<typename T>
std::optional< OwningDataListexecute (const std::vector< SharedImage * > &input, const Properties &properties=Properties(), Progress *progress=nullptr)
 Convenience function to instantiate, configure and execute an Algorithm.
 
template<typename T>
std::optional< OwningDataListexecute (const std::vector< Image * > &input, const Properties &properties=Properties(), Progress *progress=nullptr)
 Convenience function to instantiate, configure and execute an Algorithm.
 
std::optional< OwningDataListexecute (Algorithm &algorithm, Progress *progress=nullptr)
 Convenience function to execute a pre-configured algorithm.
 
std::optional< OwningDataListexecuteBatchedChannels (SharedImageSet &input, std::function< std::optional< OwningDataList >(SharedImageSet *)> func)
 Helper function to run a function that uses OpenGL on images that have potentially more than 4 channels.
 
template<typename T>
std::optional< OwningDataListexecuteBatchedChannels (SharedImageSet &input, const Properties &properties=Properties(), Progress *progress=nullptr)
 Helper function to run an algorithm of type T that uses OpenGL on images that have potentially more than 4 channels.
 
std::string parseAlgorithmName (const std::string &name, std::vector< std::string > *categoriesOut=0)
 Splits a fully qualified algorithm name into category vector and actual algorithm name.
 
std::vector< AlgorithmFactory::DescriptorsortAndAddSeparators (std::vector< AlgorithmFactory::Descriptor > descriptions)
 Sort the given algorithm descriptions such that:
 

Function Documentation

◆ execute() [1/4]

template<typename T>
std::optional< OwningDataList > execute ( const DataList & input,
const Properties & properties = Properties(),
Progress * progress = nullptr )

Convenience function to instantiate, configure and execute an Algorithm.

Note
Due to the other execute() overloads, initializer lists with multiple arguments will yield a compiler error due to ambiguity. In order to resolve this explicitly put the type name in front, i.e. execute(DataList{data1, data2, data3}).
Parameters
inputInput data to instantiate the algorithm with.
propertiesConfiguration to assign to the algorithm prior to execution.
progressOptional pointer to Progress instance to report computation progress.
Template Parameters
TClass name of the algorithm to execute, must implement T::createCompatible().

◆ execute() [2/4]

template<typename T>
std::optional< OwningDataList > execute ( const std::vector< SharedImage * > & input,
const Properties & properties = Properties(),
Progress * progress = nullptr )

Convenience function to instantiate, configure and execute an Algorithm.

Note
Due to the other execute() overloads, initializer lists with multiple arguments will yield a compiler error due to ambiguity. In order to resolve this explicitly put the type name in front, i.e. execute(std::vector<SharedImage*>{si1, si2, si3}).
Parameters
inputInput images to instantiate the algorithm with.
propertiesConfiguration to assign to the algorithm prior to execution.
progressOptional pointer to Progress instance to report computation progress.
Template Parameters
TClass name of the algorithm to execute, must implement T::createCompatible().

◆ execute() [3/4]

template<typename T>
std::optional< OwningDataList > execute ( const std::vector< Image * > & input,
const Properties & properties = Properties(),
Progress * progress = nullptr )

Convenience function to instantiate, configure and execute an Algorithm.

Note
Due to the other execute() overloads, initializer lists with multiple arguments will yield a compiler error due to ambiguity. In order to resolve this explicitly put the type name in front, i.e. execute(std::vector<Image*>{img1, img2, img3}).
Parameters
inputInput data to instantiate the algorithm with.
propertiesConfiguration to assign to the algorithm prior to execution.
progressOptional pointer to Progress instance to report computation progress.
Template Parameters
TClass name of the algorithm to execute, must implement T::createCompatible().

◆ execute() [4/4]

std::optional< OwningDataList > execute ( Algorithm & algorithm,
Progress * progress = nullptr )

Convenience function to execute a pre-configured algorithm.

Parameters
algorithmAlgorithm to execute.
progressOptional pointer to Progress instance to report computation progress.

◆ executeBatchedChannels()

Helper function to run a function that uses OpenGL on images that have potentially more than 4 channels.

The function is assumed to return a new image with the same number of channels as the input, or to work in-place. The input image is split in 4-channels sub-images, on which the algorithm is ran, and the final result is then reassembled.

◆ parseAlgorithmName()

std::string parseAlgorithmName ( const std::string & name,
std::vector< std::string > * categoriesOut = 0 )

Splits a fully qualified algorithm name into category vector and actual algorithm name.

Parameters
nameFully qualified algorithm name
[out]categoriesOptional output vector containing the names of the categories in hierarchical order
Returns
unqualified algorithm name

◆ sortAndAddSeparators()

Sort the given algorithm descriptions such that:

  • Algorithms with the priority flag come first within their own categories.
  • Algorithms with the experimental flag come last within their own categories.
  • Categories are sorted alphabetically and algorithms without categories come before others. Adds an empty algorithm with the name "-" indicating a separator after priority algorithms in each category.
Search Tab / S to search, Esc to close