17#ifndef __gt_spatiallock_h__
18#define __gt_spatiallock_h__
28 namespace Tractography {
34 template <
typename T =
float >
39 using point_type = Eigen::Matrix<value_type, 3, 1>;
70 bool try_lock(
const point_type& pos) {
71 return lock.try_lock(pos, idx);
74 bool operator!()
const {
90 bool try_lock(
const point_type& pos, ssize_t& idx) {
91 std::lock_guard<std::mutex> lock (
mutex);
98 if ((std::fabs(d[0]) <
_tx) && (std::fabs(d[1]) <
_ty) && (std::fabs(d[2]) <
_tz))
SpatialLock manages a mutex lock on n positions in 3D space.
bool try_lock(const point_type &pos, ssize_t &idx)
vector< std::pair< point_type, bool > > lockcentres
void unlock(const size_t idx)
MR::default_type value_type