CTL
0.6.1
Computed Tomography Library
|
The SimpleSubsetGenerator class provides an implementation of subset generation featuring a few simple options. More...
#include <simplesubsetgenerator.h>
Public Types | |
enum | { Type = 1010 } |
enum | Order { Random, Adjacent, Orthogonal180, Orthogonal360 } |
![]() | |
enum | { Type = 1001 } |
![]() | |
enum | { Type = 1000 } |
![]() | |
enum | { Type = -1, UserType = 65536 } |
Public Member Functions | |
int | type () const override |
SimpleSubsetGenerator (uint nbSubsets=1, Order subsetOrder=Random) | |
Creates a SimpleSubsetGenerator that generates nbSubsets subsets according to the creation pattern subsetOrder. More... | |
void | setOrder (Order order) |
Sets the order used for selecting views for a subset to order. More... | |
void | fromVariant (const QVariant &variant) override |
QVariant | toVariant () const override |
![]() | |
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. | |
![]() | |
virtual void | setSetup (const AcquisitionSetup &) |
Sets the AcquisitionSetup that belongs to the projection data to setup. More... | |
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 | |
std::vector< ProjectionDataView > | makeRandomSubsets (const std::vector< uint > &subsetSizes) const |
Creates subsets based on random selection of views. More... | |
std::vector< ProjectionDataView > | makeAdjacentSubsets (const std::vector< uint > &subsetSizes) const |
Creates subsets taking adjacent blocks of views into a subset. More... | |
std::vector< ProjectionDataView > | makeOrthogonalSubsets (const std::vector< uint > &subsetSizes) const |
Creates subsets based on the assumption of a circular scan orbit. More... | |
Static Private Member Functions | |
static QMetaEnum | metaEnum () |
QMetaEnum object used to decode/encode subset order enum values. | |
Private Attributes | |
Order | _order = Random |
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 SimpleSubsetGenerator class provides an implementation of subset generation featuring a few simple options.
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().
All provided subset generation routines in this class are independent of the acquisition geometry. Instead, simple strategies (such as random selection) or basic assumptions on the geometry (e.g. 360 degree circle) are used. Four different 'creation patterns' are available for the generation of subsets:
The creation pattern (or the order in which views are selected for participation in a subset) can be specified in the constructor or later on through setOrder(). All creation patterns ensure that each view appears only once in the entire set of subsets.
Example:
Enumeration for subset selection orders.
The selection order decides which views will end up in a particular subset.
|
explicit |
Creates a SimpleSubsetGenerator that generates nbSubsets subsets according to the creation pattern subsetOrder.
Example:
|
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:
Reimplemented from CTL::AbstractFixedSizeSubsetGenerator.
|
overrideprotectedvirtual |
Implementation of the subset generation routine.
This generates the subsets for the data that have been set through setProjections() (or setData()). Generates the same subsets independent of the iteration input.
The generation pattern used depends on the mode selected in the constructor or through setOrder():
Example:
Implements CTL::AbstractSubsetGenerator.
|
private |
Creates subsets taking adjacent blocks of views into a subset.
Ensures that each view appears only once in the entire set of subsets.
|
private |
Creates subsets based on the assumption of a circular scan orbit.
Assumes a total scan range of either 180 or 360 degrees, depending on what has been specified as order for the subsets (see setOrder()).
Ensures that each view appears only once in the entire set of subsets.
|
private |
Creates subsets based on random selection of views.
Ensures that each view appears only once in the entire set of subsets.
void CTL::SimpleSubsetGenerator::setOrder | ( | SimpleSubsetGenerator::Order | order | ) |
Sets the order used for selecting views for a subset to order.
The following options of subset generation patterns are available:
Examples: see generateSubsetsImpl().
|
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:
Reimplemented from CTL::AbstractFixedSizeSubsetGenerator.
|
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.