Skip to content

Commit 37ae1b4

Browse files
committed
skip defective lines
1 parent dc711b3 commit 37ae1b4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

xcp_d/utils/execsummary.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
"""Functions for generating the executive summary."""
44

55
from nipype import logging
6+
import numpy as np
7+
68

79
LOGGER = logging.getLogger('nipype.utils')
810

911

10-
def plot_gii(mesh, coord, color, slicer, view):
12+
def plot_gii(mesh, coord, color, slicer, view, max_distance=10.):
1113
_ax = slicer.axes[list(slicer.axes.keys())[0]]
1214

1315
if view == 'x':
@@ -27,6 +29,10 @@ def plot_gii(mesh, coord, color, slicer, view):
2729

2830
for disc in slice_section.discrete:
2931
temp = disc
32+
# Check that there aren't defects in the Line
33+
differences = np.abs(np.diff(temp, axis=0))
34+
if np.any(differences.max(axis=0) > max_distance):
35+
continue
3036
if view == 'x':
3137
_ax.ax.plot(temp[:, 1], temp[:, 2], color=color)
3238
elif view == 'y':

0 commit comments

Comments
 (0)