You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We could either add this functionality to cubids add-nifti-info or create a new command (cubids add-collection-info?). The idea would be to look for file collections (the combinations of entity and suffix to look for will need to be hardcoded), grab all files in a collection, load the relevant metadata fields, and concatenate them across the files to create an array-type metadata field that would be added to all of the JSONs for the files in the collection.
For example, with a multi-echo BOLD scan, we might have the following files:
sub-01_task-rest_echo-1_bold.nii.gz
sub-01_task-rest_echo-2_bold.nii.gz
sub-01_task-rest_echo-3_bold.nii.gz
The relevant metadata field in this scenario is EchoTime. Let's say that the files have the following metadata dictionaries, respectively:
{"EchoTime": 0.015}
{"EchoTime": 0.03}
{"EchoTime": 0.045}
The aggregation step should flag all three files, collect the EchoTime value from each, and concatenate those values in a new array that gets written out to all three metadata files, so they end up with the following:
Then, cubids group will only have to compare echo 1 to echo 1 across subjects, echo 2 to echo 2, etc. but if there is a variant run where echo 3 has a value of 0.05, then all three echoes of that variant run will be flagged as a variant because the array of echo times ([0.015, 0.03, 0.05] vs. the regular [0.015, 0.03, 0.045]) will differ from the dominant group.
In order to make this work, we need to encode the following in the function:
The "bold" suffix + the "echo" entity defines a file collection.
A file collection defined by the "echo" entity relies on the "EchoTime" metadata field.
The text was updated successfully, but these errors were encountered:
Summary
We could either add this functionality to
cubids add-nifti-info
or create a new command (cubids add-collection-info
?). The idea would be to look for file collections (the combinations of entity and suffix to look for will need to be hardcoded), grab all files in a collection, load the relevant metadata fields, and concatenate them across the files to create an array-type metadata field that would be added to all of the JSONs for the files in the collection.For example, with a multi-echo BOLD scan, we might have the following files:
sub-01_task-rest_echo-1_bold.nii.gz
sub-01_task-rest_echo-2_bold.nii.gz
sub-01_task-rest_echo-3_bold.nii.gz
The relevant metadata field in this scenario is EchoTime. Let's say that the files have the following metadata dictionaries, respectively:
{"EchoTime": 0.015}
{"EchoTime": 0.03}
{"EchoTime": 0.045}
The aggregation step should flag all three files, collect the EchoTime value from each, and concatenate those values in a new array that gets written out to all three metadata files, so they end up with the following:
{"EchoTime": 0.015, "EchoTimes": [0.015, 0.03, 0.045]}
{"EchoTime": 0.03, "EchoTimes": [0.015, 0.03, 0.045]}
{"EchoTime": 0.045, "EchoTimes": [0.015, 0.03, 0.045]}
Then,
cubids group
will only have to compare echo 1 to echo 1 across subjects, echo 2 to echo 2, etc. but if there is a variant run where echo 3 has a value of 0.05, then all three echoes of that variant run will be flagged as a variant because the array of echo times ([0.015, 0.03, 0.05] vs. the regular [0.015, 0.03, 0.045]) will differ from the dominant group.In order to make this work, we need to encode the following in the function:
The text was updated successfully, but these errors were encountered: