-
Notifications
You must be signed in to change notification settings - Fork 35
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
Handle duplicated fieldmaps in interrupted session #123
Comments
Mhhh, this requires a bit of logic on top of the glob() search approach. But it's a fair point, I'll see what I can do |
A viable consistent solution, but I'm not sure if within the scope of BIDScoin, could be the following. The fieldmaps are intended for any task that is acquired after them but before another filedmaps, if they're present, and so on. |
I am thinking of extending the bidsmap language a bit, e.g. with a colon-separated slicing term:
This would select the last task run only
would select the last two runs
would select the first two runs |
But this doesn't solve your problem. It needs to be relative to the seriesnumber of the fieldmap. Implementing that is a bit more complicated |
Thanks for a quick feedback. I think, that is exactly the problem. I'll sleep over it :-) |
It's a bit convoluted to implement, but the problem at hand is a bit convoluted, so there is no way around it I think. I am currently thinking of:
Select maximally four preceding 'taskname' runs until a fieldmap with the same name but with a smaller run index
Select maximally three subsequent 'taskname' runs until a fieldmap with the same name but with a larger run index
Select maximally two preceeding/subsequent 'taskname' runs until a fieldmap with the same name but with a smaller or larger run index |
I implemented the above, but haven't tested it, could you perhaps give it a try? |
Wow! Thank you :-) I knew it wasn't trivial to do and haven't expected any implementation. I'm more than happy to test it. But I may not be done today. |
It seems to work on one example but let me do more testing and look at the code. I'd also like to understand better your solution because it is very general. |
I actually thought about making it even more general, such as allowing for using json data to select files, e.g. <<IntendedFor:{EchoTime: 40}>>. I can still do that if needed, but the IntendedFor system is going to change in future BIDS versions, so I thought to keep it a bit more simple till then |
Could you point me to any information about it? Is it this project? |
I saw discussions on various places, e.g.: |
I've started working on a script to generate DICOM files. I finally need some dummy data to test BIDS conversion. The important part is that dcm2niix can process the generated files without complaining too much. Once I'm done, I'll generate a few cases, test the interrupted sessions and come back here. |
I've generated DICOMs for three subjects with DICOM generator and the following three configurations. I paste them at the end of the comment because GitHub doesn't support uploading JSON files here. Dealing with the interrupted sessions works as expected with I tested it for the commit
[
{
"ImageType" : "anat",
"SeriesDescription" : "T1w"
},
{
"ImageType" : "magnitude",
"SeriesDescription" : "fmap"
},
{
"ImageType" : "phase",
"SeriesDescription" : "fmap"
},
{
"ImageType" : "fmri",
"SeriesDescription" : "fmri1"
},
{
"ImageType" : "fmri",
"SeriesDescription" : "fmri2"
},
{
"ImageType" : "fmri",
"SeriesDescription" : "fmri3"
}
]
[
{
"ImageType" : "anat",
"SeriesDescription" : "T1w"
},
{
"ImageType" : "magnitude",
"SeriesDescription" : "fmap"
},
{
"ImageType" : "phase",
"SeriesDescription" : "fmap"
},
{
"ImageType" : "fmri",
"SeriesDescription" : "fmri1"
},
{
"ImageType" : "fmri",
"SeriesDescription" : "fmri2"
},
{
"ImageType" : "magnitude",
"SeriesDescription" : "fmap"
},
{
"ImageType" : "phase",
"SeriesDescription" : "fmap"
},
{
"ImageType" : "fmri",
"SeriesDescription" : "fmri3"
}
]
[
{
"ImageType" : "anat",
"SeriesDescription" : "T1w"
},
{
"ImageType" : "magnitude",
"SeriesDescription" : "fmap"
},
{
"ImageType" : "phase",
"SeriesDescription" : "fmap"
},
{
"ImageType" : "fmri",
"SeriesDescription" : "fmri1"
},
{
"ImageType" : "magnitude",
"SeriesDescription" : "fmap"
},
{
"ImageType" : "phase",
"SeriesDescription" : "fmap"
},
{
"ImageType" : "fmri",
"SeriesDescription" : "fmri2"
},
{
"ImageType" : "magnitude",
"SeriesDescription" : "fmap"
},
{
"ImageType" : "phase",
"SeriesDescription" : "fmap"
},
{
"ImageType" : "fmri",
"SeriesDescription" : "fmri3"
}
] |
I've tested it again with the commit 546d14a and it works as expected. Shall we close this issue? |
General summary
I'm trying to develop an end-to-end solution for handling duplicated fieldmaps in the case of interrupted sessions. I'm wandering what would be the best BIDScoin-based solution for that.
Additional detail
I briefly described the problem of interrupted sessions. The scenario is the following. The experiment consists of more than one functional scans, lets say
task-1
andtask-2
. The fieldmaps are acquired. Some time after the first functional scan, the subject has to leave the scanner. Hence, the fieldmaps have to be acquired again after the return to the scanner. This leads to a situation when two sets of fieldmaps have to be kept, one fortask-1
and another fortask-2
. The names of fieldmaps scans are not modified on the scanner.The interruption is not consistent among subjects and, in case of multiple functional scans, can happen anytime. Using automatic
run-
indexes lets us differentiate the fieldmaps. However, this is applied to fieldmaps of all subjects, even if some subjects do not have duplicates. Moreover, if duplicated fieldmaps are not intended for specific scans consistently, this needs to be done manually.Next steps
The text was updated successfully, but these errors were encountered: