how to read imageDatastore for 4D-single.
2 views (last 30 days)
Show older comments
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
clc
clear all
close all
%testDataimages
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, ...
'FileExtensions','.mat','ReadFcn',@matRead);
0 Comments
Answers (0)
See Also
Categories
Find more on Image Acquisition Support Packages for Hardware Adaptors (Generic Video Interface) in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!