Interactive measurement & figure-prep tool for SEM (Scanning Electron Microscope) images, built with Streamlit. Calibrate from the scale bar, draw measurements in real units (µm/nm), crop the data bar, and assemble publication-ready figure panels — all in the browser.
Originally built for Hitachi S-4700 micrographs (with .txt metadata sidecars),
but works with any image once a scale is set manually.
- Releases 에서
SEM-analyzer-v1.0.0-windows.zip을 다운로드합니다. - 압축을 풀고 — 폴더 통째로 둔 채 —
SEM-analyzer.exe를 더블클릭합니다.⚠️ .exe파일 하나만 빼내면 동작하지 않습니다 (폴더 전체가 필요).- SmartScreen 경고가 뜨면 추가 정보 → 실행 (서명 안 된 자체 빌드라 그렇습니다).
- 검은 콘솔 창이 뜨고 잠시 후 브라우저에 앱이 자동으로 열립니다. (창을 닫으면 종료)
인터넷 없이 동작하며, 올린 이미지가 PC 밖으로 나가지 않습니다.
- 이미지 불러오기 — 좌측 패널에서 ‘폴더 경로’ 또는 ‘파일 업로드’. 같은 이름의
.txt메타데이터가 있으면 배율·스케일바를 자동 인식합니다. - 스케일 보정 — ‘자동 보정’(메타데이터+스케일바 검출) 또는 ‘수동 보정’(스케일바 위에 선 긋기). 보정해야 µm 단위로 측정됩니다.
- 측정 — ‘직선’(길이)·‘원’(지름)을 골라 이미지 위에 그리면 값이 자동 계산되어 선 중앙에 표시되고 아래 표에 누적됩니다.
- 편집 — ‘선택/편집’ 모드에서 개체 클릭→이동·크기 조절. 삭제는 캔버스 아래
↩️ 마지막 개체 삭제/🗑 전체 삭제버튼 또는Delete키, 되돌리기Ctrl+Z. - 논문 Fig 요소 — 스케일바 자동 그리기, 패널 라벨(a, b, c…), 텍스트 박스 추가.
- 크롭 — 하단 장비 정보바 잘라내기.
- 내보내기 — ‘PNG 다운로드’(주석 포함 이미지), ‘측정값 CSV’(수치 데이터).
- 몽타주 — 여러 이미지를 한 장으로 배치해 비교용 그림 제작.
현재 히타치(Hitachi) SEM 장비 이미지로만 실제 검증되었습니다. 다른 제조사 장비 이미지는 아직 적용해보지 않아 정상 작동을 보장할 수 없습니다 (특히 메타데이터 자동 인식·스케일바 자동 검출). 다른 장비 이미지는 ‘수동 보정’을 쓰고 결과를 직접 확인하세요.
pip install -r requirements.txt
streamlit run app.py.exe 직접 빌드 방법은 PACKAGING.md 를 참고하세요.
- Scale calibration
- Auto: reads the
MicronMarkervalue from the Hitachi.txtsidecar and detects the tick-ruler scale bar in the image (cross-validated to scale inversely with magnification across an image series). - Manual: draw a line over any scale bar and enter its real length — works for any vendor/image (ImageJ-style "Set Scale").
- Auto: reads the
- Measurement — draw lines (length) or circles (diameter); values shown in µm/nm in a table and labeled on the image. Toggle labels on/off.
- Drawing tools — straight line / circle / freehand, with color and width pickers.
- Crop — auto-detect and remove the black info/data strip at the bottom.
- Figure elements
- New clean scale bar (length, corner, color, thickness, label).
- Panel labels
a) b) c) …in any corner, with size and background options. - Free text boxes at any position.
- Montage — arrange 2 or 4 images per row into a single figure, with
per-image scale bars and automatic
a/b/c…panel labels. Export the combined figure (PNG) or each processed image (ZIP). - Export — annotated PNG and measurements CSV per image.
Requires Python 3.10+.
git clone <your-repo-url>
cd SEM-analyzer
python -m venv .venv && source .venv/bin/activate # or: uv venv .venv
pip install -r requirements.txt # or: uv pip install -r requirements.txtstreamlit run app.pyThen open the URL it prints (default http://localhost:8501).
To ship a double-click .exe (no Python needed) or a shareable web link, see
PACKAGING.md.
- Load images — in the sidebar, either enter a folder path (Hitachi
.txtsidecars next to the images are read automatically) or upload files. You may upload the matching.txtfiles alongside images to enable auto-calibration. - Single edit · measure tab
- Confirm/redo the scale calibration (auto, or draw a line on the scale bar).
- Optionally crop the bottom info strip.
- Pick a drawing mode, color, and width; draw lines/circles to measure.
- Add a fresh scale bar, panel label, or text boxes for figures.
- Download the annotated PNG and the measurements CSV.
- Montage tab — pick images in order, choose 2 or 4 per row, toggle crop / scale bar / auto panel labels, and download the combined figure or a ZIP of processed images.
| File | Purpose |
|---|---|
app.py |
Streamlit UI (loading, single-edit tab, montage tab) |
imaging.py |
Pure image ops: strip detection, crop, scale-bar detection, overlays |
sem_meta.py |
Hitachi .txt sidecar parser |
- Auto scale-bar detection is tuned for Hitachi tick-ruler markers. For other vendors, use manual calibration — it always works.
- Bring your own SEM images; no sample data is bundled.
MIT — see LICENSE.