Skip to content

Commit

Permalink
ENH: Improve is_vector identification in image_from_xarray
Browse files Browse the repository at this point in the history
A simpler check that requires a 'c' dim explicitly.
  • Loading branch information
thewtex committed Apr 1, 2020
1 parent 633f845 commit 69b9000
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions Wrapping/Generators/Python/itkExtras.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,9 +439,7 @@ def image_from_xarray(data_array):
if ordered_dims != tuple(spatial_dims):
raise ValueError('Spatial dimensions do not have the required order: ' + str(ordered_dims))

is_vector = False
if spatial_dimension < len(data_array.dims):
is_vector = True
is_vector = 'c' in data_array.dims
itk_image = itk.image_view_from_array(data_array.values, is_vector=is_vector)

origin = [0.0]*spatial_dimension
Expand Down

0 comments on commit 69b9000

Please sign in to comment.