[NF] Orientation extraction and script for angular error between peaks images - #1343
[NF] Orientation extraction and script for angular error between peaks images#1343CHrlS98 wants to merge 14 commits into
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #1343 +/- ##
==========================================
- Coverage 72.59% 72.11% -0.49%
==========================================
Files 301 305 +4
Lines 26283 26594 +311
Branches 3700 3721 +21
==========================================
+ Hits 19080 19178 +98
- Misses 5651 5864 +213
Partials 1552 1552
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR adds OCT-oriented feature extraction tooling (Frangi/structure-tensor local orientation, peak angular error, and peak→ODF reconstruction), while migrating the former denoise asymmetric filtering code into a new scilpy.feature module and wiring new CLI entry points + tests.
Changes:
- Introduces
scilpy.feature.orientation(Frangi-based orientation extraction) and related unit tests. - Adds new CLIs:
scil_volume_local_orientation,scil_peak_angular_error,scil_peak_to_odf, plus CLI smoke tests. - Adds SH apodized delta-kernel generation and moves asymmetric ODF filtering into
scilpy.feature(including OpenCL kernel file).
Reviewed changes
Copilot reviewed 14 out of 17 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/scilpy/reconst/sh.py | Adds apodized delta-kernel generation used by peak→ODF conversion. |
| src/scilpy/feature/orientation.py | New Frangi/orientation extraction implementation. |
| src/scilpy/feature/tests/test_orientation.py | Unit tests for Frangi/orientation helpers. |
| src/scilpy/feature/asym_filtering.py | Migrated asymmetric filtering implementation (CPU/OpenCL paths). |
| src/scilpy/feature/aodf_filter.cl | New OpenCL kernel for unified asymmetric filtering. |
| src/scilpy/feature/tests/test_asym_filtering.py | Updates tests to import from scilpy.feature. |
| src/scilpy/feature/init.py | New module package init. |
| src/scilpy/cli/scil_volume_local_orientation.py | New CLI for local orientation estimation from grayscale volumes. |
| src/scilpy/cli/tests/test_volume_local_orientation.py | CLI smoke tests for local orientation script. |
| src/scilpy/cli/scil_peak_angular_error.py | New CLI to compute angular error between peak images + JSON metrics. |
| src/scilpy/cli/tests/test_peak_angular_error.py | CLI smoke tests for peak angular error script. |
| src/scilpy/cli/scil_peak_to_odf.py | New CLI converting peaks to SH ODFs (optional apodization + smoothing). |
| src/scilpy/cli/tests/test_peak_to_odf.py | CLI smoke tests for peak→ODF script. |
| src/scilpy/cli/scil_sh_to_aodf.py | Updates imports to new scilpy.feature module path. |
| pyproject.toml | Registers new CLI entry points. |
| docs/source/modules/scilpy.rst | Updates modules index to reference scilpy.feature. |
| docs/source/modules/scilpy.denoise.rst | Updates automodule target text to scilpy.feature.asym_filtering. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| mask_theta_0 = np.abs(sphere.vertices.dot([0, 0, 1])) == 1 | ||
|
|
||
| p_n = Q[mask_theta_0].reshape((-1, 1)) |
| p.add_argument('out_probability', help='Output probability nifti image.') | ||
| p.add_argument('--method', default='frangi', choices=['frangi', 'structure_tensor'], | ||
| help='Method to use for local orientation estimation. [%(default)s]') | ||
| p.add_argument('--sigma', nargs='+', type=float, default=1.0, |
| scilpy.connectivity | ||
| scilpy.denoise | ||
| scilpy.feature | ||
| scilpy.dwi |
| # THIS LINE IS VERY MEMORY INTENSIVE: OOM ON LARGE IMAGES | ||
| sh = sh_to_sf_mat.T[peaks1d_to_sph_ind] | ||
| if apodize_kernel is not None: | ||
| sh = sh * apodize_kernel | ||
|
|
||
| out_sh[mask] = sh |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…per' into oct-tractography-paper
Quick description
Code for my OCT tractography paper (in preparation).
denoisetofeaturefor "feature extraction".scilpy.feature.orientationimplementing Frangi filters for orientation extraction (taken from https://github.com/lens-biophotonics/Foa3D)scil_volume_local_orientationfor estimating principal orientation of structures in a grayscale image using Frangi filters or structure tensor analysis.scil_peak_angular_errorto compute angular error between estimated and reference peaks.Type of change
Check the relevant options.
Checklist