CortidQCT  1.2.2.52
Classes | Public Types | List of all members
CortidQCT::MeasurementModel Class Reference

Type representing the measurement model. More...

#include <MeasurementModel.h>

Collaboration diagram for CortidQCT::MeasurementModel:
Collaboration graph
[legend]

Public Types

using Label = unsigned int
 Label type.
 

Properties

std::optional< std::string > name
 Optional model name.
 
std::optional< std::string > description
 Optional model description.
 
std::optional< std::string > author
 Optional model author.
 
std::optional< std::string > creationDate
 
float kernelSigma = 1.f
 in-plane kernel width (sigma of gaussian kernel)
 
float sliceSpacing = 1.f
 slice thickness
 
DiscreteRange< float > samplingRange {-2.f, 2.f, 0.1f}
 sampling range for the line sampling
 
DiscreteRange< float > densityRange {-1000.f, 2000.f, 1.f}
 range for the density sampling
 
DiscreteRange< float > angleRange {0.f, 90.f, 1.f}
 range for the angle sampling
 

Construction

 MeasurementModel () noexcept(noexcept(DataStorage()))
 Creates an empty measurement model. More...
 
 MeasurementModel (std::string const &filename)
 Creates a measurement model by loading from a file. More...
 
static MeasurementModel fromFile (std::string const &filename)
 

IO

MeasurementModelloadFromFile (std::string const &filename)
 

Accessors

bool isEmpty () const noexcept
 Returns true iff to model contains to data.
 
auto labels () const
 Returns all valid labels of the model.
 
std::size_t labelCount () const noexcept
 Returns the number of valid labels of the model.
 
double densityScale (Label const &label) const
 Returns the density scale parameter of the given VOI.
 

Raw Data Access

The methods in this section all call a functional with a pointer to raw data as its argument. The pointer is only guaranteed to be valid within the call to the given functional.

Attention
Do not return the row pointer or save it any other way!
template<class F >
auto withUnsafeDataPointer (Label label, F &&f) const
 Calls the given functional with an unsafe pointer to the raw sample data storage. More...
 

Detailed Description

Type representing the measurement model.

A MeasurementModel can currently only be loaded from file.

Constructor & Destructor Documentation

CortidQCT::MeasurementModel::MeasurementModel ( )
inlinenoexcept

Creates an empty measurement model.

  • kernelSigma defaults to 1,
  • sliceSpacing default to 1,
  • samplingRange defaults to [-2, 2] with a stride of 0.1,
  • densityRange defaults to [-1000, 3000] with a stride of 1
  • angleRange defaults to [0, 90] with a stride of 1.
Exceptions
noexceptiff noexcept(DataStorage())
CortidQCT::MeasurementModel::MeasurementModel ( std::string const &  filename)
explicit

Creates a measurement model by loading from a file.

Parameters
filenamepath to model file
See also
loadFromFile

Member Function Documentation

static MeasurementModel CortidQCT::MeasurementModel::fromFile ( std::string const &  filename)
inlinestatic

Returns a model loaded from file

See also
loadFromFile
MeasurementModel & CortidQCT::MeasurementModel::loadFromFile ( std::string const &  filename)

Loads the model from the given file

Parameters
filenamepath to the model file
Exceptions
std::invalid_argumentif the model failed to load
Returns
Reference to the loaded model
template<class F >
auto CortidQCT::MeasurementModel::withUnsafeDataPointer ( Label  label,
F &&  f 
) const
inline

Calls the given functional with an unsafe pointer to the raw sample data storage.

Sample data are stored in order rho, phi, t.

Template Parameters
Ffunction that accepts a double const * pointer as the only argument.
Parameters
labelLabel to retrieve the data pointer for
ffunctional that is called with the raw data pointer as an argument,
Returns
The return value of the functional

Member Data Documentation

std::optional<std::string> CortidQCT::MeasurementModel::creationDate

Optional model creation date

Note
Date is saved as a string. This may change is the future.

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