So I am unable to save the resized nrrd file here
!pip install pynrrd
import numpy as np
import nrrd
import cv2
from PIL import Image
import matplotlib.pyplot as plt
readdata,header = nrrd.read("/content/drive/MyDrive/Colab Notebooks/Image/imagingVolume .nrrd")
print('readdata: ', readdata.shape) #(256,256,30)
readdata = cv2.resize(readdata,(192,256))
readdata = np.transpose(readdata, (2,0,1))
print(readdata.shape) #(30,256,192)
cv2.imwrite("/content/drive/MyDrive/Colab Notebooks/","reshaped.nrrd")
Overload resolution failed:
- img is not a numpy array, neither a scalar
- Expected Ptr<cv::UMat> for argument 'img'