Skip to content

Check for FLIRT instead of the FSL launcher - #83

Open
RonitBStudent wants to merge 1 commit into
poldracklab:masterfrom
RonitBStudent:fix/check-flirt-executable
Open

Check for FLIRT instead of the FSL launcher#83
RonitBStudent wants to merge 1 commit into
poldracklab:masterfrom
RonitBStudent:fix/check-flirt-executable

Conversation

@RonitBStudent

Copy link
Copy Markdown

Summary

  • check for the flirt executable that pydeface actually invokes through Nipype
  • report a FLIRT-specific error when it is unavailable
  • add regression coverage for missing FLIRT and FLIRT-without-fsl PATH layouts

master is the currently published branch and still contains this regression, while the historical fix exists only on devel; this PR intentionally ports the narrow fix to master.

Closes #82.

Validation

  • PYTHONPATH=. pytest -q tests/test_utils.py
  • ruff check pydeface/utils.py tests/test_utils.py
  • ruff format --check pydeface/utils.py tests/test_utils.py

Copilot AI review requested due to automatic review settings August 3, 2026 21:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 require flirt on PATH and raise a FLIRT-specific error when missing.
  • Add tests covering (a) missing flirt and (b) flirt present without fsl on PATH.

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 thread pydeface/utils.py
Comment on lines +93 to +94
if shutil.which('flirt') is None:
raise OSError('FSL flirt cannot be found on the path')
Comment thread tests/test_utils.py
Comment on lines +51 to +52
with pytest.raises(Exception, match='FSLDIR'):
pdu.deface_image('input.nii.gz')
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.

FSL check still looks for fsl rather than flirt on master and in 2.1.0

2 participants