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

FIX: restore cifti medial wall masking, subcortical volume LAS reorientation #298

Merged
merged 2 commits into from
Jun 15, 2023
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
19 changes: 14 additions & 5 deletions nibabies/workflows/bold/resampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,7 @@ def init_bold_grayords_wf(grayord_density, mem_gb, repetition_time, name="bold_g
from niworkflows.engine.workflows import LiterateWorkflow as Workflow
from niworkflows.interfaces.utility import KeySelect

from ...interfaces.nibabel import ReorientImage
from ...interfaces.workbench import CiftiCreateDenseTimeseries

workflow = Workflow(name=name)
Expand Down Expand Up @@ -1137,9 +1138,16 @@ def init_bold_grayords_wf(grayord_density, mem_gb, repetition_time, name="bold_g
niu.Function(function=_split_surfaces, output_names=["left_surface", "right_surface"]),
name="split_surfaces",
)

reorient_data = pe.Node(ReorientImage(target_orientation="LAS"), name="reorient_data")
reorient_labels = reorient_data.clone(name="reorient_labels")

gen_cifti = pe.Node(CiftiCreateDenseTimeseries(timestep=repetition_time), name="gen_cifti")
gen_cifti.inputs.volume_structure_labels = str(
tf.api.get("MNI152NLin6Asym", resolution=2, atlas="HCP", suffix="dseg")
gen_cifti.inputs.roi_left = tf.api.get(
"fsLR", density=fslr_density, hemi="L", desc="nomedialwall", suffix="dparc"
)
gen_cifti.inputs.roi_right = tf.api.get(
"fsLR", density=fslr_density, hemi="R", desc="nomedialwall", suffix="dparc"
)
gen_cifti_metadata = pe.Node(
niu.Function(function=_gen_metadata, output_names=["out_metadata"]),
Expand All @@ -1149,9 +1157,10 @@ def init_bold_grayords_wf(grayord_density, mem_gb, repetition_time, name="bold_g

# fmt: off
workflow.connect([
(inputnode, gen_cifti, [
('subcortical_volume', 'volume_data'),
('subcortical_labels', 'volume_structure_labels')]),
(inputnode, reorient_data, [("subcortical_volume", "in_file")]),
(inputnode, reorient_labels, [("subcortical_labels", "in_file")]),
(reorient_data, gen_cifti, [("out_file", "volume_data")]),
(reorient_labels, gen_cifti, [("out_file", "volume_structure_labels")]),
(inputnode, select_fs_surf, [('surf_files', 'surf_files'),
('surf_refs', 'keys')]),
(select_fs_surf, resample, [('surf_files', 'in_file')]),
Expand Down