Input folders or files do not contain specified file extensions:

조회 수: 13 (최근 30일)
hy,
I have a doubt regarding loading '.nii' (NIFTI) files in my CNN architecture for segmentation (I am using segnet architecture). I have attached the snapshot of the error and my code. I want to load my .nii file dataset inside imds . please suggest me any option.
Untitled.png
  댓글 수: 3
Emerson Nithiyaraj
Emerson Nithiyaraj 2019년 11월 2일
yes my images are stored in 3D form with extension (.nii) i.e. medical file named NIFTI (Neuro imaging) file. So that i have coded with file extension in creating image datastore. Still, my input file format is not accepted by the network. please help me.
imds = imageDatastore(imageDir,'FileExtensions','.nii');
Walter Roberson
Walter Roberson 2019년 11월 2일
You would need to provide the FileExtensions option for the pixelLabelDatastore call. You will need to provide a ReadFcn property. You will probably also need a ReadFcn property for the imageDataStore .

댓글을 달려면 로그인하십시오.

채택된 답변

Ajay Pattassery
Ajay Pattassery 2019년 11월 4일
편집: Ajay Pattassery 2019년 11월 4일
Here if you do not define the ReadFcn explicitly, the default function used is imread() which is not supported for .nii extension.
Hence add ReadFcn as suggested by Walter Roberson.
pxds = pixelLabelDatastore(labelDir,classNames,labelIds,'FileExtensions','.nii','ReadFcn',sampleReadFcn);
imds = imageDatastore(imageDir,'FileExtensions','.nii','ReadFcn',sampleReadFcn);
The custom ReadFcn looks something like the following
function data = sampleReadFcn(filename)
data = niftiread(filename);
end
Refer here for more information on custom ReadFcn.
Refer niftiread for more info.
  댓글 수: 3
Ajay Pattassery
Ajay Pattassery 2019년 11월 12일
Please create as a new question.
Walter Roberson
Walter Roberson 2020년 5월 18일
pxds = pixelLabelDatastore(labelDir, classNames, labelIds, 'FileExtensions', '.nii', 'ReadFcn', @sampleReadFcn);
imds = imageDatastore(imageDir, 'FileExtensions', '.nii', 'ReadFcn', @sampleReadFcn);

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Gökay Karayegen
Gökay Karayegen 2020년 5월 18일
편집: Gökay Karayegen 2020년 5월 18일
Hello ! I have a problem regarding pixellabel data store too. The screenshot of the error and the part of the code are enclosed above. Do you have any suggentions? I would be really glad if anyone could help me? Regars,
  댓글 수: 7
Gökay Karayegen
Gökay Karayegen 2020년 5월 26일
Hello again ! Finally I manage to solve the problem. However, this time I am getting an error regarding trainnetwork command. Do you have any suggestions? Thank you once again.
Error using trainNetwork (line 170)
The subscript vectors must all be of the same size.
Error in semantik_derinogrenme (line 145)
net = trainNetwork(trainingData,layers,opts);
Caused by:
Error using sub2ind (line 69)
The subscript vectors must all be of the same size.
hla hla myint
hla hla myint 2020년 10월 20일
Dear
Gökay Karayegen'
My research is same to you. I do not solve error_message PNG. Please help me.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by