CTL
0.6.1
Computed Tomography Library
|
Simple class that holds the layout of a multi module detector. More...
#include <modulelayout.h>
Public Member Functions | |
ModuleLayout (uint nbRows=0, uint nbCols=0) | |
int & | operator() (uint row, uint col) |
const int & | operator() (uint row, uint col) const |
uint | columns () const |
uint | rows () const |
uint | nbNonEmptyModules () const |
Returns the number of entries that is larger than zero. More... | |
bool | isEmpty () const |
bool | hasUniqueIndices () const |
Returns true if all indices in this instance appear at maximum once. | |
int | largestModuleIdx () const |
Returns the largest module index in this layout or -1 if the layout is empty. | |
std::vector< uint > | uniqueIndices () const |
Returns a set (i.e. no repetitions) of all indices appearing in this layout. Does not list negative values (i.e. gaps) if they should appear in the layout. | |
Static Public Member Functions | |
static ModuleLayout | canonicLayout (uint nbRows, uint nbCols, bool rowMajorOrder=true) |
Private Attributes | |
uint | _rows |
The number of rows in the layout. | |
uint | _cols |
The number of columns in the layout. | |
std::vector< int > | _layout |
The internal data vector. | |
Simple class that holds the layout of a multi module detector.
The ModuleLayout class stores the layout of a detector that consists of multiple individual flat panel modules. That means it holds the information about the arrangement of the individual modules on the entire detector unit. For means of simplicity, this is limited to arrangement patterns with a rectangular grid shape.
A ModuleLayout is required if you want to combine projection data of individual modules to a single projection. This can be done using SingleViewData::combined().
To define a layout, the number of rows and columns of the grid need to be specified. Then, for each position on the grid, the index of the flat panel module that is located at that spot must be defined. This information is stored internally in a std::vector<int> with row-major order. Negative module indices can be used to define gaps in the layout (see also SingleViewData::combined()).
For simple arrangements, the convenience factory method canonicLayout() can be used to easily create the corresponding ModuleLayout.
Constructs a ModuleLayout object for a module arrangement with nbRows rows and nbCols columns. The entire layout is initialized with index -1. Use operator() to assign module indices to the layout positions.
For simple layouts, consider using canonicLayout() for easy construction.
|
static |
Constructs and returns a ModuleLayout object for a module arrangement with nbRows rows and nbCols columns. The layout is initialized with increasing module index across the layout. By default, this will be done in row mayor order. To change this behavior to column major order, set rowMajorOrder to false
.
uint CTL::ModuleLayout::columns | ( | ) | const |
Returns the number of columns in the layout.
bool CTL::ModuleLayout::isEmpty | ( | ) | const |
Returns true if either the number of rows or columns in this layout is zero.
uint CTL::ModuleLayout::nbNonEmptyModules | ( | ) | const |
Returns the number of entries that is larger than zero.
This refers to the number of modules not considered a gap (negative index value).
Returns a (modifiable) reference to the module index at layout position [row, col].
Returns a constant reference to the module index at layout position [row, col].
uint CTL::ModuleLayout::rows | ( | ) | const |
Returns the number of rows in the layout.