-
Notifications
You must be signed in to change notification settings - Fork 125
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
Populating of IntendedFor doesn't work as intended #554
Comments
sorry for a long delay with the reply. Unfortunately I am not entirely sure I understand the issue in full, and now that we have months passed for me to reply - probably you @pvelasco probably neither ;) Anyways - I think it behaves "as designed", that if heuristic has Sure thing we can also make it that by default (if heuristic does not define POPULATE_INTENDED_FOR_OPTS) we could make it not anyways -- may be you recall more details about the issue so we both could understand and fix it (if there is anything to fix)? |
Hi @pvelasco, @yarikoptic, i'm joining the conversation as I'm facing a related issue. I'd like to use and contribute to Some thoughts coming from this situation:
Now the question is: how to indicate in heudiconv the use of e.g. Tackling the current project where there are several field maps for several sets of tasks (cf exampe at bottom of this post), i realize that:
Here is a suggestion on how to explicitly indicate the association fmap <-> vol_to_apply when naming sequences at scanner level assuming a 1-to-many mapping (i can change the suggestion if assumption should be relaxed to the possibility of having several fieldmaps for the same volume):
This would be useful in many situations, including the example below:
In that case the suggestion would be implemented as:
|
For example when Difference (RUN1 vs RUN2 vs RUN3):
Image orientation
RUN1
"ImageOrientationPatientDICOM": [1, 0, 0, 0, 0.987414, -0.158158],
"ImageOrientationText": "Tra>Cor(-9.1)",
RUN2
### Different for RUN2 (compared to RUN 1 and 3)
"ImageOrientationPatientDICOM": [0.99941, -0.00542864, -0.0339265, -1.85412e-08, 0.987439, -0.158002],
"ImageOrientationText": "Tra>Cor(-9.1)>Sag(-2.0)",
RUN3
"ImageOrientationPatientDICOM": [1, 0, 0, 0, 0.987414, -0.158158],
"ImageOrientationText": "Tra>Cor(-9.1)",
RUN1
"dcmmeta_affine": [
[-2.0, 0.0, 0.0, 112.0],
[0.0, 1.9748276472091675, -0.3163161277770996, -83.08629608154297],
[0.0, 0.3163161277770996, 1.9748276472091675, -69.95376586914062],
[0.0, 0.0, 0.0, 1.0]
],
RUN2
### Different for RUN2 (compared to RUN 1 and 3)
"dcmmeta_affine": [
[-1.9988192319869995, -3.708231233190418e-08, -0.06871619075536728, 114.41260528564453],
[0.010857278481125832, 1.9748774766921997, -0.3158179819583893, -83.7149887084961],
[-0.06785303354263306, 0.31600457429885864, 1.9737114906311035, -66.09502410888672],
[0.0, 0.0, 0.0, 1.0]
],
RUN3
"dcmmeta_affine": [
[-2.0, 0.0, 0.0, 112.0],
[0.0, 1.9748276472091675, -0.3163161277770996, -83.08629608154297],
[0.0, 0.3163161277770996, 1.9748276472091675, -69.95376586914062],
[0.0, 0.0, 0.0, 1.0]
],
RUN1
"ImageOrientationPatient": [1.0, 0.0, 0.0, 0.0, 0.98741380685208, -0.1581580666229],
"ImagePositionPatient": [-1008.0, -1020.8423397953, 106.86694993027],
RUN2
### Different for RUN2 (compared to RUN 1 and 3)
"ImageOrientationPatient": [0.99940958635725, -0.0054286391578, -0.0339265172709, -1.8541157e-08, 0.98743874677083, -0.1580022828178],
"ImagePositionPatient": [-1009.8835740835, -1015.3774704411, 140.94968886346],
RUN3
"ImageOrientationPatient": [1.0, 0.0, 0.0, 0.0, 0.98741380685208, -0.1581580666229],
"ImagePositionPatient": [-1008.0, -1020.8423397953, 106.86694993027],
RUN1
"SpacingBetweenSlices": 2.0000000045657,
RUN2
### Different for RUN2 (compared to RUN 1 and 3)
"SpacingBetweenSlices": 1.9999999745851,
RUN3
"SpacingBetweenSlices": 2.0000000045657,
Shimming
RUN1
"ShimSetting": [-1245, -11654, 6449, 368, 237, -53, -59, 79],
RUN2
### Different for RUN2 (compared to RUN 1 and 3)
"ShimSetting": [-1247, -11654, 6449, 365, 231, -52, -60, 77],
RUN3
"ShimSetting": [-1245, -11654, 6449, 368, 237, -53, -59, 79],
Slice Timing
RUN1
"SliceTiming": [1.485, 0, 0.99, 0.0825, 1.0725, 0.165, 1.155, 0.2475, 1.2375, 0.33, 1.32, 0.4125, 1.4025, 0.5775, 1.5675, 0.66, 1.65, 0.7425, 1.7325, 0.825, 1.815, 0.9075, 1.8975, 0.495, 1.485, 0, 0.99, 0.0825, 1.0725, 0.165, 1.155, 0.2475, 1.2375, 0.33, 1.32, 0.4125, 1.4025, 0.5775, 1.5675, 0.66, 1.65, 0.7425, 1.7325, 0.825, 1.815, 0.9075, 1.8975, 0.495, 1.485, 0, 0.99, 0.0825, 1.0725, 0.165, 1.155, 0.2475, 1.2375, 0.33, 1.32, 0.4125, 1.4025, 0.5775, 1.5675, 0.66, 1.65, 0.7425, 1.7325, 0.825, 1.815, 0.9075, 1.8975, 0.495],
RUN2
"SliceTiming": [1.485, 0, 0.99, 0.0825, 1.0725, 0.165, 1.155, 0.2475, 1.2375, 0.33, 1.32, 0.4125, 1.4025, 0.5775, 1.5675, 0.66, 1.65, 0.7425, 1.7325, 0.825, 1.815, 0.9075, 1.8975, 0.495, 1.485, 0, 0.99, 0.0825, 1.0725, 0.165, 1.155, 0.2475, 1.2375, 0.33, 1.32, 0.4125, 1.4025, 0.5775, 1.5675, 0.66, 1.65, 0.7425, 1.7325, 0.825, 1.815, 0.9075, 1.8975, 0.495, 1.485, 0, 0.99, 0.0825, 1.0725, 0.165, 1.155, 0.2475, 1.2375, 0.33, 1.32, 0.4125, 1.4025, 0.5775, 1.5675, 0.66, 1.65, 0.7425, 1.7325, 0.825, 1.815, 0.9075, 1.8975, 0.495],
RUN3
### Different for RUN3 (compared to RUN 1 and 2)
"SliceTiming": [1.4825, 0, 0.99, 0.0825, 1.0725, 0.165, 1.1525, 0.2475, 1.235, 0.33, 1.3175, 0.4125, 1.4, 0.5775, 1.565, 0.66, 1.6475, 0.7425, 1.73, 0.825, 1.8125, 0.9075, 1.895, 0.495, 1.4825, 0, 0.99, 0.0825, 1.0725, 0.165, 1.1525, 0.2475, 1.235, 0.33, 1.3175, 0.4125, 1.4, 0.5775, 1.565, 0.66, 1.6475, 0.7425, 1.73, 0.825, 1.8125, 0.9075, 1.895, 0.495, 1.4825, 0, 0.99, 0.0825, 1.0725, 0.165, 1.1525, 0.2475, 1.235, 0.33, 1.3175, 0.4125, 1.4, 0.5775, 1.565, 0.66, 1.6475, 0.7425, 1.73, 0.825, 1.8125, 0.9075, 1.895, 0.495], |
@yarikoptic i'll start working on the PR with the |
We are also struggling with this case! In case it helps knowing there are more people interested on this! 🙂 |
Also, is leveraging B0FieldIdentifier a doos course of action here? |
sorry for the delay... have you had any luck implementing what you have envisioned? Some notes from my thinking on this: I am not sure if adding
may be some if not of above concerns could be worked out by using those |
that is interesting!
edit 1: FWIW -- seems not yet used in any openneuro dataset ? (assuming that .json go to git) https://github.com/search?q=org%3AOpenNeuroDatasets+B0FieldIdentifier |
Hi @yarikoptic , yes in the process of testing the I understand the worry about BIDS compatibility. Maybe we could have a list of heudiconv reserved keywords and throw a warning if one day BIDS end up using one of those ? Since the Maybe i can touch base with the BIDS group to check if that could be of interest in bids specs to ensure compatibility ? |
@neurorepro @mirestrepo - have you looked more into that B0FieldIdentifier situation? is that anything we could actually somehow deduce from DICOMS? FWIW -- there are some openneuro datasets where it does have it specified -- https://github.com/search?q=org%3AOpenNeuroDatasets+B0FieldIdentifier&type=code |
Summary
Originally raised in #482 (comment).
I messed up the workflow for the population of the
"IntendedFor"
field, and it doesn't behave as expected.Because the population of
"IntendedFor"
needs to run after all the files are "bidsified", we decided that this feature would be run as a--command
option, instead of the default behavior. So, if the--command populate-intended-for
option is passed, that is what happens: instead of the regularworkflow
,process_extra_commands
is called.However, even if that option is not passed,
convert
also runspopulate_intended_for
if thePOPULATE_INTENDED_FOR_OPTS
dict is included in the heuristic file.So, question @yarikoptic : should I fix this so that it is called only when passing the
--command populate-intended-for
argument, or only when present in the heuristic (regardless of the--command
)? The advantage of running it when present in the heuristic is that you only need to runheudiconv
once; if you control it via de--command
argument, you need to callheudiconv
twice: once for the initial classification and then again to populate the field. The advantage of controlling it via the--command
is that you have more control: you can runheudiconv
without the population of the intended if so you desire using a heuristic file that has thePOPULATE_INTENDED_FOR_OPTS
.There is a third option: to have a new argument:
--populate-intended-for
, which will run the population of the"IntendeFor"
fields at the end ofheudiconv
, so that the user doesn't need to call it twice.Platform details:
Choose one:
master
(e747f05) and pip install it.master
(current: e747f05)The text was updated successfully, but these errors were encountered: