PlanarDetectorDescriptor.h 1.91 KB
Newer Older
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 40 41 42 43 44 45 46 47 48 49 50 51 52
#pragma once

#include "DetectorDescriptor.h"

namespace elsa
{
    /**
     * @brief Class representing metadata for lineraized n-dimensional signal stored in memory. It
     * specifically describes signals, which were captured by a planar detector and stores
     * additional information such as different poses
     *
     * @author David Frank - initial code
     */
    class PlanarDetectorDescriptor : public DetectorDescriptor
    {
        using DetectorDescriptor::Ray;

    public:
        PlanarDetectorDescriptor() = delete;

        ~PlanarDetectorDescriptor() = default;

        /**
         * @brief Construct a PlanatDetectorDescriptor with given number of coefficients and spacing
         * per dimension and a list of geometry poses in the trajectory
         */
        PlanarDetectorDescriptor(const IndexVector_t& numOfCoeffsPerDim,
                                 const RealVector_t& spacingPerDim,
                                 const std::vector<Geometry>& geometryList);

        /**
         * @brief Construct a PlanatDetectorDescriptor with given number of coefficients
         * per dimension and a list of geometry poses in the trajectory
         */
        PlanarDetectorDescriptor(const IndexVector_t& numOfCoeffsPerDim,
                                 const std::vector<Geometry>& geometryList);

        using DetectorDescriptor::computeRayFromDetectorCoord;

        /// Override function to compute rays for a planar detector
        Ray computeRayFromDetectorCoord(const RealVector_t& detectorCoord,
                                        const index_t poseIndex) const override;

        RealVector_t computeDetectorCoordFromRay(const Ray& ray,
                                                 const index_t poseIndex) const override;

    private:
        PlanarDetectorDescriptor* cloneImpl() const override;

        bool isEqual(const DataDescriptor& other) const override;
    };
} // namespace elsa