Skip to content

Commit 87c0ad7

Browse files
committed
👔 Persist longitudinal resource pool
1 parent 8288bf8 commit 87c0ad7

File tree

55 files changed

+3784
-62
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+3784
-62
lines changed

CHANGELOG.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ All notable changes to this project will be documented in this file.
1414
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1515
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
1616

17-
## [1.8.7.post1.dev1] - unreleased
17+
## [1.8.7.post1] - unreleased
1818

1919
### Changed
2020

2121
- Disabled variant image builds.
2222

2323
### Fixed
2424

25-
- Supplied missing `subject_id` for longitudinal workflow logger and make that field optional for the logger.
25+
- Graph-building bugs that prevented longitudinal workflows from running.
2626

2727
## [1.8.7] - 2024-05-03
2828

@@ -304,7 +304,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
304304

305305
See [Version 1.8.1 Beta](https://fcp-indi.github.io/docs/user/release_notes/v1.8.1) for release notes for v1.8.1 and [Release Notes](https://fcp-indi.github.io/docs/user/release_notes) for all release notes back to v0.1.1.
306306

307-
[1.8.7.post1.dev1]: https://github.com/FCP-INDI/C-PAC/compare/v1.8.7...v1.8.7.post1.dev1
307+
[1.8.7.post1]: https://github.com/FCP-INDI/C-PAC/compare/v1.8.7...v1.8.7.post1.dev3
308308
[1.8.7]: https://github.com/FCP-INDI/C-PAC/releases/tag/v1.8.7
309309
[1.8.6]: https://github.com/FCP-INDI/C-PAC/releases/tag/v1.8.6
310310
[1.8.5]: https://github.com/FCP-INDI/C-PAC/releases/tag/v1.8.5

CPAC/info.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
_version_major = 1
4444
_version_minor = 8
4545
_version_micro = 7
46-
_version_extra = 'post1.dev2'
46+
_version_extra = 'post1.dev3'
4747

4848

4949
def get_cpac_gitversion():

CPAC/longitudinal_pipeline/longitudinal_workflow.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# Copyright (C) 2020-2022 C-PAC Developers
2+
# Copyright (C) 2020-2024 C-PAC Developers
33

44
# This file is part of C-PAC.
55

@@ -15,10 +15,12 @@
1515

1616
# You should have received a copy of the GNU Lesser General Public
1717
# License along with C-PAC. If not, see <https://www.gnu.org/licenses/>.
18-
import os
1918
import copy
20-
import time
19+
import os
2120
import shutil
21+
import time
22+
from typing import Optional
23+
2224
from CPAC.pipeline.nodeblock import nodeblock
2325

2426
from nipype import config
@@ -41,7 +43,7 @@
4143
from CPAC.pipeline.cpac_pipeline import initialize_nipype_wf, \
4244
connect_pipeline, build_anat_preproc_stack, build_T1w_registration_stack,\
4345
build_segmentation_stack
44-
from CPAC.pipeline.engine import initiate_rpool, ingress_output_dir
46+
from CPAC.pipeline.engine import initiate_rpool, ingress_output_dir, ResourcePool
4547

4648
from CPAC.registration import (
4749
create_fsl_flirt_linear_reg,
@@ -492,6 +494,8 @@ def anat_longitudinal_wf(subject_id, sub_list, config):
492494
strats_head_dct[tag].append(os.path.join(cpac_dir,
493495
head_file))
494496

497+
longitudinal_rpool: Optional[ResourcePool] = None
498+
495499
for strat in strats_brain_dct.keys():
496500

497501
wf = initialize_nipype_wf(config, sub_list[0],
@@ -567,6 +571,8 @@ def anat_longitudinal_wf(subject_id, sub_list, config):
567571
# once for every strategy!
568572
wf.run()
569573

574+
longitudinal_rpool = rpool.copy_rpool()
575+
570576
# now, just write out a copy of the above to each session
571577
config.pipeline_setup['pipeline_name'] = orig_pipe_name
572578
for session in sub_list:
@@ -591,7 +597,7 @@ def anat_longitudinal_wf(subject_id, sub_list, config):
591597

592598
wf = initialize_nipype_wf(config, sub_list[0])
593599

594-
wf, rpool = initiate_rpool(wf, config, session)
600+
wf, rpool = initiate_rpool(wf, config, session, rpool=longitudinal_rpool)
595601

596602
config.pipeline_setup[
597603
'pipeline_name'] = f'longitudinal_{orig_pipe_name}'
@@ -627,6 +633,7 @@ def anat_longitudinal_wf(subject_id, sub_list, config):
627633

628634
rpool.gather_pipes(wf, config, add_excl=excl)
629635
wf.run()
636+
longitudinal_rpool = rpool.copy_rpool()
630637

631638
# begin single-session stuff again
632639
for session in sub_list:
@@ -651,7 +658,7 @@ def anat_longitudinal_wf(subject_id, sub_list, config):
651658

652659
wf = initialize_nipype_wf(config, sub_list[0])
653660

654-
wf, rpool = initiate_rpool(wf, config, session)
661+
wf, rpool = initiate_rpool(wf, config, session, rpool=longitudinal_rpool)
655662

656663
pipeline_blocks = [warp_longitudinal_T1w_to_template,
657664
warp_longitudinal_seg_to_T1w]

0 commit comments

Comments
 (0)