Skip to content

brainprep/interfaces/freesurfer: sort group level csv by subject id#46

Merged
AGrigis merged 2 commits intobrainprepdesk:devfrom
AymericGaudin:sbm
Apr 1, 2026
Merged

brainprep/interfaces/freesurfer: sort group level csv by subject id#46
AGrigis merged 2 commits intobrainprepdesk:devfrom
AymericGaudin:sbm

Conversation

@AymericGaudin
Copy link
Copy Markdown
Contributor

No description provided.

Comment thread brainprep/interfaces/freesurfer.py Outdated
df = pd.read_csv(file)
first_col = df.columns[0]
df = df.sort_values(by=first_col)
df.to_csv(file, index=False)
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.

This section of the code break the CI.
You can for instance create a pywrapper utility interface that will reorder any table with pandas.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I checked the option you proposed, but I don't think it is possible to do this way. The issue is that the freesurfer command saves directly the csv, so we need to load them back anyway to have access to them in the brainprep script.
The easiest solution to implement is just to parse the output_dir looking for csv/tsv instead of looping over the summary_files

@AGrigis AGrigis merged commit ec3ce1c into brainprepdesk:dev Apr 1, 2026
7 checks passed
@AymericGaudin AymericGaudin deleted the sbm branch April 14, 2026 14:56
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