Convert STL file to something I can use 'regionprops' function
2 ビュー (過去 30 日間)
古いコメントを表示
I have to use a code that uses the 'regionprops' function. The problem is, the program that was originally used to import data as a .tif stack to use in this code is no longer available to me. I can only import as an stl (binary or ASCII). Is there a way that I can use the stl file and convert it to a format supported by the regionprops function? Here is a sample of the code that I have to use. 'bone.photo' was the original reference to the .tif stack that was used before.
LM = bwlabel(bone.photo{ind});
m = regionprops(LM==medLM,'Centroid','Area','EquivDiameter','BoundingBox','PixelList','ConvexHull','ConvexArea');
centroid = cat(1,m.Centroid);
area = cat(1,m.Area)*heightPerPixel*widthPerPixel;
equivdia = cat(1,m.EquivDiameter)*widthPerPixel;
boundingbox = cat(1,m.BoundingBox);
pixellist = cat(1,m.PixelList);
convexarea = cat(1,m.ConvexArea)*heightPerPixel*widthPerPixel;
I have tried making a couple different 'stlread' functions work, but I either get a faces matrix and vertices matrix or edge coordinates. These don't give me a binary image, so they won't work in the 'regionprops' function.
0 件のコメント
採用された回答
Image Analyst
2018 年 3 月 19 日
I don't use STL files. Somehow you need to convert the STL file to a binary image. Perhaps you can use poly2mask() to do that.
4 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Convert Image Type についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!