- Use the 'stlread' function to read the stl files into MATLAB.
- Since this stl data cannot be directly used to calculate DSC, obtain a logical mask of the stl data using 'VOXELISE' and 'logical' functions. Note: VOXELISE is provided by a MATLAB File Excahnge Submission.
- Now to evalue the DSC, use the 'dice' function.
Dice Similarity Coefficient with STL File Input
11 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello,
I have two segmented files in STL format. I need to input them into MATLAB and then perform an analysis on them to obtain a Dice Similarity Coefficient (DSC). Can MATLAB even take in STL file inputs? If so, how does it do this and how would I then use them to perform a DSC analysis? I see that MATLAB has the dice() function. Any help would be appreciated!
0 Kommentare
Antworten (1)
Rahul
am 12 Mai 2025
I understand that you wish to read the stl files in MATLAB and then perform analysis to obtain the Dice Similarity Coefficient (DSC). You can consider the following steps:
Here is a small example:
fv1 = stlread('file1.stl');
fv2 = stlread('file2.stl');
voxelSize = [128, 128, 128]; % Choose appropriate resolution
mask1 = VOXELISE(voxelSize(1), voxelSize(2), voxelSize(3), 'file1.stl', 'xyz');
mask2 = VOXELISE(voxelSize(1), voxelSize(2), voxelSize(3), 'file2.stl', 'xyz');
% Note: Download VOXELISE from MATLAB File Exchange and add to path
mask1 = logical(mask1);
mask2 = logical(mask2);
dsc = dice(mask1, mask2);
The following MathWorks documentations and File Exchange submission can be referred:
'Mesh Voxelization' (File Exchange) : https://www.mathworks.com/matlabcentral/fileexchange/27390-mesh-voxelisation
Thanks.
0 Kommentare
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!