Skip to content

Commit 03d8c93

Browse files
committed
FIX: Convert to vertex areas
1 parent 758dbcc commit 03d8c93

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

nibabies/workflows/anatomical/resampling.py

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ def init_mcribs_morph_grayords_wf(
175175
from niworkflows.engine.workflows import LiterateWorkflow as Workflow
176176
from smriprep.interfaces.cifti import GenerateDScalar
177177

178+
from nibabies.interfaces.workbench import SurfaceVertexAreas
179+
178180
workflow = Workflow(name=name)
179181
workflow.__desc__ = f"""\
180182
*Grayordinate* "dscalar" files [@hcppipelines] containing {grayord_density} samples were
@@ -206,15 +208,19 @@ def init_mcribs_morph_grayords_wf(
206208
run_without_submitting=True,
207209
)
208210

209-
get_current_midthickness = pe.Node(
211+
subject_midthickness = pe.Node(
210212
niu.Function(function=_get_surf),
211213
name="get_midthickness",
212214
run_without_submitting=True,
213215
)
214-
get_current_midthickness.inputs.name = "midthickness"
215-
get_current_midthickness.inputs.mult = 3
216+
subject_midthickness.inputs.name = "midthickness"
217+
subject_midthickness.inputs.mult = 3
218+
219+
template_midthickness = subject_midthickness.clone("get_new_midthickness")
216220

217-
get_new_midthickness = get_current_midthickness.clone("get_new_midthickness")
221+
# Create Vertex Areas from midthickness surfaces
222+
subject_va = pe.MapNode(SurfaceVertexAreas(), iterfield="in_file", name="subject_va")
223+
template_va = subject_va.clone("template_va")
218224

219225
# Setup Workbench command. LR ordering for hemi can be assumed, as it is imposed
220226
# by the iterfield of the MapNode in the surface sampling workflow above.
@@ -258,10 +264,12 @@ def init_mcribs_morph_grayords_wf(
258264

259265
# fmt: off
260266
workflow.connect([
261-
(inputnode, get_current_midthickness, [("surfaces", "surfaces")]),
262-
(inputnode, get_new_midthickness, [("midthickness_fsLR", "surfaces")]),
263-
(get_current_midthickness, resample, [("out", "current_area")]),
264-
(get_new_midthickness, resample, [("out", "new_area")]),
267+
(inputnode, subject_midthickness, [("surfaces", "surfaces")]),
268+
(inputnode, template_midthickness, [("midthickness_fsLR", "surfaces")]),
269+
(subject_midthickness, subject_va, [("out", "in_file")]),
270+
(template_midthickness, template_va, [("out", "in_file")]),
271+
(subject_va, resample, [("out_file", "current_area")]),
272+
(template_va, resample, [("out_file", "new_area")]),
265273
(inputnode, surfmorph_list, [
266274
(('morphometrics', _get_surf, "curv"), "in1"),
267275
(('morphometrics', _get_surf, "sulc"), "in2"),

0 commit comments

Comments
 (0)