Skip to content

Commit

Permalink
FIX: Tag BOLD->volume resampling memory usage
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Nov 21, 2023
1 parent 85991f4 commit 866fef6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
22 changes: 16 additions & 6 deletions fmriprep/workflows/bold/apply.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
def init_bold_volumetric_resample_wf(
*,
metadata: dict,
mem_gb: dict[str, float],
fieldmap_id: str | None = None,
omp_nthreads: int = 1,
name: str = 'bold_volumetric_resample_wf',
Expand Down Expand Up @@ -119,9 +120,14 @@ def init_bold_volumetric_resample_wf(

gen_ref = pe.Node(GenerateSamplingReference(), name='gen_ref', mem_gb=0.3)

boldref2target = pe.Node(niu.Merge(2), name='boldref2target')
bold2target = pe.Node(niu.Merge(2), name='bold2target')
resample = pe.Node(ResampleSeries(), name="resample", n_procs=omp_nthreads)
boldref2target = pe.Node(niu.Merge(2), name='boldref2target', run_without_submitting=True)
bold2target = pe.Node(niu.Merge(2), name='bold2target', run_without_submitting=True)
resample = pe.Node(
ResampleSeries(),
name="resample",
n_procs=omp_nthreads,
mem_gb=mem_gb['resampled'],
)

workflow.connect([
(inputnode, gen_ref, [
Expand Down Expand Up @@ -156,10 +162,14 @@ def init_bold_volumetric_resample_wf(
name="distortion_params",
run_without_submitting=True,
)
fmap2target = pe.Node(niu.Merge(2), name='fmap2target')
inverses = pe.Node(niu.Function(function=_gen_inverses), name='inverses')
fmap2target = pe.Node(niu.Merge(2), name='fmap2target', run_without_submitting=True)
inverses = pe.Node(
niu.Function(function=_gen_inverses),
name='inverses',
run_without_submitting=True,
)

fmap_recon = pe.Node(ReconstructFieldmap(), name="fmap_recon")
fmap_recon = pe.Node(ReconstructFieldmap(), name="fmap_recon", mem_gb=1)

workflow.connect([
(inputnode, fmap_select, [
Expand Down
2 changes: 1 addition & 1 deletion fmriprep/workflows/bold/stc.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def init_bold_stc_wf(
slice_encoding_direction=metadata.get('SliceEncodingDirection', 'k'),
tzero=tzero,
),
mem_gb=mem_gb.get('filesize', 1) * 2,
mem_gb=mem_gb['filesize'] * 2,
name='slice_timing_correction',
)

Expand Down

0 comments on commit 866fef6

Please sign in to comment.