scilus / scilpy

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

Alter tractogram (trim, cut, replace, subsample, transform) #992

Closed frheault closed 1 month ago

frheault commented 4 months ago

Quick description

New script to simulate alteration of tractogram (should be used for bundle, so maybe I will rename) The operation are describe in the docstring of the script:

This script is used to alter a bundle to reach specific minimum dice
coefficient from the original bundle. The script will subsample, trim, cut,
replace or transform the streamlines until the minimum dice is reached.
(cannot be combined in one run, use the script multiple times if needed)

All operation use a dichotomic search to find the parameter that gets as close
as possible to the specified minimum dice coefficient (with an epsilon for
convergence).

The subsample operation will remove streamlines until the minimum dice is
reached. This affect the whole bundle.

The trim operation will used the lowest density voxels (starting at 1) to
remove points from the streamlines until the minimum dice is reached.
This typically affect the edge of the bundle.

The cut operation will remove points from the start (or end) streamlines until
the minimum dice is reached. This affect one end of the bundle.

The replace operation will upsample the tractogram (generate new streamlines
with noise) and then subsample the tractogram. This effectively replace
streamlines with similar ones until the minimum dice is reached.
This affect the whole bundle.

The transform operation will apply random transformations to the streamlines
until the minimum dice is reached. This affect the whole bundle.

...

Type of change

Check the relevant options.

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

...

Checklist

pep8speaks commented 4 months ago

Hello @frheault, Thank you for updating !

Line 993:80: E501 line too long (80 > 79 characters) Line 1006:80: E501 line too long (81 > 79 characters) Line 1041:80: E501 line too long (80 > 79 characters) Line 1053:80: E501 line too long (80 > 79 characters) Line 1063:80: E501 line too long (80 > 79 characters) Line 1167:80: E501 line too long (80 > 79 characters) Line 1262:80: E501 line too long (80 > 79 characters) Line 1274:80: E501 line too long (80 > 79 characters) Line 1315:80: E501 line too long (81 > 79 characters)

Line 52:80: E501 line too long (83 > 79 characters) Line 53:80: E501 line too long (81 > 79 characters) Line 54:80: E501 line too long (83 > 79 characters)

Comment last updated at 2024-08-05 17:52:22 UTC
codecov[bot] commented 4 months ago

Codecov Report

Attention: Patch coverage is 93.12977% with 18 lines in your changes missing coverage. Please review.

Project coverage is 69.00%. Comparing base (460dac8) to head (20d7a64). Report is 2 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #992 +/- ## ========================================== + Coverage 68.61% 69.00% +0.39% ========================================== Files 426 427 +1 Lines 21835 22094 +259 Branches 3267 3297 +30 ========================================== + Hits 14982 15246 +264 + Misses 5578 5563 -15 - Partials 1275 1285 +10 ``` | [Components](https://app.codecov.io/gh/scilus/scilpy/pull/992/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/992/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scilus) | `70.01% <88.70%> (+0.08%)` | :arrow_up: | | [Library](https://app.codecov.io/gh/scilus/scilpy/pull/992/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scilus) | `67.55% <94.50%> (+0.85%)` | :arrow_up: |