Skip to content
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

ENH: Ensure subcortical CIFTI is in LAS orientation #484

Merged
merged 1 commit into from
Mar 20, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion niworkflows/interfaces/cifti.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,9 @@ def _create_cifti_image(bold_file, label_file, bold_surfs, annotation_files, tr,
warnings.warn("Resampling bold volume to match label dimensions")
bold_img = resample_to_img(bold_img, label_img)

bold_img = _reorient_image(bold_img, target_img=label_img)
# ensure images match HCP orientation (LAS)
bold_img = _reorient_image(bold_img, orientation='LAS')
label_img = _reorient_image(label_img, orientation='LAS')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this going to be the case for all label files? Should we have a table mapping space to orientation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, since the final output should always be in LAS we want to ensure both BOLD / labels are as well prior to setting the IJK voxels

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess my reading of Tim's response was that LAS was an accident of the orientation of a specific template. Are we guaranteed that all templates HCP ever uses will be in LAS?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, we aren't - but that seems excessive for us to worry about. I'd rather mirror the outputs generated from HCP Pipelines, which happen to include the volume in LAS orientation


bold_data = bold_img.get_fdata(dtype='float32')
timepoints = bold_img.shape[3]
Expand Down