Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
1703d6b
Move modified GUI app to development branch
tinalasisi Nov 7, 2025
6bde71e
Improve image validation and error handling
tinalasisi Nov 7, 2025
13b43a9
Added docker
ezhil384 Mar 14, 2026
69f15d4
Updated v2 with SAM
May 15, 2026
8590977
fix: resolve CI failures and Streamlit Cloud deployment errors
May 15, 2026
3c10b42
fix: clear packages.txt to resolve Streamlit Cloud apt dependency con…
May 15, 2026
d0b1ceb
fix: empty packages.txt completely — Streamlit Cloud treats comments …
May 15, 2026
5493535
fix: widen version upper bounds for Python 3.14 wheel compatibility
May 15, 2026
eadfc25
fix: correct segment_section keyword args in GUI helper
May 15, 2026
5388b08
fix(tests): update tests to match refactored v2 API
Copilot May 15, 2026
48dce86
Merge pull request #2 from ezhil384/copilot/create-new-tests-for-refa…
ezhil384 May 15, 2026
d06b3ec
Merge pull request #1 from ezhil384/feature/v2-enhanced-analysis
ezhil384 May 15, 2026
03c714d
Merge PR #16 from ezhil384/fibermorph (fibermorph-v2) into dev
tinalasisi Jul 3, 2026
66d0b5b
Fix TestListImages to create valid TIFFs; add invalid-file test
tinalasisi Jul 3, 2026
2c8178e
Fix mechanical defects found in fork review
tinalasisi Jul 3, 2026
372038d
Packaging fixes from fork review
tinalasisi Jul 3, 2026
38ea921
CI: run tests on pushes to fibermorph-dev
tinalasisi Jul 3, 2026
55105d9
Fix section-resolution mislabel (µm/px -> px/µm) and warn on empty masks
tinalasisi Jul 4, 2026
d91f67a
Quick Test: drop filename-based grouping; make single-image work
tinalasisi Jul 4, 2026
49b7dd2
Separate image analysis from data analysis: per-image only, no grouping
tinalasisi Jul 4, 2026
20c2c8a
GUI: document naming, one ungrouped histogram, and resolution-aware d…
tinalasisi Jul 4, 2026
2b7801d
Drop filename parsing entirely: per-image output keeps only source_file
tinalasisi Jul 4, 2026
c001615
GUI: split Cross-Section and Curvature into separate tabs
tinalasisi Jul 4, 2026
00adca9
Fix pre-test bugs found in GUI review
tinalasisi Jul 4, 2026
6db76e6
Accept resolution in either direction (px/unit or unit/px)
tinalasisi Jul 4, 2026
333022b
Collapse cluster tabs into one 'Run at scale' helper; scrub personal …
tinalasisi Jul 4, 2026
43770e0
Explain Taubin window & CLAHE; rename 'Run at scale' -> 'Run Remote'
tinalasisi Jul 4, 2026
cb4f098
Curvature GUI: surface per-fragment length + curvature; refocus metrics
tinalasisi Jul 4, 2026
6a4b2ed
Add Run Local tab + local folder-path mode for large images
tinalasisi Jul 4, 2026
68617b3
Remove the curvature diameter metric (not trusted)
tinalasisi Jul 4, 2026
374a31a
Curvature: per-sample panelled histograms + US spelling
tinalasisi Jul 4, 2026
34164c0
Curvature per-sample panels: share x-axis per metric column
tinalasisi Jul 4, 2026
d377a3e
Update .gitignore
tinalasisi Jul 4, 2026
60ea4c2
Reskin GUI in the Lasisi Lab design system (sidebar console)
tinalasisi Jul 4, 2026
04f7d51
Nav: elegant SVG glyphs (no emoji), more top room, US spelling
tinalasisi Jul 4, 2026
fde7101
Sidebar: 20% narrower and nav content flush-left
tinalasisi Jul 4, 2026
8deb8d3
Nav sub-labels, pink wand Generate button
tinalasisi Jul 4, 2026
7462579
Docs: refresh README/CHANGELOG, add ROADMAP; make fibermorph-gui firs…
tinalasisi Jul 4, 2026
7162bc9
chore: drop unused 58MB SimArcData fixture; gitignore *.tif(f)
tinalasisi Jul 9, 2026
117c581
Merge main into fibermorph-dev
tinalasisi Oct 1, 2026
1e2ff52
chore: normalize line endings to LF
tinalasisi Oct 1, 2026
3655751
feat(gui)!: require --local for fibermorph-gui local mode
tinalasisi Oct 1, 2026
3d3a750
fix(gui)!: hide the SAM2 checkpoint path from hosted visitors
tinalasisi Oct 1, 2026
5dbfefc
fix(gui): save uploads under generated names, not client filenames
tinalasisi Oct 1, 2026
e246213
fix(gui): warn when local mode is given an empty --server.address
tinalasisi Oct 1, 2026
674f5b7
fix(curvature)!: freeze the scikit-image 0.16.2 Frangi filter
tinalasisi Oct 1, 2026
6bed4ed
fix(gui): show the upload cap the server actually enforces
tinalasisi Oct 1, 2026
8791112
fix(curvature)!: restore whole-hair mode and per-hair test output
tinalasisi Oct 1, 2026
1e3c1aa
fix(gui): do not imply SAM2 works when only a checkpoint file exists
tinalasisi Oct 1, 2026
d3f6dc8
docs(changelog): list the SAM2 checkpoint change under Breaking Changes
tinalasisi Oct 1, 2026
d383b0a
test(curvature): add golden tests against original v0.3.1 output
tinalasisi Oct 1, 2026
beff8a2
Merge: curvature reproduces the original v0.3.1 method again
tinalasisi Oct 1, 2026
5faf751
Merge: hosted-mode safety fixes for the Streamlit GUI
tinalasisi Oct 1, 2026
b7da183
docs: correct SAM2 checkpoint and release wording; fix a test
tinalasisi Oct 1, 2026
72f2653
fix(cli): read --window_size as numbers so mm and 50.0 stop crashing
tinalasisi Oct 1, 2026
f06a78f
fix(cli): document the 10 px window floor and tidy --window_size errors
tinalasisi Oct 1, 2026
ae0ca66
refactor(curvature)!: remove the CLAHE preprocessing option
tinalasisi Oct 1, 2026
9651767
refactor(curvature)!: remove the extended curvature metrics option
tinalasisi Oct 1, 2026
8c17805
docs: document removal of CLAHE and extended curvature options
tinalasisi Oct 1, 2026
068b90d
fix(cli): refuse out-of-range --jobs, resolutions and size limits
tinalasisi Oct 1, 2026
10eda5b
fix(cli): refuse a --window_size longer than 1,000,000,000 pixels
tinalasisi Oct 1, 2026
c5fd82f
Merge: remove the CLAHE and extended curvature options
tinalasisi Oct 1, 2026
61141ae
Merge: fibermorph CLI reads --window_size as numbers
tinalasisi Oct 2, 2026
899f533
fix(cli): cap --jobs at the CPU count; keep GUI scripts valid
tinalasisi Oct 2, 2026
632edd7
feat(gui): show SAM2 as unavailable on the hosted app and point to lo…
Oct 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# VCS
.git
.gitignore
.github/

# Python cache/bytecode
__pycache__/
*.py[cod]
*$py.class

# Build/packaging artifacts
build/
dist/
*.egg-info/
.eggs/

# Test and coverage artifacts
.pytest_cache/
.coverage
coverage.xml
htmlcov/
.mypy_cache/
.ruff_cache/

# Virtual environments
.venv/
venv/
env/

# Local editor/tooling
.vscode/
.idea/
.DS_Store

# Local data and outputs
tmp/
out/
results/
results_cache/
*.zip

# Optional: keep large or generated content out of image context
Data/
fibermorph/test_data/
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Normalize line endings: text files always LF in the repo
* text=auto eol=lf
*.png binary
*.tif binary
*.tiff binary
*.jpg binary
1 change: 1 addition & 0 deletions .github/workflows/conventional-prs.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: PR

on:
pull_request_target:
types:
Expand Down
37 changes: 20 additions & 17 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Test

on:
push:
branches: [ main, master ]
branches: [ main, master, fibermorph-dev, "feature/**" ]
pull_request:
branches: [ main, master ]
workflow_dispatch:
Expand All @@ -23,28 +23,31 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: latest
virtualenvs-create: true
virtualenvs-in-project: true
- name: Install system dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends \
libgl1 \
libglib2.0-0 \
libsm6 \
libxext6

- name: Cache Poetry dependencies
- name: Cache pip
uses: actions/cache@v4
with:
path: |
~/.cache/pypoetry
.venv
key: ${{ runner.os }}-poetry-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-poetry-${{ matrix.python-version }}-
${{ runner.os }}-pip-${{ matrix.python-version }}-

- name: Install dependencies
run: poetry install
- name: Install package and test dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[gui]"
pip install pytest pytest-cov

- name: Run tests with coverage
run: poetry run pytest --cov=fibermorph --cov-report=xml --cov-report=term
run: pytest --cov=fibermorph --cov-report=xml --cov-report=term

- name: Upload coverage reports
uses: codecov/codecov-action@v4
Expand All @@ -53,4 +56,4 @@ jobs:
file: ./coverage.xml
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
continue-on-error: true
continue-on-error: true
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,7 @@ __pycache__
coverage.xml
.htmlcov/
*.coverfibermorph/fibermorph_old.py

# Claude Code local config (launch.json, settings, etc.)
.claude/
/.claude

# Large test images live in tinalasisi/fibermorph_DemoData and are fetched on demand
*.tif
Expand Down
10 changes: 6 additions & 4 deletions .streamlit/config.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Lasisi Lab design system (fibermorph GUI)
[theme]
primaryColor = "#FF4B4B"
backgroundColor = "#FFFFFF"
secondaryBackgroundColor = "#F0F2F6"
textColor = "#262730"
base = "light"
primaryColor = "#05686D" # teal-700 — functional / click colour
backgroundColor = "#FBFCFD" # paper-2
secondaryBackgroundColor = "#F2F2F2" # paper-3
textColor = "#3F4251" # ink-700 body; Open Sans loaded via CSS
font = "sans serif"

[server]
Expand Down
345 changes: 345 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ git checkout -b my-feature upstream/fibermorph-dev
python3.12 -m venv .venv && source .venv/bin/activate # Python 3.10–3.12
pip install -e '.[gui]' # editable install with the GUI extra
pytest # run the test suite
fibermorph-gui # launch the GUI locally
fibermorph-gui --local # launch the GUI locally (without --local: hosted mode)
```

## Pull requests

- **Target `fibermorph-dev`.**
- Use a **Conventional Commits** PR title — the `title-format` CI check requires
one. Start with a type: `feat:`, `fix:`, `docs:`, `refactor:`, `test:`,
`chore:`, `ci:`, etc. Example: `feat: validate wave-count on synthetic fibers`.
`chore:`, `ci:`, etc. Example: `fix: handle an empty curvature directory`.
- Make sure `pytest` passes before requesting review.

## Test data
Expand Down
87 changes: 87 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# ── Stage 1: CPU-only (default) ─────────────────────────────────────────────
FROM python:3.11-slim-bookworm AS cpu

ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1 \
STREAMLIT_SERVER_HEADLESS=true \
STREAMLIT_SERVER_PORT=7860 \
STREAMLIT_SERVER_ADDRESS=0.0.0.0 \
STREAMLIT_BROWSER_GATHER_USAGE_STATS=false

RUN apt-get update && apt-get install -y --no-install-recommends \
libgl1 \
libglib2.0-0 \
libsm6 \
libxext6 \
tini \
curl \
&& rm -rf /var/lib/apt/lists/*

RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
WORKDIR $HOME/app

COPY --chown=user . $HOME/app

RUN python -m pip install --upgrade pip && \
python -m pip install ".[gui]"

EXPOSE 7860

HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
CMD curl -fsS http://127.0.0.1:7860/_stcore/health || exit 1

ENTRYPOINT ["/usr/bin/tini", "--"]
CMD ["fibermorph-gui"]


# ── Stage 2: GPU (adds CUDA + SAM2) ─────────────────────────────────────────
FROM nvidia/cuda:12.1.1-cudnn8-runtime-ubuntu22.04 AS gpu

ENV DEBIAN_FRONTEND=noninteractive \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1 \
STREAMLIT_SERVER_HEADLESS=true \
STREAMLIT_SERVER_PORT=7860 \
STREAMLIT_SERVER_ADDRESS=0.0.0.0 \
STREAMLIT_BROWSER_GATHER_USAGE_STATS=false

RUN apt-get update && apt-get install -y --no-install-recommends \
python3.11 \
python3.11-venv \
python3-pip \
libgl1 \
libglib2.0-0 \
libsm6 \
libxext6 \
tini \
curl \
git \
&& rm -rf /var/lib/apt/lists/*

RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
WORKDIR $HOME/app

COPY --chown=user . $HOME/app

RUN python3.11 -m pip install --upgrade pip && \
python3.11 -m pip install ".[gui]" && \
python3.11 -m pip install torch --index-url https://download.pytorch.org/whl/cu121 && \
python3.11 -m pip install git+https://github.com/facebookresearch/segment-anything-2

EXPOSE 7860

HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
CMD curl -fsS http://127.0.0.1:7860/_stcore/health || exit 1

ENTRYPOINT ["/usr/bin/tini", "--"]
CMD ["fibermorph-gui"]
Loading
Loading