CTL
0.6.1
Computed Tomography Library
|
The OrthogonalSubsetGenerator class provides an implementation of subset generation considering real geometric orthogonality. More...
#include <orthogonalsubsetgenerator.h>
Classes | |
struct | Candidate |
Public Types | |
enum | { Type = 1011 } |
![]() | |
enum | { Type = 1001 } |
![]() | |
enum | { Type = 1000 } |
![]() | |
enum | { Type = -1, UserType = 65536 } |
Public Member Functions | |
int | type () const override |
OrthogonalSubsetGenerator (uint nbSubsets=1u) | |
Creates an OrthogonalSubsetGenerator that generates nbSubsets subsets. More... | |
void | setSetup (const AcquisitionSetup &setup) override |
Sets the AcquisitionSetup that belongs to the projection data to setup. More... | |
![]() | |
uint | nbSubsets () const |
Returns the number of subsets that are generated. | |
void | setNbSubsets (uint nbSubsets) |
Sets the number of subsets that will be generated to nbSubsets. | |
void | fromVariant (const QVariant &variant) override |
QVariant | toVariant () const override |
![]() | |
virtual void | setProjections (ProjectionDataView projections) |
Sets the projections that this instance shall operate on to projections. More... | |
void | setData (ProjectionDataView projections, const AcquisitionSetup &setup) |
Sets the projections to projections and the corresponding acquisition setup to setup. More... | |
std::vector< ProjectionDataView > | generateSubsets (uint iteration) const |
Generates the subsets for iteration iteration. More... | |
virtual std::vector< std::vector< ProjectionDataView > > | generateAllSubsets (uint nbIterations) |
Convenience method to generate subsets for a certain number of iterations. More... | |
bool | isSubsetPermutationEnabled () const |
Returns true if subset permutation is enabled; false otherwise. | |
const ProjectionDataView & | projections () const |
Returns the ProjectionDataView that has been set via setProjections(). | |
uint | randomGeneratorSeed () const |
Returns the seed that has been used to seed the RNG of this instance. More... | |
void | setRandomGeneratorSeed (uint seed=std::random_device{}()) |
Sets the seed of the RNG to seed and actually seeds the RNG. | |
void | setSubsetPermutationEnabled (bool enabled) |
Sets the use of subset permutation to enabled. More... | |
![]() | |
virtual | ~SerializationInterface ()=default |
Protected Member Functions | |
std::vector< ProjectionDataView > | generateSubsetsImpl (uint iteration) const override |
Implementation of the subset generation routine. More... | |
![]() | |
AbstractFixedSizeSubsetGenerator (uint nbSubsets=1u) | |
Creates an AbstractFixedSizeSubsetGenerator and sets the number of subsets to nbSubsets. | |
![]() | |
AbstractSubsetGenerator () | |
Constructs an AbstractSubsetGenerator. More... | |
AbstractSubsetGenerator (const AbstractSubsetGenerator &)=default | |
AbstractSubsetGenerator (AbstractSubsetGenerator &&)=default | |
AbstractSubsetGenerator & | operator= (const AbstractSubsetGenerator &)=default |
AbstractSubsetGenerator & | operator= (AbstractSubsetGenerator &&)=default |
virtual void | shuffleSubsets (std::vector< ProjectionDataView > &subsets) const |
Randomly permutes the order of the subsets in subsets. More... | |
![]() | |
SerializationInterface ()=default | |
SerializationInterface (const SerializationInterface &)=default | |
SerializationInterface (SerializationInterface &&)=default | |
SerializationInterface & | operator= (const SerializationInterface &)=default |
SerializationInterface & | operator= (SerializationInterface &&)=default |
Private Member Functions | |
ProjectionDataView | createSubset (std::vector< Candidate > &candidates, uint subsetSize) const |
Creates a subset from the data managed by this instance. More... | |
Private Attributes | |
std::vector< mat::Matrix< 3, 1 > > | _directionVectors |
source-to-detector vectors of the latest setup set | |
Friends | |
template<class > | |
struct | SerializationHelper::RegisterWithSerializationHelper |
Additional Inherited Members | |
![]() | |
uint | _nbSubsets = 1u |
![]() | |
ProjectionDataView | _fullProjections = ProjectionDataView::invalidView() |
The projection data view this instance operates on. | |
std::mt19937 | _rng |
random number generator (RNG) instance | |
uint | _rngSeed = 42 |
value used to seed the RNG | |
bool | _permuteSubsets = true |
state variable if subset permutation is enabled | |
![]() | |
std::vector< uint > | subsetSizes (uint nbViews, uint nbSubsets, SubsetArrangement arrangement) |
Convenience helper function that calculates sizes for subsets given the total number of projections nbViews, the requested number of subsets nbSubsets and an arrangement type. More... | |
The OrthogonalSubsetGenerator class provides an implementation of subset generation considering real geometric orthogonality.
This class implements the AbstractFixedSizeSubsetGenerator interface. The number of subsets that shall be generated can be specified in the constructor or later on through setNbSubsets().
The subset generation routine implemented by this class depends on the acquisition geometry referring to the projections that shall be divided into subsets. For that reason, the corresponding AcquisitionSetup needs to be set in advance of generating the subsets. This can be done individually through setSetup() or along with setting projection data using setData().
In order to assign individual views to a particular subset, the degree of orthogonality between the view directions (i.e. the source-to-detector vector) of all views already included in the subset and all remaining candidates (i.e. views from the full projection data that are not yet assigned to any subset) is computed. The candidate maximizing the average orthogonality is then subsequnetly added to the subset under construction and the full procedure is repeated until the required number (subject to the requested number of subsets) of views is reached.
Example: creating two subsets for a set of 18 views from a ShortScanTrajectory
CTL::OrthogonalSubsetGenerator::OrthogonalSubsetGenerator | ( | uint | nbSubsets = 1u | ) |
Creates an OrthogonalSubsetGenerator that generates nbSubsets subsets.
The number of subsets to create may be changed later on through setNbSubsets(). Please note that this subset generator requires a valid AcquisitionSetup that corresponds to the projections that shall be partitioned into subsets before requesting the subsets.
Example: creating four subsets for a set of 36 views from a WobbleTrajectory
|
private |
Creates a subset from the data managed by this instance.
This selects subsetSize views from the list of available candidates, w.r.t. the maximum orthogonality approach described in generateSubsetsImpl().
|
overrideprotectedvirtual |
Implementation of the subset generation routine.
This generates the subsets for the data that have been set through setData() (or individual calls of setSetup() and setProjections()). Please note that setting a valid AcquisitionSetup that corresponds to the projections is required before this method is called (i.e. before requesting the subsets).
Generates the same subsets independent of the iteration input.
The subset generation routine implemented by this class depends on the acquisition geometry referring to the projections that shall be divided into subsets: In order to assign individual views to a particular subset, the degree of orthogonality between the view directions (i.e. the source-to-detector vector) of all views already included in the subset and all remaining candidates (i.e. views from the full projection data that are not yet assigned to any subset) is computed. The candidate maximizing the average orthogonality is then subsequnetly added to the subset under construction and the full procedure is repeated until the required number (subject to the requested number of subsets) of views is reached.
Note that this procedure is solely based on the orthogonality of the direction vectors. This means, in particular, that shifted view positions are not considered at all when determining their information content for the purpose of their assignment to a subset.
Implements CTL::AbstractSubsetGenerator.
|
overridevirtual |
Sets the AcquisitionSetup that belongs to the projection data to setup.
setup must be the AcquisitionSetup that describes the acquisition of the projection data passed to setProjections(). Please note that setup must always represent the full ProjectionData that is managed by the view passed to setProjections(). That means if the ProjectionDataView passed to setProjections() is already a subset, the setup passed here must still refer to the full ProjectionData the view belongs to.
This class extracts only the view directions, i.e. the vector pointing from the source position towards the detector position, from setup.
Reimplemented from CTL::AbstractSubsetGenerator.
|
inlineoverridevirtual |
Returns the type-id of the serializable object. Used in deserialization to determine the proper object type.
Add derived classes to the enumeration using the CTL_TYPE_ID macro.
Reimplemented from CTL::AbstractFixedSizeSubsetGenerator.