Skip to content

Add default options to cbf, te_asl and dw_asl scripts#40

Merged
acsenrafilho merged 2 commits intodevelopfrom
copilot/fix-22
Jul 3, 2025
Merged

Add default options to cbf, te_asl and dw_asl scripts#40
acsenrafilho merged 2 commits intodevelopfrom
copilot/fix-22

Conversation

Copy link
Contributor

Copilot AI commented Jul 3, 2025

This PR adds default parameter values to the cbf, te_asl, and dw_asl scripts, making them consistent with the existing generate_subtracted_asl_image script.

Changes Made

The following parameters are now optional with sensible defaults:

  • PLD (Post Labeling Delay): [170.0, 270.0, 370.0, 520.0, 670.0, 1070.0, 1870.0]
  • LD (Labeling Duration): [100.0, 100.0, 150.0, 150.0, 400.0, 800.0, 1800.0]
  • TE (Time of Echos): [13.56, 67.82, 122.08, 176.33, 230.59, 284.84, 339.1, 393.36] (te_asl only)
  • DW (Diffusion weights): [0, 50, 100, 250] (dw_asl only)

Before

# These commands would fail with "required arguments" errors
python -m asltk.scripts.cbf pcasl.nii m0.nii output/
python -m asltk.scripts.te_asl pcasl.nii m0.nii output/
python -m asltk.scripts.dw_asl pcasl.nii m0.nii output/

After

# These commands now work with default values
python -m asltk.scripts.cbf pcasl.nii m0.nii output/
python -m asltk.scripts.te_asl pcasl.nii m0.nii output/
python -m asltk.scripts.dw_asl pcasl.nii m0.nii output/

# Manual parameters still work for custom protocols
python -m asltk.scripts.cbf pcasl.nii m0.nii output/ --pld 100 200 --ld 50 60

Benefits

  • Improved usability: Scripts can now be run without requiring domain expertise to specify timing parameters
  • Consistency: All ASL scripts now have the same default parameter behavior
  • Backward compatibility: Existing workflows with manual parameters continue to work unchanged
  • Documentation: Help text now clearly indicates when default values are available

Testing

  • ✅ All existing tests pass (214/214)
  • ✅ Scripts work with default parameters
  • ✅ Scripts maintain backward compatibility with manual parameters
  • ✅ Help output correctly shows parameters as optional

Fixes #22.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Co-authored-by: acsenrafilho <9722993+acsenrafilho@users.noreply.github.com>
Copilot AI changed the title [WIP] [Improvement] Add default options in the scripts (cfb, te_asl and dw_asl) Add default options to cbf, te_asl and dw_asl scripts Jul 3, 2025
Copilot AI requested a review from acsenrafilho July 3, 2025 22:18
@codecov
Copy link

codecov bot commented Jul 3, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@acsenrafilho acsenrafilho marked this pull request as ready for review July 3, 2025 23:38
@acsenrafilho acsenrafilho changed the base branch from main to develop July 3, 2025 23:39
@acsenrafilho acsenrafilho merged commit 7f8a8fa into develop Jul 3, 2025
15 checks passed
@acsenrafilho acsenrafilho deleted the copilot/fix-22 branch July 8, 2025 01:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Improvement] Add default options in the scripts (cfb, te_asl and dw_asl)

2 participants