Skip to content

Commit

Permalink
Tag memory estimates in resamplers
Browse files Browse the repository at this point in the history
  • Loading branch information
tsalo committed Nov 30, 2023
1 parent 4ee9227 commit fa0317d
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions aslprep/workflows/asl/fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -699,9 +699,13 @@ def init_asl_native_wf(
For multi-echo data, motion correction has already been applied, so
this will be undefined.
"""
from aslprep.utils.misc import estimate_asl_mem_usage

layout = config.execution.layout
metadata = layout.get_metadata(asl_file)

_, mem_gb = estimate_asl_mem_usage(asl_file)

workflow = pe.Workflow(name=name)

inputnode = pe.Node(
Expand Down Expand Up @@ -805,7 +809,12 @@ def init_asl_native_wf(
]) # fmt:skip

# Resample ASL to aslref
aslref_asl = pe.Node(ResampleSeries(), name="aslref_asl", n_procs=omp_nthreads)
aslref_asl = pe.Node(
ResampleSeries(),
name="aslref_asl",
n_procs=omp_nthreads,
mem_gb=mem_gb["resampled"],
)

workflow.connect([
(inputnode, aslref_asl, [
Expand All @@ -820,7 +829,7 @@ def init_asl_native_wf(
]) # fmt:skip

if fieldmap_id:
aslref_fmap = pe.Node(ReconstructFieldmap(inverse=[True]), name="aslref_fmap")
aslref_fmap = pe.Node(ReconstructFieldmap(inverse=[True]), name="aslref_fmap", mem_gb=1)
workflow.connect([
(inputnode, aslref_fmap, [
("aslref", "target_ref_file"),
Expand Down

0 comments on commit fa0317d

Please sign in to comment.