Fix space other use and correct json sidecars #170
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.
Description
This PR fixes:
space-other
introduced in this former PR.
Miss use of the BIDS entity
space-other
The entity
space-XXX
should only be used on a label if the space of the latter is different from the one of the corresponding image (see our documentation).To fix this, I iterated through all the labels in the derivative folder
labels
with thespace-other
entity using this script:the entity
space-other
was removed from the label and the corresponding json sidecar if the array size was the same as the corresponding raw image.the entity
space-other
was moved after the first suffix for the label and the corresponding json sidecar if the array size was different between the raw image and the label. (e.g. labels were renamed fromsub-subject001_space-other_T1w_label-SC_seg.nii.gz
-->sub-subject001_T1w_space-other_label-SC_seg.nii.gz
)Potential underlying problem
In this PR , it looks like all the T1w images were resampled to 1mm3, all the T2w images were resampled to 0.8mm3... without considering the resolution of the raw image. Even though this was true for most of the labels, it is actually not true for some images.
RPI
orientation.Fixing JSON sidecars
JSON sidecars were modified as well to follow our convention. The script used is here.
Examples
Manual + Resampling (same space)
Before
After
Manual + Root Mean Square (same space)
Before
After
Manual + Resampling (different space)
Before
After