Skip to content

Commit bfd319f

Browse files
committed
BUG: Ensure NumPy point set arrays are contiguous
1 parent cf486f1 commit bfd319f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

itkwidgets/_transform_types.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ def _numpy_array_to_point_set(point_set_like):
134134
point_values = np.asarray(point_set_like).astype(np.float32)
135135
if len(
136136
point_values.shape) > 1 and point_values.shape[1] == 2 or point_values.shape[1] == 3:
137+
if not point_values.flags['CONTIGUOUS']:
138+
point_values = np.ascontiguousarray(point_values)
137139
if point_values.shape[1] == 2:
138140
point_values = np.hstack(
139141
(point_values, -5.0e-6 * np.ones((point_values.shape[0], 1)))).astype(np.float32)

0 commit comments

Comments
 (0)