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