LCOV - code coverage report
Current view: top level - elsa/generators - Sphere.cpp (source / functions) Hit Total Coverage
Test: coverage-all.lcov Lines: 9 9 100.0 %
Date: 2024-05-16 04:22:26 Functions: 4 6 66.7 %

          Line data    Source code
       1             : #include "Sphere.h"
       2             : #include "Ellipsoid.h"
       3             : 
       4             : namespace elsa::phantoms
       5             : {
       6             : 
       7             :     template <typename data_t>
       8             :     Sphere<data_t>::Sphere(data_t amplit, Vec3i center, data_t radius)
       9          44 :         : _amplit{amplit}, _center{center}, _radius{radius} {};
      10             : 
      11             :     template <Blending b, typename data_t>
      12             :     void rasterize(Sphere<data_t>& sphere, VolumeDescriptor& dd, DataContainer<data_t>& dc)
      13          44 :     {
      14             :         // Rasterize sphere as ellipsoid with no rotation an equal half axis
      15          44 :         Vec3X<data_t> halfAxis(3);
      16          44 :         halfAxis << sphere.getRadius(), sphere.getRadius(), sphere.getRadius();
      17          44 :         Vec3X<data_t> noRotation(3);
      18          44 :         noRotation << 0, 0, 0;
      19             : 
      20          44 :         Ellipsoid el{sphere.getAmplitude(), sphere.getCenter(), halfAxis, noRotation};
      21          44 :         rasterize<b, data_t>(el, dd, dc);
      22          44 :     };
      23             : 
      24             :     // ------------------------------------------
      25             :     // explicit template instantiation
      26             :     template class Sphere<float>;
      27             :     template class Sphere<double>;
      28             : 
      29             :     template void rasterize<Blending::ADDITION, float>(Sphere<float>& el, VolumeDescriptor& dd,
      30             :                                                        DataContainer<float>& dc);
      31             :     template void rasterize<Blending::ADDITION, double>(Sphere<double>& el, VolumeDescriptor& dd,
      32             :                                                         DataContainer<double>& dc);
      33             : 
      34             :     template void rasterize<Blending::OVERWRITE, float>(Sphere<float>& el, VolumeDescriptor& dd,
      35             :                                                         DataContainer<float>& dc);
      36             :     template void rasterize<Blending::OVERWRITE, double>(Sphere<double>& el, VolumeDescriptor& dd,
      37             :                                                          DataContainer<double>& dc);
      38             : 
      39             : } // namespace elsa::phantoms

Generated by: LCOV version 1.14