Skip to content

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

Open
oesteban wants to merge 3 commits into
mainfrom
fix/nipype-wrapper-model
Open

FIX: The commandline is set --model <undefined>#12
oesteban wants to merge 3 commits into
mainfrom
fix/nipype-wrapper-model

Conversation

@oesteban

Copy link
Copy Markdown
Member

No description provided.

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

@mgxd mgxd left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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