DICOM data as input for Deep Learning

8 Ansichten (letzte 30 Tage)
Ana Mota
Ana Mota am 5 Mai 2020
Kommentiert: Ana Mota am 11 Mai 2020
Dear colleagues!
I am new with Deep Learning and I am having problems in introducing DICOM data as input into imagedatastore in order to train a network.
I have followed the steps described here https://www.mathworks.com/help/deeplearning/ug/preprocess-volumes-for-deep-learning.html to "create an ImageDatastore from a collection of DICOM files".
I am able to load the .mat files and I see de 3D volumes for each case (I have 2 classes, each with three 3D volume data sets)
The problem is when I try to "trainNetwork", I get an error:
" Error using matlab.io.datastore.ImageDatastore/read (line 77)
Unable to read file:
'C:\Users\...\TrainingData\...\MATFiles\Class1\Case04.mat'."
Any help please???
(I have multiple clinical datasets. Each dataset is stored in a different folder and it is represented by multiple slices)
Thank you in advance!

Akzeptierte Antwort

Mahesh Taparia
Mahesh Taparia am 11 Mai 2020
Hi
It seems that you are unable to load the mat file into the network. Your input is in mat file format. So, create a custom read function which read the files in that specified format and then pass it to the network. For example, call the read function after declaring the image datastore as given below:
datastore.ReadFcn=@readFcn_mat;
Define the read function as per your file. For example, consider a function given below:
function I = readFcn_mat(filename)
I = load(filename);
I = I.Input; %%%%change here as per your dataset
end
Hope it will helps.
  3 Kommentare
Mahesh Taparia
Mahesh Taparia am 11 Mai 2020
Yes, if the input data is stored in variable V then it will be
I = I.V;
Ana Mota
Ana Mota am 11 Mai 2020
Great! I think it is working now!! Thank you very much!!!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu DICOM Format finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by