Skip to content

Conversation

@dkuegler
Copy link
Member

@dkuegler dkuegler commented Mar 8, 2024

This Commit fixes three issues:

  1. tcsh does some weird argument splitting splits variables that should not be split, specifically: tcsh ... --py 'python3.10 -s' is split into "--py", "'python3.10", and "-s'". To fix this, the fs_time script was ported to bash, as it was impossible to accomplish this fix in tcsh.
  2. spherical_project always failed, because lapy imports were outdated (lapy.diffGeo instead if lapy.diffgeo and lapy.triaMesh.TriaMesh instead of lapy.TriaMesh). This was a silent fail, as stderr was discarded in spherical_project_wrapper.py and so the fallback was always used.
  3. spherical_project further "often" failed inside docker, when no user name could be found by getpass.getuser (in nibabel.io.freesurfer.write_geometry) -- raising an exception. (Happens if the user is defined for docker via -u, but there is no associated username inside the docker.) To fix this, we just add the environment variable "USERNAME" with value "UNKNOWN", if it is not set (this is a place getpass looks for the username last).

recon_surf/functions.sh

  • proper quoting of cmd

recon_surf/spherical_project.py

  • fix lapy import

recon_surf/spherical_project_wrapper.py

  • also print stderr output to the console
  • call spherical_project with USERNAME set

recon_surf/fs_time

  • port to bash

This Commit fixes three issues:
1. tcsh does some weird argument splitting splits variables that should not be split, specifically: tcsh ... --py 'python3.10 -s' is split into "--py", "'python3.10", and "-s'".
   To fix this, the fs_time script was ported to bash, as it was impossible to accomplish this fix in tcsh.
2. spherical_project always failed, because lapy imports were outdated (lapy.diffGeo instead if lapy.diffgeo and lapy.triaMesh.TriaMesh instead of lapy.TriaMesh). This was a silent fail, as stderr was discarded in spherical_project_wrapper.py and so the fallback was always used.
3. spherical_project further "often" failed inside docker, when no user name could be found by getpass.getuser (in nibabel.io.freesurfer.write_geometry) -- raising an exception. (Happens if the user is defined for docker via -u, but there is no associated username inside the docker.)
   To fix this, we just add the environment variable "USERNAME" with value "UNKNOWN", if it is not set (this is a place getpass looks for the username last).

recon_surf/functions.sh
- proper quoting of cmd
recon_surf/spherical_project.py
- fix lapy import
recon_surf/spherical_project_wrapper.py
- also print stderr output to the console
- call spherical_project with USERNAME set
recon_surf/fs_time
- port to bash
@m-reuter
Copy link
Member

m-reuter commented Mar 8, 2024

thanks. do you know if this has been an issue already in the last release? Probably it also falls back to FreeSurfer in all cases then?

@dkuegler
Copy link
Member Author

dkuegler commented Mar 9, 2024

It should have been an issue since the lapy API was updated. I don't know when this was.
But theoretically, there are hints in the validation logs.

@dkuegler
Copy link
Member Author

dkuegler commented Mar 9, 2024

Correction 1 was introduced by my last PR... 2/3 would have caused failures before, but I don't know since when exactly

Fix typo
@m-reuter m-reuter merged commit 40e7766 into Deep-MI:dev Mar 9, 2024
@dkuegler dkuegler deleted the fix/recon-spherical-project branch March 11, 2024 10:14
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