Line data Source code
1 : #include "ProximityOperator.h" 2 : #include "Timer.h" 3 : 4 : namespace elsa 5 : { 6 : template <typename data_t> 7 : ProximityOperator<data_t>::ProximityOperator(const DataDescriptor& descriptor) 8 : : _rangeDescriptor{descriptor.clone()} 9 74 : { 10 74 : } 11 : 12 : template <typename data_t> 13 : auto ProximityOperator<data_t>::getRangeDescriptor() const -> const DataDescriptor& 14 32 : { 15 32 : return *_rangeDescriptor; 16 32 : } 17 : 18 : template <typename data_t> 19 : auto ProximityOperator<data_t>::apply(const DataContainer<data_t>& v, 20 : geometry::Threshold<data_t> t) const 21 : -> DataContainer<data_t> 22 846 : { 23 846 : Timer timeguard("ProximityOperator", "apply"); 24 846 : DataContainer<data_t> prox(*_rangeDescriptor, v.getDataHandlerType()); 25 846 : applyImpl(v, t, prox); 26 846 : return prox; 27 846 : } 28 : 29 : template <typename data_t> 30 : void ProximityOperator<data_t>::apply(const DataContainer<data_t>& v, 31 : geometry::Threshold<data_t> t, 32 : DataContainer<data_t>& prox) const 33 4 : { 34 4 : Timer timeguard("ProximityOperator", "apply"); 35 4 : applyImpl(v, t, prox); 36 4 : } 37 : 38 : template <typename data_t> 39 : auto ProximityOperator<data_t>::isEqual(const ProximityOperator<data_t>& other) const -> bool 40 4 : { 41 4 : return static_cast<bool>(*_rangeDescriptor == *other._rangeDescriptor); 42 4 : } 43 : 44 : // ------------------------------------------ 45 : // explicit template instantiation 46 : template class ProximityOperator<float>; 47 : template class ProximityOperator<double>; 48 : } // namespace elsa