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

Address BEP031 macro requests #945

Merged
merged 2 commits into from
Dec 3, 2021
Merged

Conversation

tsalo
Copy link
Member

@tsalo tsalo commented Dec 3, 2021

Changes proposed:

  • Add an optional parameter to schema.make_filename_template, n_dupes_to_combine, that determines the number of suffixes or extensions that should be combined into <suffix> or <extension>, respectively, when the filename pattern otherwise matches.
  • Refactor utils.combine_extensions to only combine extensions of compressed versions (for example, nii.gz and nii will combine to form nii[.gz], but ome.tif and ome would not combine).

@tsalo
Copy link
Member Author

tsalo commented Dec 3, 2021

The Microscopy imaging data template:

sub-<label>/
    [ses-<label>/]
        micr/
            sub-<label>[_ses-<label>]_sample-<label>[_acq-<label>][_stain-<label>][_run-<index>][_chunk-<index>]_<suffix>.<extension>
            sub-<label>[_ses-<label>]_sample-<label>[_acq-<label>][_stain-<label>][_run-<index>][_chunk-<index>]_<suffix>.json

The photo one:

sub-<label>/
    [ses-<label>/]
        micr/
            sub-<label>[_ses-<label>]_sample-<label>[_acq-<label>]_photo.<extension>

Copy link
Collaborator

@mariehbourget mariehbourget left a comment

Choose a reason for hiding this comment

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

Thank you @tsalo!
For BEP031, the new n_dupes_to_combine works perfectly for extensions. I will also be able to drop the long suffix list in the macro.
I tested without the n_dupes_to_combine as well, and .ome.tif is rendered correctly.

I don't know if there are other cases where the number of dupes to combine would be different for suffixes and extensions? For BEP031, this is not an issue.
Thanks!

@tsalo
Copy link
Member Author

tsalo commented Dec 3, 2021

I don't know if there are other cases where the number of dupes to combine would be different for suffixes and extensions?

I can see that coming up in the future, but I don't think we need it yet.

Thanks for your comments. I'll merge then.

@tsalo tsalo merged commit 7b63f8e into bids-standard:bep031 Dec 3, 2021
@tsalo tsalo deleted the ext-fix-for-bep031 branch December 3, 2021 20:23
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