Skip to content

Commit

Permalink
Merge pull request #9 from PennLINC/enh/ukb
Browse files Browse the repository at this point in the history
session-wise anatomicals for UKB
  • Loading branch information
smeisler authored Nov 18, 2024
2 parents 0abf2c9 + 1337a7e commit 28a7bb6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions ingress2qsirecon/utils/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,32 +159,32 @@ def make_bids_file_paths(subject_layout: dict) -> dict:
t1_oblique_string = ""

bids_t1w_brain = os.path.join(
bids_base, "anat", f"sub-{subject}" + t1_oblique_string + "_desc-preproc_T1w.nii.gz"
bids_base_session, "anat", sub_session_string + t1_oblique_string + "_desc-preproc_T1w.nii.gz"
)
bids_file_paths.update({"bids_t1w_brain": Path(bids_t1w_brain)})
if "brain_mask" in subject_layout:
bids_brain_mask = os.path.join(
bids_base, "anat", f"sub-{subject}" + t1_oblique_string + "_desc-brain_mask.nii.gz"
bids_base_session, "anat", sub_session_string + t1_oblique_string + "_desc-brain_mask.nii.gz"
)
bids_file_paths.update({"bids_brain_mask": Path(bids_brain_mask)})
if "subject2MNI" in subject_layout:
bids_subject2MNI = os.path.join(
bids_base, "anat", f"sub-{subject}" + f"_from-T1w_to-{mni_template}_mode-image_xfm.h5"
bids_base_session, "anat", sub_session_string + f"_from-T1w_to-{mni_template}_mode-image_xfm.h5"
)
bids_file_paths.update({"bids_subject2MNI": Path(bids_subject2MNI)})
else:
bids_subject2MNI = os.path.join(
bids_base, "anat", f"sub-{subject}" + f"_from-T1w_to-MNI152NLin2009cAsym_mode-image_xfm.h5"
bids_base_session, "anat", sub_session_string + f"_from-T1w_to-MNI152NLin2009cAsym_mode-image_xfm.h5"
)
bids_file_paths.update({"bids_subject2MNI": Path(bids_subject2MNI)})
if "MNI2subject" in subject_layout:
bids_MNI2subject = os.path.join(
bids_base, "anat", f"sub-{subject}" + f"_from-{mni_template}_to-T1w_mode-image_xfm.h5"
bids_base_session, "anat", sub_session_string + f"_from-{mni_template}_to-T1w_mode-image_xfm.h5"
)
bids_file_paths.update({"bids_MNI2subject": Path(bids_MNI2subject)})
else:
bids_MNI2subject = os.path.join(
bids_base, "anat", f"sub-{subject}" + f"_from-MNI152NLin2009cAsym_to-T1w_mode-image_xfm.h5"
bids_base_session, "anat", sub_session_string + f"_from-MNI152NLin2009cAsym_to-T1w_mode-image_xfm.h5"
)
bids_file_paths.update({"bids_MNI2subject": Path(bids_MNI2subject)})

Expand Down
4 changes: 2 additions & 2 deletions ingress2qsirecon/utils/workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@ def create_single_subject_wf(subject_layout, input_pipeline, skip_mni2009c_norm=

# Make BIDS subject output folder
bids_base = subject_layout['bids_base']
if not os.path.exists(bids_base):
os.makedirs(Path(bids_base / "anat").resolve(), exist_ok=True)
session = subject_layout['session']
if session == None:
os.makedirs(Path(bids_base / "dwi").resolve(), exist_ok=True)
os.makedirs(Path(bids_base / "anat").resolve(), exist_ok=True)
else:
os.makedirs(Path(bids_base / f"ses-{session}" / "dwi").resolve(), exist_ok=True)
os.makedirs(Path(bids_base / f"ses-{session}" / "anat").resolve(), exist_ok=True)

# Create single subject workflow
wf_name = f"ingress2qsirecon_single_subject_{subject_name}_wf"
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "Ingress2QSIRecon"
version = "0.2.2"
version = "0.2.3"
description = "Tool to ingress data from other pipelines for use in QSIRecon"
authors = ["Steven Meisler <[email protected]>"]
readme = "README.md"
Expand Down

0 comments on commit 28a7bb6

Please sign in to comment.