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

✨ Introduce mri_robust_template as option for longitudinal template generation #2165

Draft
wants to merge 12 commits into
base: prep_for/mri_robust_template
Choose a base branch
from

Conversation

shnizzedy
Copy link
Member

@shnizzedy shnizzedy commented Nov 25, 2024

Fixes

Related to #2164 by @shnizzedy & @Shinwon Park

Description

  • Adds using option to longitudinal_template_generation with a choice of mri_robust_template (default) or C-PAC legacy
    longitudinal_template_generation:
    # Implementation to use
    # Options: mri_robust_template, C-PAC legacy
    using: mri_robust_template
  • Updates intergraph connections for the $2n+1$ graphs used to run longitudinal template generation
    flowchart LR
    anat_longitudinal_pre-preproc("<code>anat_longitudinal_pre-preproc</code><br>(one per subject session)") --> template_node_brain("<code>template_node_brain</code><br>(one per subject)")
    template_node_brain --> ses_wf("<code>ses_wf</code><br>(one per subject session)")
    
    Loading
  • Updates output logic to have a structure like
    └── pipeline_cpac-default-pipeline
        └── sub-01
            ├── anat
            │   ├── sub-01_from-longitudinal_to-MNI152NLin2009cAsym_mode-image_desc-linear_xfm.json
            │   ├── sub-01_from-longitudinal_to-MNI152NLin2009cAsym_mode-image_desc-linear_xfm.mat
            │   ├── sub-01_space-longitudinal_desc-brain_T1w.json
            │   ├── sub-01_space-longitudinal_desc-brain_T1w.nii.gz
            │   ├── sub-01_space-longitudinal_desc-head_T1w.json
            │   └── sub-01_space-longitudinal_desc-head_T1w.nii.gz
            ├── ses-1
            │   └── anat
            │       ├── sub-01_ses-1_desc-brain_mask.json
            │       ├── sub-01_ses-1_desc-brain_mask.nii.gz
            │       ├── sub-01_ses-1_desc-head_T1w.json
            │       ├── sub-01_ses-1_desc-head_T1w.nii.gz
            │       ├── sub-01_ses-1_desc-preproc_T1w.json
            │       ├── sub-01_ses-1_desc-preproc_T1w.nii.gz
            │       ├── sub-01_ses-1_from-T1w_to-longitudinal_mode-image_desc-linear_xfm.json
            │       ├── sub-01_ses-1_from-T1w_to-longitudinal_mode-image_desc-linear_xfm.mat
            │       ├── sub-01_ses-1_from-T1w_to-MNI152NLin2009cAsym_mode-image_desc-li ear_xfm.json
            │       ├── sub-01_ses-1_from-T1w_to-MNI152NLin2009cAsym_mode-image_desc-linear_xfm.mat
            │       ├── sub-01_ses-1_space-longitudinal_desc-brain_T1w.json
            │       └── sub-01_ses-1_space-longitudinal_desc-brain_T1w.nii.gz
            └── ses-2
                └── anat
                    ├── sub-01_ses-2_desc-brain_mask.json
                    ├── sub-01_ses-2_desc-brain_mask.nii.gz
                    ├── sub-01_ses-2_desc-head_T1w.json
                    ├── sub-01_ses-2_desc-head_T1w.nii.gz
                    ├── sub-01_ses-2_desc-preproc_T1w.json
                    ├── sub-01_ses-2_desc-preproc_T1w.nii.gz
                    ├── sub-01_ses-2_from-T1w_to-longitudinal_mode-image_desc-linear_xfm.json
                    ├── sub-01_ses-2_from-T1w_to-longitudinal_mode-image_desc-linear_xfm.mat
                    ├── sub-01_ses-2_from-T1w_to-MNI152NLin2009cAsym_mode-image_desc-linear_xfm.json
                    ├── sub-01_ses-2_from-T1w_to-MNI152NLin2009cAsym_mode-image_desc-linear_xfm.mat
                    ├── sub-01_ses-2_space-longitudinal_desc-brain_T1w.json
                    └── sub-01_ses-2_space-longitudinal_desc-brain_T1w.nii.gz
    
    • There's probably some missing outputs in this example, but the idea is just that there's an anat directory that's a sibling to all the session directories, and that that anat directory has all the subject-but-not-session-specific outputs in it.
    • Do we want all of from-T1w_to-longitudinal and from-longitudinal_to-{template} and from-T1w_to-{template} or do we want to leave any out to be recalculated as needed?

Technical details

  • This PR merges into a branch that just restructures the longitudinal code from develop so those non-logic changes aren't part of this PR.
  • This PR leaves `"C-PAC legacy" broken.

Still to do

  • do we want to remove or rename "C-PAC legacy"?
  • test both participant and test_config analysis levels
  • fix filenaming that's leading to names like sub-01_ses-1_from-longitudinal_to-*_mode-image_xfm
  • check outputs and make sure
    • they have the longitudinal template in their provenance where applicable
    • they seem reasonable

Tests

Screenshots

Checklist

  • My pull request has a descriptive title (not a vague title like Update index.md).
  • My pull request targets the prep_for/mri_robust_template 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

1 participant