diff --git a/gunpowder/graph.py b/gunpowder/graph.py index 52eadd29..6134c279 100644 --- a/gunpowder/graph.py +++ b/gunpowder/graph.py @@ -153,7 +153,7 @@ def v(self): @property def attrs(self): return self.__attrs - + @property def all(self): return self.__attrs diff --git a/gunpowder/nodes/rasterize_graph.py b/gunpowder/nodes/rasterize_graph.py index 50c1c5eb..de6c4436 100644 --- a/gunpowder/nodes/rasterize_graph.py +++ b/gunpowder/nodes/rasterize_graph.py @@ -390,7 +390,6 @@ def __rasterize( for color in np.unique(rasterized_graph): if color == 0: continue - assert color in [2,3], np.unique(rasterized_graph) mask = rasterized_graph == color enlarge_binary_map( mask, diff --git a/gunpowder/nodes/simple_augment.py b/gunpowder/nodes/simple_augment.py index 676056b9..adde087b 100644 --- a/gunpowder/nodes/simple_augment.py +++ b/gunpowder/nodes/simple_augment.py @@ -176,9 +176,7 @@ def process(self, batch, request): array.data = array.data[channel_slices + mirror] transpose = [t + num_channels for t in self.transpose] - array.data = array.data.transpose( - list(range(num_channels)) + transpose - ) + array.data = array.data.transpose(list(range(num_channels)) + transpose) # graphs total_roi_offset = total_roi.offset diff --git a/tests/cases/elastic_augment.py b/tests/cases/elastic_augment.py index f90b8c85..694d351c 100644 --- a/tests/cases/elastic_augment.py +++ b/tests/cases/elastic_augment.py @@ -99,8 +99,8 @@ def test_3d_basics(self): [0.1, 0.1, 0.1], # [0, 0, 0], # no jitter [0, 2.0 * math.pi], - ) - + # rotate randomly + ) # rotate randomly + + # [math.pi/4, math.pi/4]) + # rotate by 45 deg # [0, 0]) + # no rotation RasterizeGraph( diff --git a/tests/cases/elastic_augment_points.py b/tests/cases/elastic_augment_points.py index ddb99741..0ec8a13b 100644 --- a/tests/cases/elastic_augment_points.py +++ b/tests/cases/elastic_augment_points.py @@ -213,8 +213,8 @@ def test_random_seed(self): [0.1, 0.1, 0.1], # [0, 0, 0], # no jitter [0, 2.0 * math.pi], - ) - + # rotate randomly + ) # rotate randomly + + # [math.pi/4, math.pi/4]) + # rotate by 45 deg # [0, 0]) + # no rotation RasterizeGraph( diff --git a/tests/cases/rasterize_points.py b/tests/cases/rasterize_points.py index f6cb85e2..fc21da39 100644 --- a/tests/cases/rasterize_points.py +++ b/tests/cases/rasterize_points.py @@ -47,6 +47,7 @@ def test_rasterize_graph_colors(): assert rasterized[4, 0] == 3 assert rasterized[4, :].sum() == 15 + def test_3d(): graph_key = GraphKey("TEST_GRAPH") array_key = ArrayKey("TEST_ARRAY")