Skip to content

Commit bac897f

Browse files
committed
🔀 Merge branch 'develop' into 'decrease-fragility/xcpqc'
2 parents 9c551be + 2777fbe commit bac897f

File tree

12 files changed

+202
-237
lines changed

12 files changed

+202
-237
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ cpac_runs
44
.env*
55
.git
66
.github
7+
!.github/CODEOWNERS
78
!.github/scripts
89
*.tar.gz

.github/CODEOWNERS

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Copyright (C) 2025 C-PAC Developers
2+
3+
# This file is part of C-PAC.
4+
5+
# C-PAC is free software: you can redistribute it and/or modify it under
6+
# the terms of the GNU Lesser General Public License as published by the
7+
# Free Software Foundation, either version 3 of the License, or (at your
8+
# option) any later version.
9+
10+
# C-PAC is distributed in the hope that it will be useful, but WITHOUT
11+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12+
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
13+
# License for more details.
14+
15+
# You should have received a copy of the GNU Lesser General Public
16+
# License along with C-PAC. If not, see <https://www.gnu.org/licenses/>.
17+
18+
# Global maintenance
19+
* @FCP-INDI/Maintenance
20+
21+
# DevOps
22+
/pyproject.toml @FCP-INDI/DevOps
23+
/requirements.txt @FCP-INDI/DevOps
24+
/setup.py @FCP-INDI/DevOps
25+
/dev @FCP-INDI/DevOps
26+
/scripts @FCP-INDI/DevOps
27+
/.* @FCP-INDI/DevOps
28+
/.circleci @FCP-INDI/DevOps
29+
/.github @FCP-INDI/DevOps
30+
**/*Dockerfile @FCP-INDI/DevOps

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
5757
- Removed broken support for native-space masking.
5858
- Introduced a new `template_space_func_masking` section in the pipeline config for template-space-only methods.
5959
- Moved `Anatomical_Resampled` masking method from `func_masking` to the `template_space_func_masking`.
60+
- Turned `On` boundary_based_registration for abcd-options preconfig.
61+
- Refactored `transform_timeseries_to_T1template_abcd` nodeblock removing unnecessary nodes, changing `desc-preproc_T1w` inputs as reference to `desc-head_T1w`.
62+
- Appended `T1w to Template` FOV match transform to the XFM.
6063

6164
### Upgraded
6265

CPAC/func_preproc/func_preproc.py

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1559,12 +1559,12 @@ def anat_brain_to_bold_res(wf_name, cfg, pipe_num):
15591559

15601560
inputNode = pe.Node(
15611561
util.IdentityInterface(
1562-
fields=["T1w-template-funcreg", "space-template_desc-preproc_T1w"]
1562+
fields=["T1w-template-funcreg", "space-template_desc-head_T1w"]
15631563
),
15641564
name="inputspec",
15651565
)
15661566
outputNode = pe.Node(
1567-
util.IdentityInterface(fields=["space-template_res-bold_desc-brain_T1w"]),
1567+
util.IdentityInterface(fields=["space-template_res-bold_desc-head_T1w"]),
15681568
name="outputspec",
15691569
)
15701570

@@ -1579,15 +1579,15 @@ def anat_brain_to_bold_res(wf_name, cfg, pipe_num):
15791579
]["registration"]["FSL-FNIRT"]["identity_matrix"]
15801580

15811581
wf.connect(
1582-
inputNode, "space-template_desc-preproc_T1w", anat_brain_to_func_res, "in_file"
1582+
inputNode, "space-template_desc-head_T1w", anat_brain_to_func_res, "in_file"
15831583
)
15841584
wf.connect(inputNode, "T1w-template-funcreg", anat_brain_to_func_res, "ref_file")
15851585

15861586
wf.connect(
15871587
anat_brain_to_func_res,
15881588
"out_file",
15891589
outputNode,
1590-
"space-template_res-bold_desc-brain_T1w",
1590+
"space-template_res-bold_desc-head_T1w",
15911591
)
15921592
return wf
15931593

@@ -1598,7 +1598,7 @@ def anat_brain_mask_to_bold_res(wf_name, cfg, pipe_num):
15981598
wf = pe.Workflow(name=f"{wf_name}_{pipe_num}")
15991599
inputNode = pe.Node(
16001600
util.IdentityInterface(
1601-
fields=["space-template_desc-brain_mask", "space-template_desc-preproc_T1w"]
1601+
fields=["space-template_desc-brain_mask", "space-template_desc-head_T1w"]
16021602
),
16031603
name="inputspec",
16041604
)
@@ -1625,7 +1625,7 @@ def anat_brain_mask_to_bold_res(wf_name, cfg, pipe_num):
16251625
)
16261626
wf.connect(
16271627
inputNode,
1628-
"space-template_desc-preproc_T1w",
1628+
"space-template_desc-head_T1w",
16291629
anat_brain_mask_to_func_res,
16301630
"ref_file",
16311631
)
@@ -1649,11 +1649,11 @@ def anat_brain_mask_to_bold_res(wf_name, cfg, pipe_num):
16491649
option_val="Anatomical_Resampled",
16501650
inputs=[
16511651
"T1w-template-funcreg",
1652-
"space-template_desc-preproc_T1w",
1652+
"space-template_desc-head_T1w",
16531653
"space-template_desc-brain_mask",
16541654
],
16551655
outputs=[
1656-
"space-template_res-bold_desc-brain_T1w",
1656+
"space-template_res-bold_desc-head_T1w",
16571657
"space-template_desc-bold_mask",
16581658
],
16591659
)
@@ -1666,9 +1666,9 @@ def bold_mask_anatomical_resampled(wf, cfg, strat_pool, pipe_num, opt=None):
16661666
wf_name="anat_brain_to_bold_res", cfg=cfg, pipe_num=pipe_num
16671667
)
16681668

1669-
node, out = strat_pool.get_data("space-template_desc-preproc_T1w")
1669+
node, out = strat_pool.get_data("space-template_desc-head_T1w")
16701670
wf.connect(
1671-
node, out, anat_brain_to_func_res, "inputspec.space-template_desc-preproc_T1w"
1671+
node, out, anat_brain_to_func_res, "inputspec.space-template_desc-head_T1w"
16721672
)
16731673

16741674
node, out = strat_pool.get_data("T1w-template-funcreg")
@@ -1690,15 +1690,15 @@ def bold_mask_anatomical_resampled(wf, cfg, strat_pool, pipe_num, opt=None):
16901690

16911691
wf.connect(
16921692
anat_brain_to_func_res,
1693-
"outputspec.space-template_res-bold_desc-brain_T1w",
1693+
"outputspec.space-template_res-bold_desc-head_T1w",
16941694
anat_brain_mask_to_func_res,
1695-
"inputspec.space-template_desc-preproc_T1w",
1695+
"inputspec.space-template_desc-head_T1w",
16961696
)
16971697

16981698
outputs = {
1699-
"space-template_res-bold_desc-brain_T1w": (
1699+
"space-template_res-bold_desc-head_T1w": (
17001700
anat_brain_to_func_res,
1701-
"outputspec.space-template_res-bold_desc-brain_T1w",
1701+
"outputspec.space-template_res-bold_desc-head_T1w",
17021702
),
17031703
"space-template_desc-bold_mask": (
17041704
anat_brain_mask_to_func_res,
@@ -1896,7 +1896,7 @@ def bold_masking(wf, cfg, strat_pool, pipe_num, opt=None):
18961896
["functional_preproc", "template_space_func_masking", "run"],
18971897
],
18981898
inputs=[
1899-
("space-template_desc-preproc_bold", "space-template_desc-bold_mask"),
1899+
("space-template_desc-head_bold", "space-template_desc-bold_mask"),
19001900
],
19011901
outputs={
19021902
"space-template_desc-preproc_bold": {
@@ -1907,10 +1907,6 @@ def bold_masking(wf, cfg, strat_pool, pipe_num, opt=None):
19071907
"Description": "The skull-stripped BOLD time-series.",
19081908
"SkullStripped": True,
19091909
},
1910-
"space-template_desc-head_bold": {
1911-
"Description": "The non skull-stripped BOLD time-series.",
1912-
"SkullStripped": False,
1913-
},
19141910
},
19151911
)
19161912
def template_space_bold_masking(
@@ -1929,9 +1925,7 @@ def template_space_bold_masking(
19291925
func_apply_mask.inputs.expr = "a*b"
19301926
func_apply_mask.inputs.outputtype = "NIFTI_GZ"
19311927

1932-
node_head_bold, out_head_bold = strat_pool.get_data(
1933-
"space-template_desc-preproc_bold"
1934-
)
1928+
node_head_bold, out_head_bold = strat_pool.get_data("space-template_desc-head_bold")
19351929
wf.connect(node_head_bold, out_head_bold, func_apply_mask, "in_file_a")
19361930

19371931
node, out = strat_pool.get_data("space-template_desc-bold_mask")
@@ -1940,7 +1934,6 @@ def template_space_bold_masking(
19401934
outputs: POOL_RESOURCE_DICT = {
19411935
"space-template_desc-preproc_bold": (func_apply_mask, "out_file"),
19421936
"space-template_desc-brain_bold": (func_apply_mask, "out_file"),
1943-
"space-template_desc-head_bold": (node_head_bold, out_head_bold),
19441937
}
19451938

19461939
return wf, outputs

CPAC/pipeline/cpac_pipeline.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,6 +1301,13 @@ def build_workflow(subject_id, sub_dict, cfg, pipeline_name=None):
13011301

13021302
pipeline_blocks += stack_motion_blocks(func_blocks, cfg, rpool)
13031303

1304+
# Template space functional mask
1305+
if cfg.functional_preproc["template_space_func_masking"]["run"]:
1306+
if not rpool.check_rpool("space-template_desc-bold_mask"):
1307+
pipeline_blocks += [
1308+
bold_mask_anatomical_resampled,
1309+
]
1310+
13041311
# BOLD to T1 coregistration
13051312
if cfg.registration_workflows["functional_registration"]["coregistration"][
13061313
"run"
@@ -1460,13 +1467,8 @@ def build_workflow(subject_id, sub_dict, cfg, pipeline_name=None):
14601467
warp_deriv_mask_to_EPItemplate,
14611468
]
14621469

1463-
# Template space functional masking
1470+
# Apply mask in template space
14641471
if cfg.functional_preproc["template_space_func_masking"]["run"]:
1465-
if not rpool.check_rpool("space-template_desc-bold_mask"):
1466-
pipeline_blocks += [
1467-
bold_mask_anatomical_resampled,
1468-
]
1469-
14701472
pipeline_blocks += [
14711473
template_space_bold_masking,
14721474
]

CPAC/pipeline/schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -845,10 +845,10 @@ def sanitize(filename):
845845
},
846846
"boundary_based_registration": {
847847
"run": forkable,
848+
"reference": In({"whole-head", "brain"}),
848849
"bbr_schedule": str,
849850
"bbr_wm_map": In({"probability_map", "partial_volume_map"}),
850851
"bbr_wm_mask_args": str,
851-
"reference": In({"whole-head", "brain"}),
852852
},
853853
},
854854
"EPI_registration": {

0 commit comments

Comments
 (0)