Line data Source code
1 : #pragma once 2 : 3 : #include "DataDescriptor.h" 4 : 5 : namespace elsa 6 : { 7 : 8 : /** 9 : * @brief Class representing metadata for linearized n-dimensional signal stored in memory 10 : * 11 : * @author Matthias Wieczorek - initial code 12 : * @author Tobias Lasser - modularization, modernization 13 : * @author Maximilian Hornung - various enhancements 14 : * @author David Frank - inheritance restructuring 15 : * 16 : * This class provides metadata about a signal that is stored in memory (typically a 17 : * DataContainer). This signal can be n-dimensional, and will be stored in memory in a 18 : * linearized fashion. 19 : */ 20 : class VolumeDescriptor : public DataDescriptor 21 : { 22 : public: 23 : /// delete default constructor (having no metadata is invalid) 24 : VolumeDescriptor() = delete; 25 : 26 : /// default destructor 27 216697 : ~VolumeDescriptor() override = default; 28 : 29 : /** 30 : * @brief Constructor for DataDescriptor, accepts vector for coefficients per dimensions 31 : * 32 : * @param[in] numberOfCoefficientsPerDimension vector containing the number of coefficients 33 : * per dimension, (dimension is set implicitly from the size of the vector) 34 : * 35 : * @throw InvalidArgumentError if any number of coefficients is non-positive 36 : */ 37 : explicit VolumeDescriptor(IndexVector_t numberOfCoefficientsPerDimension); 38 : 39 : /** 40 : * @brief Constructs VolumeDescriptor from initializer list for the coefficients per 41 : * dimensions 42 : * 43 : * @param[in] numberOfCoefficientsPerDimension initializer list containing the number of 44 : * coefficients per dimension (dimension is set implicitly from the size of the list) 45 : * 46 : * @throw InvalidArgumentError if any number of coefficients is non-positive 47 : */ 48 : explicit VolumeDescriptor(std::initializer_list<index_t> numberOfCoefficientsPerDimension); 49 : 50 : /** 51 : * @brief Constructor for DataDescriptor, accepts vectors for coefficients and spacing 52 : * 53 : * @param[in] numberOfCoefficientsPerDimension vector containing the number of coefficients 54 : * per dimension, (dimension is set implicitly from the size of the vector) 55 : * @param[in] spacingPerDimension vector containing the spacing per dimension 56 : * 57 : * @throw InvalidArgumentError if any number of coefficients or spacing is non-positive, 58 : * or sizes of numberOfCoefficientsPerDimension and spacingPerDimension do not match 59 : */ 60 : explicit VolumeDescriptor(IndexVector_t numberOfCoefficientsPerDimension, 61 : RealVector_t spacingPerDimension); 62 : 63 : /** 64 : * @brief Constructs VolumeDescriptor from two initializer lists for coefficients and 65 : * spacing 66 : * 67 : * @param[in] numberOfCoefficientsPerDimension initializer list containing the number of 68 : * coefficients per dimension (dimension is set implicitly from the size of the list) 69 : * @param[in] spacingPerDimension initializer list containing the spacing per dimension 70 : * 71 : * @throw InvalidArgumentError if any number of coefficients or spacing is non-positive, 72 : * or sizes of numberOfCoefficientsPerDimension and spacingPerDimension do not match 73 : */ 74 : explicit VolumeDescriptor(std::initializer_list<index_t> numberOfCoefficientsPerDimension, 75 : std::initializer_list<real_t> spacingPerDimension); 76 : 77 : private: 78 : /// implement the polymorphic clone operation 79 : VolumeDescriptor* cloneImpl() const override; 80 : 81 : /// implement the polymorphic comparison operation 82 : bool isEqual(const DataDescriptor& other) const override; 83 : }; 84 : 85 : } // namespace elsa