CTL  0.6.1
Computed Tomography Library
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
CTL::TransitionSchemeExtension Class Reference

The TransitionSchemeExtension class is a decorator for subset generators enabling a transition from many small subsets to a few larger ones with increasing iteration. More...

#include <transitionschemeextension.h>

Inheritance diagram for CTL::TransitionSchemeExtension:
Inheritance graph
[legend]
Collaboration diagram for CTL::TransitionSchemeExtension:
Collaboration graph
[legend]

Public Types

enum  { Type = 1100 }
 
- Public Types inherited from CTL::AbstractSubsetGenerator
enum  { Type = 1000 }
 
- Public Types inherited from CTL::SerializationInterface
enum  { Type = -1, UserType = 65536 }
 

Public Member Functions

int type () const override
 
 TransitionSchemeExtension (AbstractFixedSizeSubsetGenerator *nestedGenerator)
 Creates a TransitionSchemeExtension using nestedGenerator as actual subset generator. More...
 
 TransitionSchemeExtension (std::unique_ptr< AbstractFixedSizeSubsetGenerator > nestedGenerator)
 Creates a TransitionSchemeExtension using nestedGenerator as actual subset generator. More...
 
virtual void setSetup (const AcquisitionSetup &setup) override
 Sets the AcquisitionSetup that belongs to the projection data to setup. More...
 
virtual void setProjections (ProjectionDataView projections) override
 Sets the projections that this instance shall operate on to projections. More...
 
void fromVariant (const QVariant &variant) override
 
QVariant toVariant () const override
 
void setTransitionPeriod (uint transitionEveryNIterations)
 Sets the transition period (i.e. the number of iterations after which the subset count is cut in half) to transitionEveryNIterations. More...
 
void setMaximumNbSubsets (uint maxNbSubsets)
 Sets the maximum number of subsets generated to maxNbSubsets. More...
 
void setMinimumNbSubsets (uint minNbSubsets)
 Sets the minimum number of subsets generated to minNbSubsets. More...
 
void setSubsetBounds (uint initialNbSubsets, uint finalNbSubsets)
 Sets the number of subsets in the beginning (early iterations) and at the end of transitions (late iterations) to initialNbSubsets and finalNbSubsets, respectively. More...
 
void setSubsetGenerator (AbstractFixedSizeSubsetGenerator *nestedGenerator)
 Sets the nested subset generator to nestedGenerator; deleted previous one. More...
 
void setSubsetGenerator (std::unique_ptr< AbstractFixedSizeSubsetGenerator > nestedGenerator)
 Sets the nested subset generator to nestedGenerator; deleted previous one. More...
 
- Public Member Functions inherited from CTL::AbstractSubsetGenerator
void setData (ProjectionDataView projections, const AcquisitionSetup &setup)
 Sets the projections to projections and the corresponding acquisition setup to setup. More...
 
std::vector< ProjectionDataViewgenerateSubsets (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 ProjectionDataViewprojections () 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...
 
- Public Member Functions inherited from CTL::SerializationInterface
virtual ~SerializationInterface ()=default
 

Protected Member Functions

std::vector< ProjectionDataViewgenerateSubsetsImpl (uint iteration) const override
 Implementation of the wrapper for the subset generation routine. More...
 
virtual uint numberOfSubsets (uint iteration) const
 Computes the number of subsets that shall be generated for iteration nb. \iteration. More...
 
void shuffleSubsets (std::vector< ProjectionDataView > &subsets) const override
 Randomly permutes the order of the subsets in subsets. More...
 
- Protected Member Functions inherited from CTL::AbstractSubsetGenerator
 AbstractSubsetGenerator ()
 Constructs an AbstractSubsetGenerator. More...
 
 AbstractSubsetGenerator (const AbstractSubsetGenerator &)=default
 
 AbstractSubsetGenerator (AbstractSubsetGenerator &&)=default
 
AbstractSubsetGeneratoroperator= (const AbstractSubsetGenerator &)=default
 
AbstractSubsetGeneratoroperator= (AbstractSubsetGenerator &&)=default
 
- Protected Member Functions inherited from CTL::SerializationInterface
 SerializationInterface ()=default
 
 SerializationInterface (const SerializationInterface &)=default
 
 SerializationInterface (SerializationInterface &&)=default
 
SerializationInterfaceoperator= (const SerializationInterface &)=default
 
SerializationInterfaceoperator= (SerializationInterface &&)=default
 

Protected Attributes

std::unique_ptr< AbstractFixedSizeSubsetGenerator_nestedGen
 
uint _minNbSubsets = 1u
 
uint _maxNbSubsets = 0u
 
uint _transitionPeriod = 1u
 
- Protected Attributes inherited from CTL::AbstractSubsetGenerator
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
 

Friends

template<class >
struct SerializationHelper::RegisterWithSerializationHelper
 

Detailed Description

The TransitionSchemeExtension class is a decorator for subset generators enabling a transition from many small subsets to a few larger ones with increasing iteration.

This class extends the capabilities of a subset generator (henceforth also referred to as the nested generator) by taking control of the number of subsets the nested generator creates for a particular iteration. In doing so, this extension provides a means to generate subsets of increasing size for consecutive iterations. To be more specific, subset generation starts with a given upper bound for the number of subsets (see setMaximumNbSubsets()) and uses the nested generator to generate that particular amount of subsets for the first iteration. After a defined number of iterations (see setTransitionPeriod()), the number of subsets will be halved, resulting in fewer but larger subsets for the upcoming iteration/s. This procedure of cutting the number of subsets in half is repeated until a defined lower bound of subsets (see setMinimumNbSubsets()) is reached. For convenience, initial and final subset sizes can also be be specified in terms of bounds (see setSubsetsBounds()), offering a combined setter for the number of subsets to be created in the two opposing limits (i.e. largest and smallest number of subsets).

The number of subsets \( N \) generated in a particular iteration \( i \), can be expressed as follows (given the maximum and minimum subset count as \( N_{max}\) and \( N_{min}\), as well as the transition period \( T \)):

\[ \def\lf{\left\lfloor} \def\rf{\right\rfloor} N(i) = \max \left(\lf N_{max} / 2^{\lf i / T \rf} \rf, N_{min} \right) \]

The following special cases exist:

\( \begin{align*} T &== 0 \to T = N_{proj} \\ N_{max} &== 0 \to N_{max} = N_{proj} \end{align*} \)

where \( N_{proj} \) denotes the total number of projections in the data set to this instance.

To be functional, this extension needs an actual subset generator to be set (during construction; exchangeable later on through setSubsetGenerator()). Depending on the requirements of the nested generator, the extension does or does not need the AcquisitionSetup that corresponds to the projections that shall be partitioned (see setSetup()). Please refer to the documentation of the specific generator for details on that aspect.

Example:

// create dummy projection data (sizes entirely arbitrary, and irrelevant here)
ProjectionData dummy(1,1,1);
dummy.allocateMemory(40); // 'dummy' now contains 40 views
// create the nested generator: a SimpleSubsetGenerator with generation pattern 'Adjacent'
auto nestedGen = new SimpleSubsetGenerator;
nestedGen->setOrder(SimpleSubsetGenerator::Adjacent);
// NOTE: we could set a number of subsets to 'nestedGen', but it would have no effect anyways
// nestedGen->setNbSubsets(3); // if you uncomment this line, nothing changes in the results
// create our TransitionSchemeExtension 'on top' of the nested generator
// NOTE: 'subsetGen' takes ownership of 'nestedGen'
TransitionSchemeExtension subsetGen(nestedGen);
// here, we specify our desired number of subsets: starting with 4 subsets and finishing with 1
subsetGen.setSubsetBounds(4,1);
// pass the dummy projection data
// NOTE: the nested generator (SimpleSubsetGenerator) does not need an AcquisitionSetup to be set
subsetGen.setProjections(dummy);
// generate (and inspect) subsets for the first 4 iterations
for(uint it = 0; it < 4; ++it)
{
const auto subsets = subsetGen.generateSubsets(it);
qInfo() << "Iteration" << it << "with" << subsets.size() << "subset(s)";
// print the ids of the views included in the two subsets
for(const auto& subset : subsets)
qInfo() << subset.viewIds();
}
// output:
// Iteration 0 with 4 subset(s)
// std::vector(20, 21, 22, 23, 24, 25, 26, 27, 28, 29)
// std::vector(30, 31, 32, 33, 34, 35, 36, 37, 38, 39)
// std::vector(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
// std::vector(10, 11, 12, 13, 14, 15, 16, 17, 18, 19)
// Iteration 1 with 2 subset(s)
// std::vector(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19)
// std::vector(20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39)
// Iteration 2 with 1 subset(s)
// std::vector(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39)
// Iteration 3 with 1 subset(s)
// std::vector(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39)

Constructor & Destructor Documentation

◆ TransitionSchemeExtension() [1/2]

CTL::TransitionSchemeExtension::TransitionSchemeExtension ( AbstractFixedSizeSubsetGenerator nestedGenerator)
explicit

Creates a TransitionSchemeExtension using nestedGenerator as actual subset generator.

This instance takes ownership of nestedGenerator.

Make sure to set projection data (see setProjections()) and - if required by the nested generator

  • also the acquisition setup (see setSetup()) before using this instance for subset generation. It is not required to call setData() (or corresponding individual setters) separately on the nested generator. The required calls will be passed to the nested generator when calling the corresponding methods of this instance.

The default subset size parameters are as follows:

  • transition period: 1
  • maximum nb. subsets: 0 (i.e. unlimited; uses full nb. of available projections)
  • minimum nb. subsets: 1

◆ TransitionSchemeExtension() [2/2]

CTL::TransitionSchemeExtension::TransitionSchemeExtension ( std::unique_ptr< AbstractFixedSizeSubsetGenerator nestedGenerator)
explicit

Creates a TransitionSchemeExtension using nestedGenerator as actual subset generator.

Make sure to set projection data (see setProjections()) and - if required by the nested generator

  • also the acquisition setup (see setSetup()) before using this instance for subset generation. It is not required to call setData() (or corresponding individual setters) separately on the nested generator. The required calls will be passed to the nested generator when calling the corresponding methods of this instance.

The default subset size parameters are as follows:

  • transition period: 1
  • maximum nb. subsets: 0 (i.e. unlimited; uses full nb. of available projections)
  • minimum nb. subsets: 1

Member Function Documentation

◆ fromVariant()

void CTL::TransitionSchemeExtension::fromVariant ( const QVariant &  variant)
overridevirtual

Interface to read all member variables from the QVariant variant.

Reimplement this method such that it reads all newly introduced content when sub-classing. A typical reimplementation in sub-classes might look like this:

DirectBaseClass::fromVariant(variant);
// assuming our class has a member "double _myMemberVariable"
_myMemberVariable = variant.toMap().value("my member variable").toDouble();

Reimplemented from CTL::AbstractSubsetGenerator.

◆ generateSubsetsImpl()

std::vector< ProjectionDataView > CTL::TransitionSchemeExtension::generateSubsetsImpl ( uint  iteration) const
overrideprotectedvirtual

Implementation of the wrapper for the subset generation routine.

This wraps the call to generateSubsetsImpl() of the nested subset generator. Before passing the call to the nested generator, its number of subsets is set according to the iteration.

For more details on how the subset sizes for a particular iteration are constructed, please refer to the detailed class description or the related setters.

See also
setTransitionPeriod(), setMaximumNbSubsets(), setMinimumNbSubsets(), setSubsetBounds().

Implements CTL::AbstractSubsetGenerator.

◆ numberOfSubsets()

uint CTL::TransitionSchemeExtension::numberOfSubsets ( uint  iteration) const
protectedvirtual

Computes the number of subsets that shall be generated for iteration nb. \iteration.

The number of subsets \( N \) generated in a particular iteration \( i \), can be expressed as follows (given the maximum and minimum subset count as \( N_{max}\) and \( N_{min}\), as well as the transition period \( T \)):

\[ \def\lf{\left\lfloor} \def\rf{\right\rfloor} N(i) = \max \left(\lf N_{max} / 2^{\lf i / T \rf} \rf, N_{min} \right) \]

The following special cases exist:

\( \begin{align*} T &== 0 \to T = N_{proj} \\ N_{max} &== 0 \to N_{max} = N_{proj} \end{align*} \)

where \( N_{proj} \) denotes the total number of projections in the data set to this instance.

◆ setMaximumNbSubsets()

void CTL::TransitionSchemeExtension::setMaximumNbSubsets ( uint  maxNbSubsets)

Sets the maximum number of subsets generated to maxNbSubsets.

The maximum number of subsets refers to the amount of subsets generated in the first iterations (i.e. before the first transition takes place). If maxNbSubsets = 0, the maximum number of subsets that is generated will be set to the total number of projections available in the data that has been set; thus, resulting in subsets containing a single view each. The default value is 0.

A formal description of the procedure can be found in the detailed class description and in numberOfSubsets().

Example:

// create dummy projection data with 10 views
ProjectionData dummy(1,1,1);
dummy.allocateMemory(10);
// create a TransitionSchemeExtension 'on top' of a SimpleSubsetGenerator
TransitionSchemeExtension subsetGen(new SimpleSubsetGenerator);
// here, we specify the maximum number of subsets to be 6
subsetGen.setMaximumNbSubsets(6);
// pass the dummy projection data
subsetGen.setProjections(dummy);
// generate (and inspect) subsets for the first 4 iterations
for(uint it = 0; it < 4; ++it)
{
const auto subsets = subsetGen.generateSubsets(it);
qInfo() << "Iteration" << it << "with" << subsets.size() << "subset(s)";
// print the ids of the views included in the two subsets
for(const auto& subset : subsets)
qInfo() << subset.viewIds();
}
// output:
// Iteration 0 with 6 subset(s)
// std::vector(2, 1)
// std::vector(8)
// std::vector(7)
// std::vector(9, 4)
// std::vector(0, 3)
// std::vector(5, 6)
// Iteration 1 with 3 subset(s)
// std::vector(7, 4, 8, 3)
// std::vector(6, 1, 0)
// std::vector(9, 2, 5)
// Iteration 2 with 1 subset(s)
// std::vector(2, 5, 1, 9, 4, 6, 8, 0, 3, 7)
// Iteration 3 with 1 subset(s)
// std::vector(1, 0, 4, 6, 7, 8, 2, 5, 3, 9)

◆ setMinimumNbSubsets()

void CTL::TransitionSchemeExtension::setMinimumNbSubsets ( uint  minNbSubsets)

Sets the minimum number of subsets generated to minNbSubsets.

The minimum number of subsets refers to the lowest number of subsets generated in 'late' iterations (i.e. after enough transitions have taken place to lower the number of subsets to this level). If minNbSubsets = 1, all available projections will eventually end up in a single subset.

minNbSubsets must be larger than zero.

A formal description of the procedure can be found in the detailed class description and in numberOfSubsets().

Example:

// create dummy projection data with 8 views
ProjectionData dummy(1,1,1);
dummy.allocateMemory(8);
// create a TransitionSchemeExtension 'on top' of a SimpleSubsetGenerator
TransitionSchemeExtension subsetGen(new SimpleSubsetGenerator);
// here, we specify the minimum number of subsets to be 3
subsetGen.setMinimumNbSubsets(3);
// pass the dummy projection data
subsetGen.setProjections(dummy);
// generate (and inspect) subsets for the first 4 iterations
for(uint it = 0; it < 4; ++it)
{
const auto subsets = subsetGen.generateSubsets(it);
qInfo() << "Iteration" << it << "with" << subsets.size() << "subset(s)";
// print the ids of the views included in the two subsets
for(const auto& subset : subsets)
qInfo() << subset.viewIds();
}
// output:
// Iteration 0 with 8 subset(s)
// std::vector(5)
// std::vector(0)
// std::vector(2)
// std::vector(4)
// std::vector(6)
// std::vector(7)
// std::vector(1)
// std::vector(3)
// Iteration 1 with 4 subset(s)
// std::vector(7, 2)
// std::vector(3, 4)
// std::vector(1, 0)
// std::vector(5, 6)
// Iteration 2 with 3 subset(s)
// std::vector(6, 4)
// std::vector(7, 0, 2)
// std::vector(3, 5, 1)
// Iteration 3 with 3 subset(s)
// std::vector(0, 7, 3)
// std::vector(6, 5)
// std::vector(4, 1, 2)

◆ setProjections()

void CTL::TransitionSchemeExtension::setProjections ( ProjectionDataView  projections)
overridevirtual

Sets the projections that this instance shall operate on to projections.

This takes a ProjectionDataView to efficiently create subsets without overhead of data copies. Note that the underlying ProjectionData (i.e. the ones the view refers to) must remain valid throughout the entire use time of this instance. That means that all subsets created by this instance (w.r.t. the data from projections) are valid only as long as the ProjectionData projections refers to is valid.

This directly passes the call to the nested generator.

Reimplemented from CTL::AbstractSubsetGenerator.

◆ setSetup()

void CTL::TransitionSchemeExtension::setSetup ( const AcquisitionSetup setup)
overridevirtual

Sets the AcquisitionSetup that belongs to the projection data to setup.

Whether or not setting the AcquisitionSetup is required, depends on the nested subset generator that is used. Please refer to the documentation of the nested subset generator for details.

This directly passes the call to the nested generator.

Reimplemented from CTL::AbstractSubsetGenerator.

◆ setSubsetBounds()

void CTL::TransitionSchemeExtension::setSubsetBounds ( uint  initialNbSubsets,
uint  finalNbSubsets 
)

Sets the number of subsets in the beginning (early iterations) and at the end of transitions (late iterations) to initialNbSubsets and finalNbSubsets, respectively.

This is a convenience method that is a combined call to setMaximumNbSubsets(initialNbSubsets) and setMinimumNbSubsets(finalNbSubsets);

A formal description of the procedure can be found in the detailed class description and in numberOfSubsets().

Example:

// create dummy projection data with 8 views
ProjectionData dummy(1,1,1);
dummy.allocateMemory(10);
// create a TransitionSchemeExtension 'on top' of a SimpleSubsetGenerator
TransitionSchemeExtension subsetGen(new SimpleSubsetGenerator);
// here, we specify the subset bound to transition from 6 (start) to 2 subsets (end)
subsetGen.setSubsetBounds(6, 2);
// pass the dummy projection data
subsetGen.setProjections(dummy);
// generate (and inspect) subsets for the first 4 iterations
for(uint it = 0; it < 4; ++it)
{
const auto subsets = subsetGen.generateSubsets(it);
qInfo() << "Iteration" << it << "with" << subsets.size() << "subset(s)";
// print the ids of the views included in the two subsets
for(const auto& subset : subsets)
qInfo() << subset.viewIds();
}
// output:
// Iteration 0 with 6 subset(s)
// std::vector(2, 1)
// std::vector(8)
// std::vector(7)
// std::vector(9, 4)
// std::vector(0, 3)
// std::vector(5, 6)
// Iteration 1 with 3 subset(s)
// std::vector(7, 4, 8, 3)
// std::vector(6, 1, 0)
// std::vector(9, 2, 5)
// Iteration 2 with 2 subset(s)
// std::vector(2, 5, 1, 9, 4)
// std::vector(6, 8, 0, 3, 7)
// Iteration 3 with 2 subset(s)
// std::vector(0, 5, 7, 4, 6)
// std::vector(3, 8, 2, 9, 1)

◆ setSubsetGenerator() [1/2]

void CTL::TransitionSchemeExtension::setSubsetGenerator ( AbstractFixedSizeSubsetGenerator nestedGenerator)

Sets the nested subset generator to nestedGenerator; deleted previous one.

This replaces the previous nested subset generator by nestedGenerator. This instance takes ownership of nestedGenerator and deletes the previous generator.

nestedGenerator must not be nullptr.

Note that any previous call to setData() (or setProjections() / setSetup()) needs to be repeated after replacing the subset generator by means of this method. Please also pay attention of any potential differences in the requirements of the newly installed nested generator (such as requirement of the AcquisitionSetup etc.).

◆ setSubsetGenerator() [2/2]

void CTL::TransitionSchemeExtension::setSubsetGenerator ( std::unique_ptr< AbstractFixedSizeSubsetGenerator nestedGenerator)

Sets the nested subset generator to nestedGenerator; deleted previous one.

This replaces the previous nested subset generator by nestedGenerator.

nestedGenerator must not be nullptr.

Note that any previous call to setData() (or setProjections() / setSetup()) needs to be repeated after replacing the subset generator by means of this method. Please also pay attention of any potential differences in the requirements of the newly installed nested generator (such as requirement of the AcquisitionSetup etc.).

◆ setTransitionPeriod()

void CTL::TransitionSchemeExtension::setTransitionPeriod ( uint  transitionEveryNIterations)

Sets the transition period (i.e. the number of iterations after which the subset count is cut in half) to transitionEveryNIterations.

The transition period is the number of iterations after which the number of generated subsets is cut in half (rounded down). If the result of cutting the number in half deceeds the minimum number of subsets specified for this instance, the minimum value will be used instead (and thus, remains constant for all following iterations).

The number of subsets \( N \) generated in a particular iteration \( i \), can be expressed as follows (given the maximum and minimum subset count as \( N_{max}\) and \( N_{min}\), as well as the transition period \( T \)):

\[ \def\lf{\left\lfloor} \def\rf{\right\rfloor} N(i) = \max \left(\lf N_{max} / 2^{\lf i / T \rf} \rf, N_{min} \right) \]

The following special cases exist:

\( \begin{align*} T &== 0 \to T = N_{proj} \\ N_{max} &== 0 \to N_{max} = N_{proj} \end{align*} \)

where \( N_{proj} \) denotes the total number of projections in the data set to this instance.

Example:

// create dummy projection data with 20 views
ProjectionData dummy(1,1,1);
dummy.allocateMemory(20);
// create a TransitionSchemeExtension 'on top' of a SimpleSubsetGenerator
TransitionSchemeExtension subsetGen(new SimpleSubsetGenerator);
// here, we specify the maximum number of subsets to be 5
subsetGen.setMaximumNbSubsets(5);
// we now set the desired transition period to 2, i.e. the number of subsets halves every 2 iterations
subsetGen.setTransitionPeriod(2);
// pass the dummy projection data
subsetGen.setProjections(dummy);
// generate (and inspect) subsets for the first 6 iterations
for(uint it = 0; it < 6; ++it)
{
const auto subsets = subsetGen.generateSubsets(it);
qInfo() << "Iteration" << it << "with" << subsets.size() << "subset(s)";
// print the ids of the views included in the two subsets
for(const auto& subset : subsets)
qInfo() << subset.viewIds();
}
// output:
// Iteration 0 with 5 subset(s)
// std::vector(11, 3, 18, 12)
// std::vector(0, 15, 9, 5)
// std::vector(19, 1, 6, 8)
// std::vector(16, 7, 14, 4)
// std::vector(13, 10, 2, 17)
// Iteration 1 with 5 subset(s)
// std::vector(4, 9, 17, 18)
// std::vector(15, 6, 10, 7)
// std::vector(1, 19, 16, 5)
// std::vector(13, 3, 11, 0)
// std::vector(12, 2, 8, 14)
// Iteration 2 with 2 subset(s)
// std::vector(4, 0, 10, 11, 19, 15, 1, 12, 3, 5)
// std::vector(9, 13, 2, 18, 16, 7, 6, 17, 8, 14)
// Iteration 3 with 2 subset(s)
// std::vector(11, 10, 3, 9, 16, 13, 14, 7, 8, 1)
// std::vector(12, 5, 17, 19, 6, 15, 0, 18, 4, 2)
// Iteration 4 with 1 subset(s)
// std::vector(18, 15, 4, 16, 12, 19, 6, 17, 8, 3, 14, 10, 13, 2, 5, 0, 1, 7, 11, 9)
// Iteration 5 with 1 subset(s)
// std::vector(1, 10, 12, 15, 6, 16, 0, 19, 11, 2, 4, 8, 14, 17, 5, 9, 13, 7, 18, 3)

◆ shuffleSubsets()

void CTL::TransitionSchemeExtension::shuffleSubsets ( std::vector< ProjectionDataView > &  subsets) const
overrideprotectedvirtual

Randomly permutes the order of the subsets in subsets.

This permutes the order in which subsets appear in subsets. Uses std::shuffle in combination with the RNG member of this class.

Shuffling subset order may be beneficial in iterative reconstructions to avoid image artifacts as a result of (overly) structured update schemes.

This method override ensures that shuffling is only performed once. That means if both, the nested generator and this instance itself, have shuffling enabled (see isSubsetPermutationEnabled()), only the shuffling of the nested generator is performed.

Reimplemented from CTL::AbstractSubsetGenerator.

◆ toVariant()

QVariant CTL::TransitionSchemeExtension::toVariant ( ) const
overridevirtual

Interface to store all member variables in a QVariant.

Stores the object's type-id.

Reimplement this method such that it stores all newly introduced object data when sub-classing. This needs to cover everything that is necessary to fully determine the state of an object. Best practice is to invoke the base class version of this method to take care of all content originating from underlying base classes.

A typical reimplementation in sub-classes might look like this:

QVariantMap ret = DirectBaseClass::toVariant().toMap();
ret.insert("my member variable", _myMemberVariable);
return ret;

Reimplemented from CTL::AbstractSubsetGenerator.

◆ type()

int CTL::TransitionSchemeExtension::type ( ) const
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::AbstractSubsetGenerator.


The documentation for this class was generated from the following files: