Skip to content

Conversation

@valosekj
Copy link
Member

FSLeyes often prints a lot of warnings into the CLI (for example, when switching between overlays, changing colormap, etc.). The usage of subprocess.check_call (introduced in 8aa0e3a to replace os.system) terminates the manual_correction.py script in such cases.

This PR thus bring back os.system for FSLeyes and ITKsnap commands.

@NathanMolinier
Copy link
Contributor

NathanMolinier commented Oct 11, 2023

I understand the issue, however I still believe that using os.system is not good (because we are not able to catch ctrl+c commands). To fix this issue I thereby think we should use subprocess.run as done in this example:

 out=subprocess.run(['sct_label_vertebrae',
                                        '-i', img_path,
                                        '-s', seg_path,
                                        '-c', 't2')
                if out.returncode == 0:
                    # no problem detected
                elif out.returncode == codeWarning:
                    # no problem detected
                else:
                   # different problem detected

So we need first to identify the code of this warning.

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