Check for FLIRT instead of the FSL launcher - #83
Open
RonitBStudent wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes an environment preflight regression on master by checking for the actual FSL executable pydeface invokes (flirt via Nipype) instead of requiring the fsl launcher to be present on PATH. It also adds regression tests to ensure the corrected behavior is enforced going forward.
Changes:
- Update
deface_image()to requireflirtonPATHand raise a FLIRT-specific error when missing. - Add tests covering (a) missing
flirtand (b)flirtpresent withoutfslonPATH.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
pydeface/utils.py |
Switches the executable preflight check from fsl to flirt to match the command actually executed via Nipype. |
tests/test_utils.py |
Adds regression tests for missing-flirt and flirt-without-fsl PATH layouts. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+93
to
+94
| if shutil.which('flirt') is None: | ||
| raise OSError('FSL flirt cannot be found on the path') |
Comment on lines
+51
to
+52
| with pytest.raises(Exception, match='FSLDIR'): | ||
| pdu.deface_image('input.nii.gz') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
flirtexecutable that pydeface actually invokes through NipypefslPATH layoutsmasteris the currently published branch and still contains this regression, while the historical fix exists only ondevel; this PR intentionally ports the narrow fix tomaster.Closes #82.
Validation
PYTHONPATH=. pytest -q tests/test_utils.pyruff check pydeface/utils.py tests/test_utils.pyruff format --check pydeface/utils.py tests/test_utils.py