def _get_air_voxels(self, input_data, border_offset=3):
"""Get a two dimensional list with all the voxels in the air.
Returns:
ndarray: The first dimension is the list of voxels, the second the signal per voxel.
"""
indices = np.where(input_data.mask > 0)
max_dims = np.max(indices, axis=1)
min_dims = np.min(indices, axis=1)
mask = np.copy(input_data.mask)
mask[min_dims[0]:max_dims[0]] = True
mask[:, min_dims[1]:max_dims[1], :] = True
mask[..., min_dims[2]:max_dims[2]] = True
mask[0:border_offset] = True
mask[-border_offset:] = True
mask[:, 0:border_offset, :] = True
mask[:, -border_offset:, :] = True
mask[..., 0:border_offset] = True
mask[..., -border_offset:] = True
return create_roi(input_data.signal4d, np.invert(mask))
评论列表
文章目录