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

[ENH] sanitize entities in rename spec #679

Merged
merged 1 commit into from
Mar 15, 2024
Merged

[ENH] sanitize entities in rename spec #679

merged 1 commit into from
Mar 15, 2024

Conversation

Remi-Gau
Copy link
Collaborator

@Remi-Gau
Copy link
Collaborator Author

input_filename = 'wuasub-01_task-faceRecognition_bold.nii';

file = bids.File(input_filename, 'use_schema', false);

spec.prefix = '';
spec.entities.desc = 'bold';
spec.entities.res = '1.5';
spec.entities.label = 'GM';
spec.suffix = 'dseg';
spec.ext = '.json';
spec.entity_order = {'sub', 'task', 'label', 'res', 'desc'};

file = file.rename('spec', spec);
file.filename

ans =
    'sub-01_task-faceRecognition_label-GM_res-1pt5_desc-bold_dseg.json'

@Remi-Gau Remi-Gau merged commit ebbee38 into main Mar 15, 2024
23 checks passed
@marcobarilari
Copy link

Thank you!

@Remi-Gau Remi-Gau deleted the enh/671 branch July 25, 2024 09:28
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.

[ENH]: file.rename could change . to pt in the case of spec.entities.xxx = num2str(1.5)
2 participants