scilus / scilpy

The Sherbrooke Connectivity Imaging Lab (SCIL) Python dMRI processing toolbox
Other
62 stars 60 forks source link

ENH: Pad or crop volume using `scil_volume_reshape.py` #1019

Closed AntoineTheb closed 1 month ago

AntoineTheb commented 4 months ago

Quick description

This new script allows to pad or crop a volume to a specified resolution (or to match a reference volume). It is complementary to scil_volume_resample.py.

This will be useful to build machine learning datasets where it is desirable to deal with fixed-size volumes.

Type of change

Check the relevant options.

Provide data, screenshots, command line to test (if relevant)

GDrive

fodf_128.nii.gz was used as the base file.

image image image image

Checklist

codecov[bot] commented 4 months ago

Codecov Report

Attention: Patch coverage is 91.04478% with 6 lines in your changes missing coverage. Please review.

Project coverage is 68.84%. Comparing base (1d6f848) to head (7bae331). Report is 11 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1019 +/- ## ========================================== + Coverage 68.78% 68.84% +0.06% ========================================== Files 429 431 +2 Lines 22265 22332 +67 Branches 3324 3332 +8 ========================================== + Hits 15314 15375 +61 - Misses 5665 5670 +5 - Partials 1286 1287 +1 ``` | [Components](https://app.codecov.io/gh/scilus/scilpy/pull/1019/components?src=pr&el=components&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scilus) | Coverage Δ | | |---|---|---| | [Scripts](https://app.codecov.io/gh/scilus/scilpy/pull/1019/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scilus) | `69.70% <85.36%> (+0.04%)` | :arrow_up: | | [Library](https://app.codecov.io/gh/scilus/scilpy/pull/1019/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scilus) | `67.63% <100.00%> (+0.09%)` | :arrow_up: |
arnaudbore commented 4 months ago

Quick discussion with @frheault, can you rename scil_volume_reshape_to_reference.py to scil_volume_reslice_to_reference.py ?

AntoineTheb commented 4 months ago

Good point @arnaudbore, done in 0e925ed

AntoineTheb commented 2 months ago

image @arnaudbore ?

AntoineTheb commented 1 month ago

Really for merging @arnaudbore @frheault