rockverse.voxel_image.from_array#
- rockverse.voxel_image.from_array(array, **kwargs)[source]#
Create a new VoxelImage object and copy array data into it.
Note
If you use this function to create voxel images in a parallel environment, make sure all the processes have the array data available, as each chunk will be processed by the corresponding MPI process.
- Parameters:
array (array-like) – Input data to be copied. Must support dtype and shape attributes.
**kwargs – Additional keyword arguments to be passed to the underlying
creation function. Notice that image shape will match original array shape, and therefore keyword argumentshapewill be ignored inkwargs.
- Returns:
The created
VoxelImageobject.- Return type: