SimpleITK.Image ¶
By: zhixiongzh on July 12, 2021, 9:33 a.m.
- SimpleITK.Image.
In process.py, the input image is in the format of SimpleITK.Image, basically the competition assumes that everyone knows what SimpleITK.Image is and how to process it. But it is not the case? I use the following code to process the image as a numpy array:
img = nib.load(image_path) img = np.asarray(img.get_fdata(),np.float32)
and basically my output would be also numpy.array. Can I get some help on how to transform the SimpleITK.Image to numpy.array and inversely?
- get error information"Expected output was not found..." when I run ./test_save_pred.sh Because I am not sure about the format of SimpleITK.Image, I planed to print it to see what it is. so here is what I did in the process.py:
def predict(self, *, input_images: List[SimpleITK.Image]) -> List[SimpleITK.Image]: print("==> Running prediction") # TODO add code to apply method to input image and output a prediction (and an uncertainty map for task 3 lac) for img in input_images: print(img) break print("==> Prediction done") # TODO Return a list with a prediction (and an uncertainty map for task 3 lac, the order is important!) return img