Volume Cartographer 2.27.0
LinearNeighborhoodSize.hpp
Go to the documentation of this file.
1#pragma once
2
5#include <cstddef>
6
9
10namespace volcart
11{
18static std::size_t LinearNeighborhoodSize(
19 double radius, double interval, Direction dir)
20{
21 // Setup Range
22 radius = std::abs(radius);
23 double min, max;
24 switch (dir) {
26 min = -1 * radius;
27 max = radius;
28 break;
29 }
31 min = 0;
32 max = radius;
33 break;
34 }
36 min = -1 * radius;
37 max = 0;
38 break;
39 }
40 }
41
42 return static_cast<std::size_t>(std::floor((max - min) / interval) + 1);
43}
44} // namespace volcart
static std::size_t LinearNeighborhoodSize(double radius, double interval, Direction dir)
Return the size of a Linear Neighborhood calculated with the given parameters.
Volume Cartographer library
Direction
Neighborhood directional filtering options.
@ Positive
Only consider data in the positive normal direction.
@ Bidirectional
Consider data in both the positive and negative normal.
@ Negative
Only consider data in the negative normal direction.