Dice Similarity Coefficient with STL File Input

11 visualizaciones (últimos 30 días)
neruk41
neruk41 el 12 de Mzo. de 2021
Respondida: Rahul el 12 de Mayo de 2025
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!

Respuestas (1)

Rahul
Rahul el 12 de Mayo de 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:
  • 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.
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:
Thanks.

Productos


Versión

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by