Skip to content

Commit

Permalink
ENH: Use CreateDenseTimeSeries rois for surface masking
Browse files Browse the repository at this point in the history
  • Loading branch information
mgxd committed May 11, 2022
1 parent 7b68a84 commit 57b73ad
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions nibabies/workflows/bold/resampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,6 @@ 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.gifti import MaskGifti
from ...interfaces.workbench import CiftiCreateDenseTimeseries

workflow = Workflow(name=name)
Expand Down Expand Up @@ -728,17 +727,6 @@ def init_bold_grayords_wf(grayord_density, mem_gb, repetition_time, name="bold_g
"space-fsLR_hemi-%s_den-%s_bold.gii" % (h, grayord_density) for h in "LR"
]

medial_masks = [
str(f)
for f in tf.api.get("fsLR", density=fslr_density, desc="nomedialwall", suffix="dparc")
]
mask_gifti = pe.MapNode(
MaskGifti(),
iterfield=["in_file", "mask_file"],
name="mask_gifti",
)
mask_gifti.inputs.mask_file = medial_masks

split_surfaces = pe.Node(
niu.Function(function=_split_surfaces, output_names=["left_surface", "right_surface"]),
name="split_surfaces",
Expand All @@ -748,6 +736,12 @@ def init_bold_grayords_wf(grayord_density, mem_gb, repetition_time, name="bold_g
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", "variant", "density"]),
name="gen_cifti_metadata",
Expand All @@ -762,8 +756,7 @@ def init_bold_grayords_wf(grayord_density, mem_gb, repetition_time, name="bold_g
(inputnode, select_fs_surf, [('surf_files', 'surf_files'),
('surf_refs', 'keys')]),
(select_fs_surf, resample, [('surf_files', 'in_file')]),
(resample, mask_gifti, [('out_file', 'in_file')]),
(mask_gifti, split_surfaces, [('out_file', 'in_surfaces')]),
(resample, split_surfaces, [('out_file', 'in_surfaces')]),
(split_surfaces, gen_cifti, [
('left_surface', 'left_metric'),
('right_surface', 'right_metric')]),
Expand Down

0 comments on commit 57b73ad

Please sign in to comment.