-
Notifications
You must be signed in to change notification settings - Fork 307
FIX: Repair search for precomputed transforms #3369
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
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
f991740
update from entity to match value created by fmriprep
psadil dd198ad
Repair search for precomputed transforms
psadil 69695ff
lint
psadil 0f2078d
stick with long lines
psadil d2a79a5
silence warnings
psadil bd290fc
repair quotes
psadil a288dea
only modify fieldmap_id when not None
psadil 2ceb3e7
fix thinko on boldref2anat
psadil 758caaf
Update fmriprep/utils/tests/test_derivative_cache.py
psadil bef2a21
Update fmriprep/utils/tests/test_derivative_cache.py
psadil 97f637a
use variables while populating the directory and a dictionary when pr…
psadil dc83e12
Reorder merging of queries to simplify overrides
psadil 1c95189
remove unused imports; fix variable name
psadil 74ad5a3
lint
psadil 1a9ccce
lint with ruff
psadil File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
from pathlib import Path | ||
|
||
import pytest | ||
|
||
from fmriprep.utils import bids | ||
|
||
|
||
@pytest.mark.parametrize('xfm', ['boldref2fmap', 'boldref2anat', 'hmc']) | ||
def test_transforms_found_as_str(tmp_path: Path, xfm: str): | ||
subject = '0' | ||
task = 'rest' | ||
fromto = { | ||
'hmc': 'from-orig_to-boldref', | ||
'boldref2fmap': 'from-boldref_to-auto00000', | ||
'boldref2anat': 'from-boldref_to-anat', | ||
}[xfm] | ||
|
||
to_find = tmp_path.joinpath( | ||
f'sub-{subject}', 'func', f'sub-{subject}_task-{task}_{fromto}_mode-image_xfm.txt' | ||
) | ||
to_find.parent.mkdir(parents=True) | ||
to_find.touch() | ||
|
||
entities = { | ||
'subject': subject, | ||
'task': task, | ||
'suffix': 'bold', | ||
'extension': '.nii.gz', | ||
} | ||
|
||
derivs = bids.collect_derivatives( | ||
derivatives_dir=tmp_path, | ||
entities=entities, | ||
fieldmap_id='auto_00000', | ||
) | ||
assert derivs == {'transforms': {xfm: str(to_find)}} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.