Skip to content
This repository has been archived by the owner on Feb 2, 2022. It is now read-only.

Commit

Permalink
Fixed a bug in raf1b4ddf3f46 where structures with no contour data wo…
Browse files Browse the repository at this point in the history
…uld cause an error in the 2D view.
  • Loading branch information
bastula committed Jul 7, 2014
1 parent ec51859 commit 17119e4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dicompyler/baseplugins/2dview.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,10 @@ def DrawStructure(self, structure, gc, position, prone, feetfirst):
structure['planes'].keys(), dtype=np.float32)
structure['zkeys'] = structure['planes'].keys()

# Return if there are no z positions in the structure data
if not len(structure['zarray']):
return

# Determine the closest z plane to the given position
zmin = np.amin(np.abs(structure['zarray'] - float(position)))
index = np.argmin(np.abs(structure['zarray'] - float(position)))
Expand Down

0 comments on commit 17119e4

Please sign in to comment.