File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -237,11 +237,16 @@ def to_itk_image(image_like):
237
237
238
238
if is_arraylike (image_like ):
239
239
array = np .asarray (image_like )
240
- case_use_view = array .flags ['OWNDATA' ]
240
+ can_use_view = array .flags ['OWNDATA' ]
241
241
if have_dask and isinstance (image_like , dask .array .core .Array ):
242
- case_use_view = False
242
+ can_use_view = False
243
243
array = np .ascontiguousarray (array )
244
- if case_use_view :
244
+ # JavaScript does not support 64-bit integers
245
+ if array .dtype == np .int64 :
246
+ array = array .astype (np .float32 )
247
+ elif array .dtype == np .uint64 :
248
+ array = array .astype (np .float32 )
249
+ if can_use_view :
245
250
image_from_array = itk .image_view_from_array (array )
246
251
else :
247
252
image_from_array = itk .image_from_array (array )
You can’t perform that action at this time.
0 commit comments