SimpleITK 中 3D 阵列的 2D RGB 图像构造
2D RGB image construction from 3D array in SimpleITK
我有一个 RGB 图像,其格式为 3D 数组,形状为 (m, n, 3)。我想创建一个 SimpleITK 图像。使用 GetImageFromArray() 函数会创建 3D 图像,这不是我想要的。我怎样才能创建 2D RGB 图像呢?
文档内容如下:
Signature: sitk.GetImageFromArray(arr, isVector=None)
Docstring: Get a SimpleITK Image from a numpy array. If isVector is True, then the Image will have a Vector pixel type, and the last dimension of the array will be considered the component index. By default when isVector is None, 4D images are automatically considered 3D vector images.
你试过通过isVector=True
吗?
我有一个 RGB 图像,其格式为 3D 数组,形状为 (m, n, 3)。我想创建一个 SimpleITK 图像。使用 GetImageFromArray() 函数会创建 3D 图像,这不是我想要的。我怎样才能创建 2D RGB 图像呢?
文档内容如下:
Signature: sitk.GetImageFromArray(arr, isVector=None)
Docstring: Get a SimpleITK Image from a numpy array. If isVector is True, then the Image will have a Vector pixel type, and the last dimension of the array will be considered the component index. By default when isVector is None, 4D images are automatically considered 3D vector images.
你试过通过isVector=True
吗?