I use nibabel lib to read some 3D image, which are saved as ‘XX.nii’, After I read the image from file, the data type is <class ‘numpy.memmap’>, I want to use this image for 3D convolution, so I try to convert this data to tensor. How can I do with this problem? Please help me, there is the code as follow
import nibabel as nib
import matplotlib.pyplot as plt
import pdb
from torchvision import transforms as T
import torch
from torchvision.datasets import ImageFolder
import numpy as np