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

Better match workflows #20

Merged
merged 9 commits into from
Nov 3, 2023
Merged

Better match workflows #20

merged 9 commits into from
Nov 3, 2023

Conversation

bendhouseart
Copy link
Collaborator

This fixes many of this issues that pop up when petdeface encounters different BIDS layouts, mostly:

  1. anatomical file in each session folder
  2. anatomical file in a single session folder
  3. anatomical file in the subject directory (not in a session folder)

Will convert from draft when it's complete.

sessions/runs into file names. Presently output of this pipeline is
as follows:

$ tree derivatives/
derivatives/
└── petdeface
    ├── dataset_description.json
    ├── sub-PS50
    │   └── anat
    │       ├── sub-PS50_T1w_defaced.nii
    │       └── sub-PS50_T1w_facemask.nii
    ├── sub-PS50_ses-baseline
    │   └── pet
    │       ├── registration.lta
    │       └── sub-PS50_ses-baseline_pet_defaced.nii.gz
    └── sub-PS50_ses-blocked
        └── pet
            ├── registration.lta
            └── sub-PS50_ses-blocked_pet_defaced.nii.gz

7 directories, 7 files

At the least we need to label the regstration files better so
we don't get collisions if we flatten this out by subject.
@bendhouseart
Copy link
Collaborator Author

Current status of Friday the 🦇 13th 🦇

$ for FOLDER in COX*; do tree $FOLDER/derivatives/petdeface; done
COX-1_analysis_faced_anat_in_each_session_folder/derivatives/petdeface
├── dataset_description.json
├── sub-PS50_ses-baseline
│   ├── anat
│   │   ├── sub-PS50_ses-baseline_T1w_defaced.nii
│   │   └── sub-PS50_ses-baseline_T1w_facemask.nii
│   └── pet
│       ├── registration.lta
│       └── sub-PS50_ses-baseline_pet_defaced.nii.gz
└── sub-PS50_ses-blocked
    ├── anat
    │   ├── sub-PS50_ses-blocked_T1w_defaced.nii
    │   └── sub-PS50_ses-blocked_T1w_facemask.nii
    └── pet
        ├── registration.lta
        └── sub-PS50_ses-blocked_pet_defaced.nii.gz

6 directories, 9 files
COX-1_analysis_faced_anat_in_first_session_folder/derivatives/petdeface
├── dataset_description.json
├── sub-PS50_ses-baseline
│   ├── anat
│   │   ├── sub-PS50_ses-baseline_T1w_defaced.nii
│   │   └── sub-PS50_ses-baseline_T1w_facemask.nii
│   └── pet
│       ├── registration.lta
│       └── sub-PS50_ses-baseline_pet_defaced.nii.gz
└── sub-PS50_ses-blocked
    └── pet
        ├── registration.lta
        └── sub-PS50_ses-blocked_pet_defaced.nii.gz

5 directories, 7 files
COX-1_analysis_faced_inherit_anat/derivatives/petdeface
├── dataset_description.json
├── sub-PS50
│   └── anat
│       ├── sub-PS50_T1w_defaced.nii
│       └── sub-PS50_T1w_facemask.nii
├── sub-PS50_ses-baseline
│   └── pet
│       ├── registration.lta
│       └── sub-PS50_ses-baseline_pet_defaced.nii.gz
└── sub-PS50_ses-blocked
    └── pet
        ├── registration.lta
        └── sub-PS50_ses-blocked_pet_defaced.nii.gz

6 directories, 7 files

@bendhouseart
Copy link
Collaborator Author

Pretty close to outputting proper bids directly to the derivatives directory, should be much easier now that I'm able to keep track of what workflow files belong to what inputs.

@bendhouseart
Copy link
Collaborator Author

@bilgelm tagging

Copy link
Contributor

@bilgelm bilgelm left a comment

Choose a reason for hiding this comment

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

The code looks a lot cleaner now.

"No T1w images found for participant {}. "
"All workflows require T1w images.".format(subject_id)
)
data = collect_anat_and_pet(bids_data)
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like the pet-mri matching is now being done by this petutils function. Cool!

@mnoergaard mnoergaard marked this pull request as ready for review November 2, 2023 18:20
Copy link
Collaborator

@mnoergaard mnoergaard left a comment

Choose a reason for hiding this comment

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

Overall LGTM.

@bendhouseart bendhouseart merged commit 6dfbab4 into main Nov 3, 2023
@bendhouseart bendhouseart deleted the better-match-workflows branch November 3, 2023 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants