Skip to content
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

cubids-apply adds extra leading zero to run entity #272

Open
tsalo opened this issue Sep 19, 2023 · 1 comment
Open

cubids-apply adds extra leading zero to run entity #272

tsalo opened this issue Sep 19, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@tsalo
Copy link
Member

tsalo commented Sep 19, 2023

In my case, it tried to rename sub-03_ses-1_task-rest_acq-multiecho_run-02_echo-1_part-mag_bold.nii.gz to sub-03_ses-1_task-rest_acq-multiechoVARIANTNumVolumes_run-002_bold.nii.gz. Note the shift from one leading zero to two.

This seems to be due to this section of CuBIDS.change_filename:

CuBIDS/cubids/cubids.py

Lines 392 to 393 in b8f5d47

if "run" in list(entities.keys()) and "run-0" in filepath:
entities["run"] = "0" + str(entities["run"])

EDIT: This only happens if the run entity includes leading zeroes. Also, it doesn't account for multiple leading zeroes.

@tsalo tsalo added the bug Something isn't working label Sep 19, 2023
@mattcieslak
Copy link
Contributor

I think we don't want this to happen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants