LCOV - code coverage report
Current view: top level - elsa/generators - ForbildPhantom.h (source / functions) Hit Total Coverage
Test: coverage-all.lcov Lines: 13 13 100.0 %
Date: 2024-05-16 04:22:26 Functions: 9 18 50.0 %

          Line data    Source code
       1             : #pragma once
       2             : #include "Ellipsoid.h"
       3             : #include "Sphere.h"
       4             : #include "EllipCylinder.h"
       5             : #include "EllipCylinderFree.h"
       6             : #include "Cylinder.h"
       7             : #include "CylinderFree.h"
       8             : #include "Box.h"
       9             : 
      10             : #include <vector>
      11             : #include <map>
      12             : 
      13             : namespace elsa::phantoms
      14             : {
      15             : 
      16             :     template <typename data_t>
      17             :     class ForbildPhantom
      18             :     {
      19             :         /**
      20             :          * @brief max number of voxel of the datacontainer per dimension
      21             :          */
      22             :         index_t maxDimension;
      23             : 
      24             :         /**
      25             :          * @brief max dimension for the given values e.g. 26 cm for FORBILD head phantom
      26             :          */
      27             :         data_t phantomMaxSize;
      28             : 
      29             :         /**
      30             :          * @brief max order index. 0 to n where n is the max order index.
      31             :          */
      32             :         int maxOrderIndex;
      33             : 
      34             :         std::map<int, Ellipsoid<data_t>> ellipsoids{};
      35             :         std::map<int, std::pair<Ellipsoid<data_t>, MinMaxFunction<data_t>>> ellipsoidsClippedX{};
      36             :         std::map<int, Sphere<data_t>> spheres{};
      37             :         std::map<int, EllipCylinder<data_t>> ellipCylinder{};
      38             :         std::map<int, EllipCylinderFree<data_t>> ellipCylinderFree{};
      39             :         std::map<int, Cylinder<data_t>> cylinders{};
      40             :         std::map<int, CylinderFree<data_t>> cylindersFree{};
      41             :         std::map<int, Box<data_t>> boxes{};
      42             : 
      43             :     public:
      44             :         ForbildPhantom(index_t maxDimension, data_t phantomMaxSize, int maxOrderIndex);
      45             :         void addEllipsoids(std::vector<std::array<data_t, 11>> data);
      46             :         void addEllipsoidsClippedX(std::vector<std::array<data_t, 12>> data);
      47             :         void addSpheres(std::vector<std::array<data_t, 6>> datas);
      48             :         void addEllipCylinders(std::vector<std::array<data_t, 9>> datas);
      49             :         void addEllipCylindersFree(std::vector<std::array<data_t, 11>> datas);
      50             :         void addCylinders(std::vector<std::array<data_t, 8>> datas);
      51             :         void addCylindersFree(std::vector<std::array<data_t, 10>> datas);
      52             :         void addBoxes(std::vector<std::array<data_t, 8>> datas);
      53             : 
      54         905 :         int getMaxOrderIndex() { return maxOrderIndex; };
      55             : 
      56         917 :         std::map<int, Ellipsoid<data_t>> getEllipsoids() const { return ellipsoids; };
      57             :         std::map<int, std::pair<Ellipsoid<data_t>, MinMaxFunction<data_t>>>
      58             :             getEllipsoidsClippedX() const
      59         888 :         {
      60         888 :             return ellipsoidsClippedX;
      61         888 :         };
      62         928 :         std::map<int, Sphere<data_t>> getSpheres() const { return spheres; };
      63         848 :         std::map<int, EllipCylinder<data_t>> getEllipCylinders() const { return ellipCylinder; };
      64             :         std::map<int, EllipCylinderFree<data_t>> getEllipCylindersFree() const
      65         845 :         {
      66         845 :             return ellipCylinderFree;
      67         845 :         };
      68         878 :         std::map<int, Cylinder<data_t>> getCylinders() const { return cylinders; };
      69         977 :         std::map<int, CylinderFree<data_t>> getCylindersFree() const { return cylindersFree; };
      70         647 :         std::map<int, Box<data_t>> getBoxes() const { return boxes; };
      71             :     };
      72             : 
      73             : } // namespace elsa::phantoms

Generated by: LCOV version 1.14