For my thesis I have 16 nifti MRI images (Dim: 162×162×192), My plan is to work with Conv Neural Network and I divided 10 and 6 images as train and test images. The problem is, How to feed nifti images in Unet as train image for input and output as well as how to feed the Test images? Thank you.
Asked
Active
Viewed 1,265 times
1

Nick ODell
- 15,465
- 3
- 32
- 66

Neamul
- 31
- 5
-
format the question for more clarity. – avisheks Jul 14 '20 at 14:06
-
@Naemul extract the images as png files from Nifti images, using Nibabel library, then feed them directly as images to the network, you will have images as output also. – Bilal Jul 15 '20 at 18:02
-
@BelalHomaidan Thank you for your answer but I need the output file as nifty, In that case I have to reconstruct all the outputs into the nifti again. still I dont know how to do that with keeping all the information same as the original one. – Neamul Jul 16 '20 at 11:06
-
@Naemul save the header and affine transformation, after prediction you can stack images in 3D array and join it with header and affine transformation, then you can format them as nifti, read Nibabel documentation for that it's easy. – Bilal Jul 16 '20 at 17:41
1 Answers
0
You can use TorchIO. Here is a Google Colab notebook in which NIfTI images are fed into a UNet for 3D brain segmentation.

fepegar
- 595
- 5
- 15