Skip to content

Commit

Permalink
Updated the random direction from tests to start with -1
Browse files Browse the repository at this point in the history
  • Loading branch information
ancestor-mithril committed Jul 12, 2024
1 parent 2a65e09 commit 2022652
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@ def create_random_volume(high=5, size=(22, 21, 20), random_direction=False, dtyp
x = np.random.randint(low=0, high=high, size=size, dtype=dtype)
spacing = (1, 1, 1)
origin = (0, 0, 0)
default_direction = (1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0)
if random_direction:
direction = tuple(np.random.uniform(low=-1.0, high=1.0, size=(9,)))
if direction == default_direction:
direction = (-1.0, 0.0, 0.0, 0.0, -1.0, 0.0, 0.0, 0.0, 1.0)
direction = (-1, *np.random.uniform(low=-1.0, high=1.0, size=(8,)))
else:
direction = default_direction
direction = (1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0)
return x, spacing, origin, direction


Expand Down

0 comments on commit 2022652

Please sign in to comment.