Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Set subject_id attribute on Configuration object in anatomical longitudinal workflow #2158

Draft
wants to merge 8 commits into
base: develop
Choose a base branch
from
Draft
2 changes: 1 addition & 1 deletion .github/Dockerfiles/C-PAC.develop-jammy.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

# You should have received a copy of the GNU Lesser General Public
# License along with C-PAC. If not, see <https://www.gnu.org/licenses/>.
FROM ghcr.io/fcp-indi/c-pac/stage-base:standard-v1.8.8.dev1
FROM ghcr.io/fcp-indi/c-pac/stage-base:standard-v1.8.8.dev2
LABEL org.opencontainers.image.description "Full C-PAC image"
LABEL org.opencontainers.image.source https://github.com/FCP-INDI/C-PAC
USER root
Expand Down
2 changes: 1 addition & 1 deletion .github/Dockerfiles/C-PAC.develop-lite-jammy.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

# You should have received a copy of the GNU Lesser General Public
# License along with C-PAC. If not, see <https://www.gnu.org/licenses/>.
FROM ghcr.io/fcp-indi/c-pac/stage-base:lite-v1.8.8.dev1
FROM ghcr.io/fcp-indi/c-pac/stage-base:lite-v1.8.8.dev2
LABEL org.opencontainers.image.description "Full C-PAC image without FreeSurfer"
LABEL org.opencontainers.image.source https://github.com/FCP-INDI/C-PAC
USER root
Expand Down
2 changes: 1 addition & 1 deletion .github/Dockerfiles/base-standard.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# License along with C-PAC. If not, see <https://www.gnu.org/licenses/>.
FROM ghcr.io/fcp-indi/c-pac/freesurfer:6.0.0-min.neurodocker-jammy as FreeSurfer

FROM ghcr.io/fcp-indi/c-pac/stage-base:lite-v1.8.8.dev1
FROM ghcr.io/fcp-indi/c-pac/stage-base:lite-v1.8.8.dev2
LABEL org.opencontainers.image.description "NOT INTENDED FOR USE OTHER THAN AS A STAGE IMAGE IN A MULTI-STAGE BUILD \
Standard software dependencies for C-PAC standard images"
LABEL org.opencontainers.image.source https://github.com/FCP-INDI/C-PAC
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,6 @@ jobs:
uses: ./.github/workflows/build_C-PAC.yml
with:
variant: lite

smoke-tests-participant:
name: Run participant-level smoke tests
needs:
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Moved `pygraphviz` from requirements to `graphviz` optional dependencies group.
- Automatically tag untagged `subject_id` and `unique_id` as `!!str` when loading data config files.
- Made orientation configurable (was hard-coded as "RPI").
- Disabled variant image builds.

### Fixed

- A bug in which AWS S3 encryption was looked for in Nipype config instead of pipeline config (only affected uploading logs).
- Restored `bids-validator` functionality.
- Fixed empty `shell` variable in cluster run scripts.
- A bug in which bandpass filters always assumed 1D regressor files have exactly 5 header rows.
- Supplied missing `subject_id` for longitudinal workflow logger and make that field optional for the logger.

### Removed

Expand Down
2 changes: 1 addition & 1 deletion CPAC/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
_version_major = 1
_version_minor = 8
_version_micro = 8
_version_extra = "dev1"
_version_extra = "dev2"


def get_cpac_gitversion():
Expand Down
22 changes: 12 additions & 10 deletions CPAC/longitudinal_pipeline/longitudinal_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
create_wf_calculate_ants_warp,
)
from CPAC.registration.registration import apply_transform
from CPAC.utils.configuration.configuration import Configuration
from CPAC.utils.datasource import (
resolve_resolution,
)
Expand Down Expand Up @@ -380,24 +381,25 @@ def warp_longitudinal_seg_to_T1w(wf, cfg, strat_pool, pipe_num, opt=None):
return (wf, outputs)


def anat_longitudinal_wf(subject_id, sub_list, config):
def anat_longitudinal_wf(
subject_id: str, sub_list: list[dict], config: Configuration
) -> None:
"""
Create and run anatomical longitudinal workflow(s).

Parameters
----------
subject_id : str
subject_id
the id of the subject
sub_list : list of dict
sub_list
this is a list of sessions for one subject and each session if the same dictionary as the one given to
prep_workflow
config : configuration
config
a configuration object containing the information of the pipeline config. (Same as for prep_workflow)

Returns
-------
None
"""
# list of lists for every strategy
session_id_list = []
config["subject_id"] = subject_id
session_id_list: list[list] = []
"""List of lists for every strategy"""
session_wfs = {}

cpac_dirs = []
Expand Down
4 changes: 3 additions & 1 deletion CPAC/pipeline/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -1073,7 +1073,9 @@ def post_process(self, wf, label, connection, json_info, pipe_idx, pipe_x, outs)
def gather_pipes(self, wf, cfg, all=False, add_incl=None, add_excl=None):
excl = []
substring_excl = []
outputs_logger = getLogger(f'{cfg["subject_id"]}_expectedOutputs')
outputs_logger = getLogger(
f'{cfg.get("subject_id", getattr(wf, "name", ""))}_expectedOutputs'
)
expected_outputs = ExpectedOutputs()

if add_excl:
Expand Down
2 changes: 1 addition & 1 deletion CPAC/resources/configs/data_config_S3-BIDS-ABIDE.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# CPAC Data Configuration File
# Version 1.8.8.dev1
# Version 1.8.8.dev2
#
# http://fcp-indi.github.io for more info.
#
Expand Down
2 changes: 1 addition & 1 deletion CPAC/resources/configs/data_config_S3-BIDS-ADHD200.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# CPAC Data Configuration File
# Version 1.8.8.dev1
# Version 1.8.8.dev2
#
# http://fcp-indi.github.io for more info.
#
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# CPAC Data Configuration File
# Version 1.8.8.dev1
# Version 1.8.8.dev2
#
# http://fcp-indi.github.io for more info.
#
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# CPAC Data Configuration File
# Version 1.8.8.dev1
# Version 1.8.8.dev2
#
# http://fcp-indi.github.io for more info.
#
Expand Down
2 changes: 1 addition & 1 deletion CPAC/resources/configs/data_config_cpac_benchmark.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# CPAC Data Configuration File
# Version 1.8.8.dev1
# Version 1.8.8.dev2
#
# http://fcp-indi.github.io for more info.
#
Expand Down
2 changes: 1 addition & 1 deletion CPAC/resources/configs/data_settings_template.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# CPAC Data Settings File
# Version 1.8.8.dev1
# Version 1.8.8.dev2
#
# http://fcp-indi.github.io for more info.
#
Expand Down
2 changes: 1 addition & 1 deletion CPAC/resources/configs/group_config_template.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# CPAC Group-Level Analysis Configuration YAML file
# Version 1.8.8.dev1
# Version 1.8.8.dev2
#
# http://fcp-indi.github.io for more info.
#
Expand Down
2 changes: 1 addition & 1 deletion CPAC/resources/configs/pipeline_config_abcd-options.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%YAML 1.1
---
# CPAC Pipeline Configuration YAML file
# Version 1.8.8.dev1
# Version 1.8.8.dev2
#
# http://fcp-indi.github.io for more info.
#
Expand Down
2 changes: 1 addition & 1 deletion CPAC/resources/configs/pipeline_config_abcd-prep.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%YAML 1.1
---
# CPAC Pipeline Configuration YAML file
# Version 1.8.8.dev1
# Version 1.8.8.dev2
#
# http://fcp-indi.github.io for more info.
#
Expand Down
2 changes: 1 addition & 1 deletion CPAC/resources/configs/pipeline_config_anat-only.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%YAML 1.1
---
# CPAC Pipeline Configuration YAML file
# Version 1.8.8.dev1
# Version 1.8.8.dev2
#
# http://fcp-indi.github.io for more info.
#
Expand Down
2 changes: 1 addition & 1 deletion CPAC/resources/configs/pipeline_config_benchmark-ANTS.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%YAML 1.1
---
# CPAC Pipeline Configuration YAML file
# Version 1.8.8.dev1
# Version 1.8.8.dev2
#
# http://fcp-indi.github.io for more info.
#
Expand Down
2 changes: 1 addition & 1 deletion CPAC/resources/configs/pipeline_config_benchmark-FNIRT.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%YAML 1.1
---
# CPAC Pipeline Configuration YAML file
# Version 1.8.8.dev1
# Version 1.8.8.dev2
#
# http://fcp-indi.github.io for more info.
#
Expand Down
2 changes: 1 addition & 1 deletion CPAC/resources/configs/pipeline_config_blank.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%YAML 1.1
---
# CPAC Pipeline Configuration YAML file
# Version 1.8.8.dev1
# Version 1.8.8.dev2
#
# http://fcp-indi.github.io for more info.
#
Expand Down
2 changes: 1 addition & 1 deletion CPAC/resources/configs/pipeline_config_ccs-options.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%YAML 1.1
---
# CPAC Pipeline Configuration YAML file
# Version 1.8.8.dev1
# Version 1.8.8.dev2
#
# http://fcp-indi.github.io for more info.
#
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%YAML 1.1
---
# CPAC Pipeline Configuration YAML file
# Version 1.8.8.dev1
# Version 1.8.8.dev2
#
# http://fcp-indi.github.io for more info.
#
Expand Down
2 changes: 1 addition & 1 deletion CPAC/resources/configs/pipeline_config_default.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%YAML 1.1
---
# CPAC Pipeline Configuration YAML file
# Version 1.8.8.dev1
# Version 1.8.8.dev2
#
# http://fcp-indi.github.io for more info.
#
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%YAML 1.1
---
# CPAC Pipeline Configuration YAML file
# Version 1.8.8.dev1
# Version 1.8.8.dev2
#
# http://fcp-indi.github.io for more info.
#
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%YAML 1.1
---
# CPAC Pipeline Configuration YAML file
# Version 1.8.8.dev1
# Version 1.8.8.dev2
#
# http://fcp-indi.github.io for more info.
#
Expand Down
2 changes: 1 addition & 1 deletion CPAC/resources/configs/pipeline_config_fx-options.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%YAML 1.1
---
# CPAC Pipeline Configuration YAML file
# Version 1.8.8.dev1
# Version 1.8.8.dev2
#
# http://fcp-indi.github.io for more info.
#
Expand Down
2 changes: 1 addition & 1 deletion CPAC/resources/configs/pipeline_config_monkey-ABCD.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%YAML 1.1
---
# CPAC Pipeline Configuration YAML file
# Version 1.8.8.dev1
# Version 1.8.8.dev2
#
# http://fcp-indi.github.io for more info.
#
Expand Down
2 changes: 1 addition & 1 deletion CPAC/resources/configs/pipeline_config_monkey.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%YAML 1.1
---
# CPAC Pipeline Configuration YAML file
# Version 1.8.8.dev1
# Version 1.8.8.dev2
#
# http://fcp-indi.github.io for more info.
#
Expand Down
2 changes: 1 addition & 1 deletion CPAC/resources/configs/pipeline_config_ndmg.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%YAML 1.1
---
# CPAC Pipeline Configuration YAML file
# Version 1.8.8.dev1
# Version 1.8.8.dev2
#
# http://fcp-indi.github.io for more info.
#
Expand Down
2 changes: 1 addition & 1 deletion CPAC/resources/configs/pipeline_config_nhp-macaque.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%YAML 1.1
---
# CPAC Pipeline Configuration YAML file
# Version 1.8.8.dev1
# Version 1.8.8.dev2
#
# http://fcp-indi.github.io for more info.
#
Expand Down
2 changes: 1 addition & 1 deletion CPAC/resources/configs/pipeline_config_preproc.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%YAML 1.1
---
# CPAC Pipeline Configuration YAML file
# Version 1.8.8.dev1
# Version 1.8.8.dev2
#
# http://fcp-indi.github.io for more info.
#
Expand Down
2 changes: 1 addition & 1 deletion CPAC/resources/configs/pipeline_config_rbc-options.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%YAML 1.1
---
# CPAC Pipeline Configuration YAML file
# Version 1.8.8.dev1
# Version 1.8.8.dev2
#
# http://fcp-indi.github.io for more info.
#
Expand Down
2 changes: 1 addition & 1 deletion CPAC/resources/configs/pipeline_config_regtest-1.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%YAML 1.1
---
# CPAC Pipeline Configuration YAML file
# Version 1.8.8.dev1
# Version 1.8.8.dev2
#
# http://fcp-indi.github.io for more info.
#
Expand Down
2 changes: 1 addition & 1 deletion CPAC/resources/configs/pipeline_config_regtest-2.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%YAML 1.1
---
# CPAC Pipeline Configuration YAML file
# Version 1.8.8.dev1
# Version 1.8.8.dev2
#
# http://fcp-indi.github.io for more info.
#
Expand Down
2 changes: 1 addition & 1 deletion CPAC/resources/configs/pipeline_config_regtest-3.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%YAML 1.1
---
# CPAC Pipeline Configuration YAML file
# Version 1.8.8.dev1
# Version 1.8.8.dev2
#
# http://fcp-indi.github.io for more info.
#
Expand Down
2 changes: 1 addition & 1 deletion CPAC/resources/configs/pipeline_config_regtest-4.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%YAML 1.1
---
# CPAC Pipeline Configuration YAML file
# Version 1.8.8.dev1
# Version 1.8.8.dev2
#
# http://fcp-indi.github.io for more info.
#
Expand Down
2 changes: 1 addition & 1 deletion CPAC/resources/configs/pipeline_config_rodent.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%YAML 1.1
---
# CPAC Pipeline Configuration YAML file
# Version 1.8.8.dev1
# Version 1.8.8.dev2
#
# http://fcp-indi.github.io for more info.
#
Expand Down
2 changes: 1 addition & 1 deletion CPAC/resources/configs/system_config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# C-PAC System Configuration YAML file
# Version 1.8.8.dev1
# Version 1.8.8.dev2
#
# http://fcp-indi.github.io for more info.
#
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# CPAC Data Configuration File
# Version 1.8.8.dev1
# Version 1.8.8.dev2
#
# http://fcp-indi.github.io for more info.
#
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# CPAC Data Configuration File
# Version 1.8.8.dev1
# Version 1.8.8.dev2
#
# http://fcp-indi.github.io for more info.
#
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# CPAC Data Configuration File
# Version 1.8.8.dev1
# Version 1.8.8.dev2
#
# http://fcp-indi.github.io for more info.
#
Expand Down
Loading
Loading