We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 343cbf9 commit 67ddcdeCopy full SHA for 67ddcde
Wrapping/Generators/Python/itkExtras.py
@@ -405,10 +405,10 @@ def xarray_from_image(image):
405
spatial_dims = ('x', 'y', 'z')
406
coords = {}
407
for index, dim in enumerate(spatial_dims[:spatial_dimension]):
408
- coords[dim] = np.arange(origin[index],
409
- origin[index] + size[index]*spacing[index],
410
- spacing[index],
411
- dtype=np.float64)
+ coords[dim] = np.linspace(origin[index],
+ origin[index] + (size[index]-1)*spacing[index],
+ size[index],
+ dtype=np.float64)
412
413
dims = list(reversed(spatial_dims[:spatial_dimension]))
414
components = image.GetNumberOfComponentsPerPixel()
0 commit comments