Filter löschen
Filter löschen

is used PixelLabelDataStore?

1 Ansicht (letzte 30 Tage)
hla hla myint
hla hla myint am 20 Okt. 2020
Kommentiert: Walter Roberson am 20 Okt. 2020
Error is following
Error using pixelLabelDatastore>parseInputs (line 202)
'FileExtensions' is not a recognized parameter. For a list of valid name-value pair arguments, see the documentation for
this function.
Error in pixelLabelDatastore (line 151)
[location, classes, values,params] = parseInputs(varargin{:});
Error in Pxds (line 32)
pxds = pixelLabelDatastore(lblLoc,classNames,pixelLabelID ,'FileExtensions','.nii','ReadFcn', sampleReadFcn);
My code
imageDir = fullfile(tempdir,'BraTS');
if ~exist(imageDir,'dir')
mkdir(imageDir);
end
sourceDataLoc = [imageDir filesep 'Task01_BrainTumour'];
volLoc = fullfile(sourceDataLoc , 'image');
if ~exist(volLoc,'dir')
mkdir(volLoc);
end
lblLoc = fullfile( sourceDataLoc,'Label');
if ~exist(lblLoc,'dir')
mkdir(lblLoc);
end
sampleReadFcn =@(x) niftiread(x)
imds = imageDatastore(volLoc,'FileExtensions','.nii','ReadFcn',sampleReadFcn);
classNames = ["background","tumor"];
pixelLabelID = [0 1];
pxds = pixelLabelDatastore(lblLoc,classNames,pixelLabelID ,'FileExtensions','.nii','ReadFcn', sampleReadFcn);

Antworten (1)

Walter Roberson
Walter Roberson am 20 Okt. 2020
FileExtensions is from a later release than you are using.
Your release cannot used nii files with pixel label store, if I recall correctly; in your release it is not possible to customize the read function.
  2 Kommentare
hla hla myint
hla hla myint am 20 Okt. 2020
How to use pixel label store. Please give me code.
Walter Roberson
Walter Roberson am 20 Okt. 2020
The code you were using looks valid for later releases of MATLAB. If my memory is correct, you cannot create a pixel label datastore from nii files in your version of MATLAB.
You might be able to use other code to read the nii files and save them as an image format accepted by your version such as a png file.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Convert Image Type finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by