how to read imageDatastore for 4D-single.

2 views (last 30 days)
Dear all,
My data is 4D-single. Anyone know how to read imageDatastore for 4D-single.
the code volds is for mage data set 3D MxNxN
clear all
close all
DATASetDir = fullfile('C:\Users\USER\Downloads\BrainTS\preprocessedDataset');
IMAGEDir = fullfile(DATASetDir,'imagesTr');
volReader = @(x) matRead(x);
volds = imageDatastore(IMAGEDir, ...
'FileExtensions','.mat','ReadFcn',volReader); %THIS ONE IS DATA FOR MXNXN
% labelReader = @(x) matread(x);
matFileDir = fullfile('C:\Users\USER\Downloads\BrainTS\preprocessedDataset\labelsTr');
classNames = ["background", "tumor"];
pixelLabelID = [0 1];
% pxds = (LabelDirr,classNames,pixelLabelID, ...
% 'FileExtensions','.mat','ReadFcn',labelReader);
pxds = pixelLabelDatastore(matFileDir,classNames,pixelLabelID, ...

Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by