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):
237237
238238 if is_arraylike (image_like ):
239239 array = np .asarray (image_like )
240- case_use_view = array .flags ['OWNDATA' ]
240+ can_use_view = array .flags ['OWNDATA' ]
241241 if have_dask and isinstance (image_like , dask .array .core .Array ):
242- case_use_view = False
242+ can_use_view = False
243243 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 :
245250 image_from_array = itk .image_view_from_array (array )
246251 else :
247252 image_from_array = itk .image_from_array (array )
You can’t perform that action at this time.
0 commit comments