@@ -1319,11 +1319,11 @@ def init_anat_ribbon_wf(name='anat_ribbon_wf'):
1319
1319
return workflow
1320
1320
1321
1321
1322
- def init_resample_surfaces_wb_wf (
1322
+ def init_resample_surfaces_wf (
1323
1323
surfaces : list [str ],
1324
1324
space : str ,
1325
1325
density : str ,
1326
- name : str = 'resample_surfaces_wb_wf ' ,
1326
+ name : str = 'resample_surfaces_wf ' ,
1327
1327
):
1328
1328
"""
1329
1329
Resample subject surfaces surface to specified space and density.
@@ -1333,8 +1333,8 @@ def init_resample_surfaces_wb_wf(
1333
1333
:graph2use: colored
1334
1334
:simple_form: yes
1335
1335
1336
- from smriprep.workflows.surfaces import init_resample_surfaces_wb_wf
1337
- wf = init_resample_surfaces_wb_wf (
1336
+ from smriprep.workflows.surfaces import init_resample_surfaces_wf
1337
+ wf = init_resample_surfaces_wf (
1338
1338
surfaces=['white', 'pial', 'midthickness'],
1339
1339
space='onavg',
1340
1340
density='10k',
@@ -1349,7 +1349,7 @@ def init_resample_surfaces_wb_wf(
1349
1349
density : :class:`str`
1350
1350
The density to resample to, e.g., ``'10k'``, ``'41k'``. Number of vertices per hemisphere.
1351
1351
name : :class:`str`
1352
- Unique name for the subworkflow (default: ``"resample_surfaces_wb_wf "``)
1352
+ Unique name for the subworkflow (default: ``"resample_surfaces_wf "``)
1353
1353
1354
1354
Inputs
1355
1355
------
@@ -1375,7 +1375,7 @@ def init_resample_surfaces_wb_wf(
1375
1375
)
1376
1376
1377
1377
outputnode = pe .Node (
1378
- niu .IdentityInterface (fields = [f'{ surf } _resampled ' for surf in surfaces ]), name = 'outputnode'
1378
+ niu .IdentityInterface (fields = [f'{ surf } _ { space } ' for surf in surfaces ]), name = 'outputnode'
1379
1379
)
1380
1380
1381
1381
surface_list = pe .Node (
@@ -1422,84 +1422,7 @@ def init_resample_surfaces_wb_wf(
1422
1422
(surface_list , resampler , [('out' , 'surface_in' )]),
1423
1423
(resampler , surface_groups , [('surface_out' , 'inlist' )]),
1424
1424
(surface_groups , outputnode , [
1425
- (f'out{ i } ' , f'{ surf } _resampled' ) for i , surf in enumerate (surfaces , start = 1 )
1426
- ]),
1427
- ]) # fmt:skip
1428
-
1429
- return workflow
1430
-
1431
-
1432
- def init_resample_surfaces_wf (
1433
- surfaces : list [str ],
1434
- grayord_density : ty .Literal ['91k' , '170k' ],
1435
- name : str = 'resample_surfaces_wf' ,
1436
- ):
1437
- """
1438
- Resample subject surfaces surface to specified density.
1439
-
1440
- Workflow Graph
1441
- .. workflow::
1442
- :graph2use: colored
1443
- :simple_form: yes
1444
-
1445
- from smriprep.workflows.surfaces import init_resample_surfaces_wf
1446
- wf = init_resample_surfaces_wf(
1447
- surfaces=['white', 'pial', 'midthickness'],
1448
- grayord_density='91k',
1449
- )
1450
-
1451
- Parameters
1452
- ----------
1453
- surfaces : :class:`list` of :class:`str`
1454
- Names of surfaces (e.g., ``'white'``) to resample. Both hemispheres will be resampled.
1455
- grayord_density : :class:`str`
1456
- Either `91k` or `170k`, representing the total of vertices or *grayordinates*.
1457
- name : :class:`str`
1458
- Unique name for the subworkflow (default: ``"resample_surfaces_wf"``)
1459
-
1460
- Inputs
1461
- ------
1462
- ``<surface>``
1463
- Left and right GIFTIs for each surface name passed to ``surfaces``
1464
- sphere_reg_fsLR
1465
- GIFTI surface mesh corresponding to the subject's fsLR registration sphere
1466
-
1467
- Outputs
1468
- -------
1469
- ``<surface>``
1470
- Left and right GIFTI surface mesh corresponding to the input surface, resampled to fsLR
1471
- """
1472
- # import templateflow.api as tf
1473
- from niworkflows .engine .workflows import LiterateWorkflow as Workflow
1474
-
1475
- workflow = Workflow (name = name )
1476
-
1477
- fslr_density = '32k' if grayord_density == '91k' else '59k'
1478
-
1479
- inputnode = pe .Node (
1480
- niu .IdentityInterface (fields = [* surfaces , 'sphere_reg_fsLR' ]),
1481
- name = 'inputnode' ,
1482
- )
1483
-
1484
- outputnode = pe .Node (
1485
- niu .IdentityInterface (fields = [f'{ surf } _fsLR' for surf in surfaces ]), name = 'outputnode'
1486
- )
1487
-
1488
- resample_surfaces_wb_wf = init_resample_surfaces_wb_wf (
1489
- surfaces = surfaces ,
1490
- space = 'fsLR' ,
1491
- density = fslr_density ,
1492
- name = 'resample_surfaces_fslr_wb_wf' ,
1493
- )
1494
- workflow .connect ([
1495
- (inputnode , resample_surfaces_wb_wf , [
1496
- (surf , 'inputnode.' + surf ) for surf in surfaces
1497
- ]),
1498
- (inputnode , resample_surfaces_wb_wf , [
1499
- ('sphere_reg_fsLR' , 'inputnode.sphere_reg_fsLR' ),
1500
- ]),
1501
- (resample_surfaces_wb_wf , outputnode , [
1502
- (f'outputnode.{ surf } _resampled' , f'{ surf } _fsLR' ) for surf in surfaces
1425
+ (f'out{ i } ' , f'{ surf } _{ space } ' ) for i , surf in enumerate (surfaces , start = 1 )
1503
1426
]),
1504
1427
]) # fmt:skip
1505
1428
0 commit comments