How to load 3D MRI images into deep learning images?

65 views Asked by At

I am working on prostate cancer classification task using MRI images, in my case, each patient has both ADC and DWI images. I have preprocessed all ADC and DWI images, and labeled them, the label is in name of image file. And then I have splited the dataset into train and test, validation sets on patient level. I need to concatenate both ADC and DWI images and load into the model. How can i do that? How do I load data into the deep learning model? Please help me, thank you in advance.

This is my file structure

Train/
Patient1/
ADC/
adc_image_0.png
adc_image2.png
...
DWI/
dwi_image_1.png
dwi_image2.png
...
Patient2/
ADC/
adc_image1.png
adc_image2.png
...
DWI/
dwi_image1.png
dwi_image2.png
...
...
Test/
(Same structure as Train)
Validation/
(Same structure as Train)`
1

There are 1 answers

0
matleg On

Try to read the images with tensorflow directly as vectors, as in example here.

As you said, you need to concatenate the images. For this, try to expand the dimensions of each vector for as many images you need to add. Careful, all the images should have the same dimensions (height x width) before being concatenated so maybe you'll need to resize them.

Assuming an image has dimensions (height x width x 3) with 3 corresponding to RGB pixels; finally, an input to the neural net can be a vector with dimensions (n_images x height x width x 3).