class 'matlab.io​.datastore​.PixelLabe​lDatastore​' is not allowed. Error !!!!!

1 次查看(过去 30 天)
How can I solve this problem please
Array formation and parentheses-style indexing with objects of
class 'matlab.io.datastore.PixelLabelDatastore' is not allowed.
Use objects of class 'matlab.io.datastore.PixelLabelDatastore'
only as scalars or use a cell array.

回答(1 个)

Steven Lord
Steven Lord 2023-3-10
You can make an array of numeric data in MATLAB.
A = [1 2; 3 4]
A = 2×2
1 2 3 4
You cannot make an array of PixelLabelDatastore objects like that. You need to either use one PixelLabelDatastore or you need to make a cell array of PixelLabelDatastore objects. If you choose the latter approach, know that some functions may not accept a cell array of datastores.
If you show us a small sample of your code where this error occurs and explain what you want this code to do we may be able to offer alternate suggestions.
  2 个评论
Amira Youssef
Amira Youssef 2023-3-10
I was trying to get the hausdorff distance for CT segmented images
I fixed the pixellabeldatastore error but now whenever I run my code matlab crashes now can you help me please. my ground truth are saved as .mat
I_GT_struct=pxdsTruth.Files;
I_Seg_struct=pxdsResults.Files;
for i=0:76
I_GTx =load(I_GT_struct{i,1});
I_GT= I_GTx.cropLabel;
I_Segx= load(I_Seg_struct{i,1});
I_Seg=I_Segx.labelImage;
[~, ~, HD, ~, ~, AVD, ~] = HD_Distance1(I_GT,I_Seg ,[1 1 1],95);
[TPos,FPos,FNeg,DSC] = Segmentation_Errors(I_GT,I_Seg);
HD(i)=HD;
DSC(i)=DSC;
AVD(i)=AVD;
i=i+1;
end
Steven Lord
Steven Lord 2023-3-10
So what in this code is a datastore and what isn't?
If you want to perform mathematics on the data from the datastore you're probably going to want to create a tall array from that datastore and perform math on the tall array instead of the datastore.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Datastore 的更多信息

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by