Dice Similarity Coefficient with STL File Input

7 ビュー (過去 30 日間)
neruk41
neruk41 2021 年 3 月 12 日
回答済み: Rahul 2025 年 5 月 12 日
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!

回答 (1 件)

Rahul
Rahul 2025 年 5 月 12 日
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.

カテゴリ

Help Center および File ExchangeSTL (STereoLithography) についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by