Skip to content

Commit

Permalink
RF - clarified code for numpeaks
Browse files Browse the repository at this point in the history
  • Loading branch information
gabknight committed Jul 9, 2019
1 parent 4c2f77d commit 2c28c89
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions dipy/reconst/peak_direction_getter.pyx
Expand Up @@ -75,9 +75,12 @@ cdef class PeaksAndMetricsDirectionGetter(DirectionGetter):
raise IndexError("point outside data")

# Check to see how many peaks were found in the voxel
for numpeaks in range(self._ind.shape[3] + 1):
if (numpeaks >= self._ind.shape[3] or
self._ind[ijk[0], ijk[1], ijk[2], numpeaks] < 0):
numpeaks=0
for i in range(self.peak_values.shape[3]):
# Test if the value associated to the peak is > 0
if self._qa[ijk[0], ijk[1], ijk[2], i] > 0:
numpeaks = numpeaks + 1
else:
break

# Create directions array and copy peak directions from vertices
Expand Down

0 comments on commit 2c28c89

Please sign in to comment.