Skip to content

Commit

Permalink
Add support for other dimensions than 3
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasGandel committed Sep 3, 2024
1 parent b6ac52f commit 6fe09e2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion wrapping/CudaImage.i.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
def __cuda_array_interface__(self):
_pixelType = "@PixelType@"
_typestr = _get_type_string(_pixelType)

_itksize = self.GetBufferedRegion().GetSize()
_dim = len(_itksize)
_shape = tuple(int(_itksize[idx]) for idx in range(_dim))
return {
'shape': (self.GetLargestPossibleRegion().GetSize()[0], self.GetLargestPossibleRegion().GetSize()[1], self.GetLargestPossibleRegion().GetSize()[2]),
'shape': _shape,
'data': (int(self.GetCudaDataManager().GetGPUBufferPointer()), False),
'typestr': _typestr,
'descr': [('', _typestr)],
Expand Down

0 comments on commit 6fe09e2

Please sign in to comment.