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

➕ Reorient resources to set orientation in config #2168

Merged
merged 37 commits into from
Dec 12, 2024

Conversation

shnizzedy
Copy link
Member

@shnizzedy shnizzedy commented Dec 11, 2024

Fixes

Related to #2140 by @birajstha
Related to #2161 by @shnizzedy
Fixes #2138 by @sgiavasis for v1.8.7.post1

Description

Merges

the changes

Description

This PR fixes the different orientation in CPAC output dir that were caused by the different orientation of templates being ingressed.

  • Added reorientation to the templates that are being ingressed and /or resampled (for different resolution) in CPAC.
  • Added desired_orientation as config key in blank-config and set it default to RPI
    With this PR the desired orientation of the outputs can be selected by modifying this key in the config.

Technical details

First of all,
The reorientation of templates are done as below
check_templates_orientation

  • resolve_resolution function is modified to take in orientation as extra input.
  • Orientation inputs are taken from the config and are added in the following spots
  1. resolve_resolution
  2. freesurfer_fs_brain_connector
  3. anatomical_init_T1
  4. anatomical_init_T2
  5. func_reorient

Tests

For testing you can run this branch of CPAC on one test subject / session with your config (set as desired_orientation) and check the orientations of the images in the output directory both anat and func

  1. cd into the anat or func directory.
  2. run for file in *.nii.gz; do orientation=$(3dinfo -orient "$file" 2>/dev/null); echo "$file: $orientation"; done

You should see the filename with orientations as below
anat :
anat

func :
func

Screenshots

Problem: Different orientations in the CPAC output dir

  1. anat dir:
    p_anat

  2. func dir:
    p_func

After fix:

  1. anat dir:
    anat

  2. func dir:
    func

from #2140 onto 6b3c934.

Checklist

  • My pull request has a descriptive title (not a vague title like Update index.md).
  • My pull request targets the hotfix/1.8.7-1 branch of the repository.
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • I added tests for the changes I made (if applicable).
  • I updated the changelog.
  • I added or updated documentation (if applicable).
  • I tried running the project locally and verified that there are no visible errors.

Developer Certificate of Origin

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

Biraj Shrestha and others added 30 commits December 11, 2024 12:33
…tation set in config in the existing nodes for reorientations
@shnizzedy shnizzedy added this to the 1.8.7.post1 milestone Dec 11, 2024
@shnizzedy shnizzedy requested a review from a team December 11, 2024 21:02
@shnizzedy shnizzedy self-assigned this Dec 11, 2024
@shnizzedy
Copy link
Member Author

I'm not sure if 043a004 and c725a9d are relevant here. They're included in #2161 but not in #2140

@shnizzedy shnizzedy force-pushed the hotfix/1.8.7-reorient branch from 9b42444 to 2e8c8ff Compare December 11, 2024 21:13
@shnizzedy shnizzedy force-pushed the hotfix/1.8.7-reorient branch from 1ac0e70 to e5afb2c Compare December 11, 2024 22:03
@shnizzedy shnizzedy merged commit cc0ff4d into hotfix/1.8.7-1 Dec 12, 2024
36 checks passed
@shnizzedy shnizzedy deleted the hotfix/1.8.7-reorient branch December 12, 2024 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants