Skip to content

Commit caaa0aa

Browse files
authored
Merge pull request #9 from mnoergaard/main
Refactor fMRIPrep to PETPrep
2 parents 62cc4d1 + 5588db4 commit caaa0aa

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

petprep/cli/workflow.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ def build_workflow(config_file, retval):
3838
from niworkflows.utils.bids import collect_participants
3939
from niworkflows.utils.misc import check_valid_fs_license
4040

41-
from fmriprep.reports.core import generate_reports
42-
from fmriprep.utils.bids import check_pipeline_version
41+
from petprep.reports.core import generate_reports
42+
from petprep.utils.bids import check_pipeline_version
4343

4444
from .. import config, data
4545
from ..utils.misc import check_deps
@@ -54,18 +54,18 @@ def build_workflow(config_file, retval):
5454
retval['return_code'] = 1
5555
retval['workflow'] = None
5656

57-
banner = [f'Running fMRIPrep version {version}']
57+
banner = [f'Running PETPrep version {version}']
5858
notice_path = data.load.readable('NOTICE')
5959
if notice_path.exists():
6060
banner[0] += '\n'
6161
banner += [f'License NOTICE {"#" * 50}']
62-
banner += [f'fMRIPrep {version}']
62+
banner += [f'PETPrep {version}']
6363
banner += notice_path.read_text().splitlines(keepends=False)[1:]
6464
banner += ['#' * len(banner[1])]
6565
build_log.log(25, f'\n{" " * 9}'.join(banner))
6666

6767
# warn if older results exist: check for dataset_description.json in output folder
68-
msg = check_pipeline_version('fMRIPrep', version, petprep_dir / 'dataset_description.json')
68+
msg = check_pipeline_version('PETPrep', version, petprep_dir / 'dataset_description.json')
6969
if msg is not None:
7070
build_log.warning(msg)
7171

@@ -108,7 +108,7 @@ def build_workflow(config_file, retval):
108108

109109
# Build main workflow
110110
init_msg = [
111-
"Building fMRIPrep's workflow:",
111+
"Building PETPrep's workflow:",
112112
f'BIDS dataset path: {config.execution.bids_dir}.',
113113
f'Participant list: {subject_list}.',
114114
f'Run identifier: {config.execution.run_uuid}.',
@@ -133,13 +133,13 @@ def build_workflow(config_file, retval):
133133
build_log.critical(
134134
"""\
135135
ERROR: Federal Information Processing Standard (FIPS) mode is enabled on your system. \
136-
FreeSurfer (and thus fMRIPrep) cannot be used in FIPS mode. \
136+
FreeSurfer (and thus PETPrep) cannot be used in FIPS mode. \
137137
Contact your system administrator for assistance."""
138138
)
139139
else:
140140
build_log.critical(
141141
"""\
142-
ERROR: a valid license file is required for FreeSurfer to run. fMRIPrep looked for an existing \
142+
ERROR: a valid license file is required for FreeSurfer to run. PETPrep looked for an existing \
143143
license file at several paths, in this order: 1) command line argument ``--fs-license-file``; \
144144
2) ``$FS_LICENSE`` environment variable; and 3) the ``$FREESURFER_HOME/license.txt`` path. Get it \
145145
(for free) by registering at https://surfer.nmr.mgh.harvard.edu/registration.html"""

petprep/workflows/base.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# https://www.nipreps.org/community/licensing/
2222
#
2323
"""
24-
fMRIPrep base processing workflows
24+
PETPrep base processing workflows
2525
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2626
2727
.. autofunction:: init_fmriprep_wf
@@ -166,12 +166,12 @@ def init_single_subject_wf(subject_id: str):
166166
init_resample_surfaces_wf,
167167
)
168168

169-
from fmriprep.workflows.pet.base import init_pet_wf
169+
from petprep.workflows.pet.base import init_pet_wf
170170

171171
workflow = Workflow(name=f'sub_{subject_id}_wf')
172172
workflow.__desc__ = f"""
173173
Results included in this manuscript come from preprocessing
174-
performed using *fMRIPrep* {config.environment.version}
174+
performed using *PETPrep* {config.environment.version}
175175
(@fmriprep1; @fmriprep2; RRID:SCR_016216),
176176
which is based on *Nipype* {config.environment.nipype_version}
177177
(@nipype1; @nipype2; RRID:SCR_002502).
@@ -544,7 +544,7 @@ def init_single_subject_wf(subject_id: str):
544544
for pet_series in pet_runs:
545545
pet_cache = {}
546546
if config.execution.derivatives:
547-
from fmriprep.utils.bids import collect_derivatives, extract_entities
547+
from petprep.utils.bids import collect_derivatives, extract_entities
548548

549549
entities = extract_entities(pet_series)
550550

petprep/workflows/pet/fit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def init_pet_fit_wf(
122122
"""
123123
from niworkflows.engine.workflows import LiterateWorkflow as Workflow
124124

125-
from fmriprep.utils.misc import estimate_pet_mem_usage
125+
from petprep.utils.misc import estimate_pet_mem_usage
126126

127127
if precomputed is None:
128128
precomputed = {}

petprep/workflows/pet/outputs.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@
3030
from niworkflows.interfaces.fixes import FixHeaderApplyTransforms as ApplyTransforms
3131
from niworkflows.utils.images import dseg_label
3232

33-
from fmriprep import config
34-
from fmriprep.config import DEFAULT_MEMORY_MIN_GB
35-
from fmriprep.interfaces import DerivativesDataSink
36-
from fmriprep.interfaces.bids import BIDSURI
33+
from petprep import config
34+
from petprep.config import DEFAULT_MEMORY_MIN_GB
35+
from petprep.interfaces import DerivativesDataSink
36+
from petprep.interfaces.bids import BIDSURI
3737

3838

3939
def prepare_timing_parameters(metadata: dict):

0 commit comments

Comments
 (0)