Skip to content

Commit

Permalink
Seg.nrrd quick fix
Browse files Browse the repository at this point in the history
Former-commit-id: d4b4710
  • Loading branch information
skim2257 committed Dec 15, 2021
1 parent 9d21b5a commit 69f33a1
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions imgtools/io/writers.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,9 @@ def put(self, subject_id, mask, **kwargs):
spacing = mask.GetSpacing()
direction = mask.GetDirection()

# what happens if it's [-0.5, 0., 0.]? or [0.5, 0.5, 0.5]?
space_x = 'left' if list(direction[0:3]) == [1., 0., 0.] else 'right'
space_y = 'posterior' if list(direction[3:6]) == [0., 1., 0.] else 'anterior'
space_z = 'superior' if list(direction[6:9]) == [0., 0., 1.] else 'inferior'

space = space_x + "-" + space_y + "-" + space_z
space = "left-posterior-superior" # everything is ITK read/write

# fix reverted somewhere.... :''''(
space_directions = [[spacing[0], 0., 0.],
[0., spacing[1], 0.],
[0., 0., spacing[2]]]
Expand Down

0 comments on commit 69f33a1

Please sign in to comment.