How to import STLs into MATLAB WHILE maintaining their coordinate system

조회 수: 12 (최근 30일)
Andrew
Andrew 2024년 2월 29일
댓글: DGM 2025년 7월 13일
Hello, I have 3 STL files created through exporting different segmented areas as a surface mesh using ITK snap. I would like to import these into matlab so that they are aligned in the same way.
That way, when I convert into a binary map, I get a binary map with all 3 segmented areas aligned to each other
Thanks
  댓글 수: 1
DGM
DGM 2025년 7월 13일
The object coordinates are exactly as the encoder writes them. If you want objects to be colocated, then your sofware should be exporting them consistently. If it's throwing away that information (e.g. by centering each object on its centroid instead of keeping it positioned in the source coordinate space), then you'll have to find some way around it. Either figure out how to disable that sort of behavior, or if nothing else, embed some sort of marker(s) into the exported geometry that can be used for alignment.

댓글을 달려면 로그인하십시오.

답변 (1개)

Raghava S N
Raghava S N 2024년 3월 12일
Hi Andrew,
STL files can be imported and aligned in the following methods –
Additional documentation that may be of use for alignment–
  댓글 수: 1
DGM
DGM 2025년 7월 13일
Explain why using PDE toolbox tools solves any part of this problem beyond what stlread() does. Handwaving at webdocs index doesn't answer that question, nor does it answer OP's question. Bear in mind that importgeometry can only import a closed surface, so that's already a restriction, and we have no idea whether OP's segmentation surface is closed.
Use stlread(). Not #30923. Not #22409. They're not faster. They're incomplete and have compatibility problems. If you're running a version older than R2018b and need a third-party tool, use FEX #51200. It actually works. It actually checks encoding type. It actually works for both encodings. It actually prunes connectivity-breaking duplicate entries from the vertex list.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 STL (STereoLithography)에 대해 자세히 알아보기

태그

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by