-
Notifications
You must be signed in to change notification settings - Fork 27
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
FIX: Implement B0FieldIdentifier
/ B0FieldSource
#247
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
7c9f3a5
FIX: Implement ``B0FieldIdentifier`` / ``B0FieldSource``
oesteban c87e5a3
fix: none is not iterable
oesteban 82fd9b2
enh: add doctests to exercise the B0FieldIdentifier implementation
oesteban 6dbfbcb
Apply suggestions from code review
oesteban 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 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 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,11 @@ | ||
{ | ||
"Name": "Test Dataset A, only empty files", | ||
"BIDSVersion": "", | ||
"License": "CC0", | ||
"Authors": ["Esteban O."], | ||
"Acknowledgements": "", | ||
"HowToAcknowledge": "", | ||
"Funding": "", | ||
"ReferencesAndLinks": [""], | ||
"DatasetDOI": "" | ||
} |
Empty file.
Empty file.
Empty file.
Empty file.
This file contains 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,4 @@ | ||
{ | ||
"PhaseEncodingDirection": "j-", | ||
"TotalReadoutTime": 0.005 | ||
} |
Empty file.
Empty file.
This file contains 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,4 @@ | ||
{ | ||
"PhaseEncodingDirection": "i", | ||
"TotalReadoutTime": 0.005 | ||
} |
Empty file.
Empty file.
This file contains 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,4 @@ | ||
{ | ||
"PhaseEncodingDirection": "j", | ||
"TotalReadoutTime": 0.005 | ||
} |
Empty file.
Empty file.
This file contains 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,4 @@ | ||
{ | ||
"PhaseEncodingDirection": "i-", | ||
"TotalReadoutTime": 0.005 | ||
} |
Empty file.
10 changes: 10 additions & 0 deletions
10
sdcflows/tests/data/dsC/sub-01/fmap/sub-01_acq-single_dir-PA_epi.json
This file contains 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,10 @@ | ||
{ | ||
"PhaseEncodingDirection": "j", | ||
"TotalReadoutTime": 0.005, | ||
"IntendedFor": [ | ||
"dwi/sub-01_dir-AP_dwi.nii.gz", | ||
"dwi/sub-01_dir-AP_sbref.nii.gz", | ||
"func/sub-01_task-rest_bold.nii.gz", | ||
"func/sub-01_task-rest_sbref.nii.gz" | ||
] | ||
} |
Empty file.
This file contains 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,5 @@ | ||
{ | ||
"B0FieldIdentifier": "pepolar4pe", | ||
"PhaseEncodingDirection": "j-", | ||
"TotalReadoutTime": 0.005 | ||
} |
Empty file.
This file contains 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,5 @@ | ||
{ | ||
"B0FieldIdentifier": "pepolar4pe", | ||
"PhaseEncodingDirection": "i", | ||
"TotalReadoutTime": 0.005 | ||
} |
Empty file.
This file contains 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,5 @@ | ||
{ | ||
"B0FieldIdentifier": "pepolar4pe", | ||
"PhaseEncodingDirection": "j", | ||
"TotalReadoutTime": 0.005 | ||
} |
Empty file.
This file contains 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,5 @@ | ||
{ | ||
"B0FieldIdentifier": "pepolar4pe", | ||
"PhaseEncodingDirection": "i-", | ||
"TotalReadoutTime": 0.005 | ||
} |
Empty file.
This file contains 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,3 @@ | ||
{ | ||
"Units": "rad/s" | ||
} |
Empty file.
Empty file.
Empty file.
Empty file.
This file contains 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,3 @@ | ||
{ | ||
"EchoTime": 0.005 | ||
} |
Empty file.
This file contains 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,3 @@ | ||
{ | ||
"EchoTime": 0.00746 | ||
} |
Empty file.
This file contains 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,4 @@ | ||
{ | ||
"EchoTime1": 0.00500, | ||
"EchoTime2": 0.00746 | ||
} |
Empty file.
Empty file.
Empty file.
This file contains 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,5 @@ | ||
{ | ||
"TaskName": "Rest", | ||
"PhaseEncodingDirection": "j-", | ||
"TotalReadoutTime": 0.05 | ||
} |
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to specify
extension
andscope
? I think onlysubject
is relevant. Possiblysession
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think
extension
would be required, yes. But, in the case of a weird dataset where pybids finds a json without its NIfTI this would fail for very little gain.scope
is necessary, becausederivatives/
will definitely haveB0FieldIdentifier
defined if processed with SDCFlows.subject
is necessary, of course,and
session
should not be there - the user may want to use fieldmaps with data from another session and save time in others (e.g., My Connectome).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, as long as extension doesn't break things, that's fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But suppose I have a qMRI sequence where I quantify B0, which would be a derivative, and want to use that to correct raw BOLD series?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it is preprocessed, and in Hz, then you don't need an estimator for that - this function finds data that potentially can be used to estimate a fieldmap.
If, on the contrary, some preprocessing is needed (e.g., you will want to approximate some B-Spline coefficients to properly integrate with the correction workflows), then SDCFlows does not support that type of fieldmap. You would definitely pick up some
sdcflows.interfaces
but essentially, you have to build the workflow yourself. Also, ourFieldmap
andFieldmapEstimator
objects do not support other types of fieldmaps.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The responsibility of this function is merely implementing the best we can those heuristics we used to have in fMRIPrep, for convenience across the board (dMRIPrep, babies, rodents, etc.).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before I merge, I guess I didn't explicitly give an answer to the actual question.
Then, (i) you want it to have a
B0FieldIdentifier
in it, or at the least theIntendedFor
so that the code to find fieldmap matches locates it, (ii) if you want to use SDCFlows' unwarp workflow, then you need to make sure that an anatomical reference is given and B-Spline coefficients representation available - if not, that's something you'll write on your own, (iii) invoke the unwarp workflow.As you will see with the links, both (i) and (iii) take place within the downstream library (i.e., not implemented in SDCFlows proper).