Skip to content

FIX: The commandline is set --model <undefined> #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

oesteban
Copy link
Member

No description provided.

@oesteban oesteban requested a review from mgxd May 13, 2025 03:20
Copy link
Contributor

@mgxd mgxd left a comment

Choose a reason for hiding this comment

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

not a huge fan of assigning a conditional default / arbitrary path in the inputspec - WDYT about:

  • removing the logic from inputspec
  • adding a check if model is not defined to SynthStrip._parse_inputs that will automatically set (and complain if not found) the model

Comment on lines 37 to 45
_fs_home = os.getenv('FREESURFER_HOME', None)
_default_model_path = Path(_fs_home) / 'models' / 'synthstrip.1.pt' if _fs_home else Undefined

use_defaultmodel = False
if _fs_home and not _default_model_path.exists():
_default_model_path = Undefined
else:
use_defaultmodel = True
_default_model_path = str(_default_model_path)
Copy link
Contributor

Choose a reason for hiding this comment

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

imo, this logic should be contained within the SynthStrip interface.

Copy link
Member Author

Choose a reason for hiding this comment

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

Happy to improve, but this resolves a current bug.

Copy link
Member Author

Choose a reason for hiding this comment

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

Okay, the fix wasn't great. In testing it again, I noticed why we took this route. The idea was to avoid editing CommandLine's run method.

Copy link
Contributor

Choose a reason for hiding this comment

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

i opened #13 as an alternative - wdyt?

@oesteban oesteban force-pushed the fix/nipype-wrapper-model branch from c7e6590 to d821517 Compare May 15, 2025 03:39
@mgxd mgxd mentioned this pull request May 15, 2025
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.

2 participants