Error loading images programmatically in Medical Image Labeler
显示 更早的评论
I'm trying to upload a series of nifti images in a new session of Medical Image Labeler. I created a groundTruthMedical object copying the structure of the groundTruthMedical object that the app generate when a new session is started.
I reported here an example of what I did:
dataFolder = "D:\documents\datasets\";
filePath1 = fullfile(dataFolder,"image1.nii.gz");
filePath2 = fullfile(dataFolder,"image2.nii.gz");
source = {filePath1; filePath2};
dataSource = medical.labeler.loading.VolumeSource(source);
labelData = strings(size(source,1),1); % empty string array of size 2x1
variableNames = {'Name', 'LabelColor', 'PixelLabelID'};
variableTypes = {'string','double','uint8'};
labelDef = table('Size',[0,3],'VariableTypes',variableTypes,'VariableNames',variableNames); % empty table of size 0x3
gTruth = groundTruthMedical(dataSource,labelDef,labelData);
% opens the app and loads the image and label data stored in gTruth
medicalImageLabeler(gTruth)
I have no labelled data because I want to manually segment the images, this is because I created labelData and labelDef as "empty variables".
Medical Image Labeler opens and load the images but an error occurs every time. The error says: "The VariableNames property must contain one name for each variable in the table."

I am pretty sure that the table I created contains one name for each variable, becuse therea are three columns, corresponding to the variables and there are three elements in the variableNames cell.
I don't know how to solve this problem. Is there anyone that faced the same issue and have found a solution?
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Labeling 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!