Skip to content

Commit 73a4104

Browse files
committed
feat: Add workflow arguments for metadata estimates and fallback TRT
1 parent 3828bf0 commit 73a4104

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

sdcflows/workflows/apply/correction.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
def init_unwarp_wf(
3030
*,
3131
jacobian=True,
32+
use_metadata_estimates=False,
33+
fallback_total_readout_time=None,
3234
free_mem=None,
3335
omp_nthreads=1,
3436
debug=False,
@@ -117,7 +119,14 @@ def init_unwarp_wf(
117119
name="outputnode",
118120
)
119121

120-
rotime = pe.Node(GetReadoutTime(), name="rotime")
122+
rotime = pe.Node(
123+
GetReadoutTime(
124+
use_estimate=use_metadata_estimates,
125+
fallback=fallback_total_readout_time,
126+
),
127+
name="rotime",
128+
run_without_submitting=True,
129+
)
121130
rotime.interface._always_run = debug
122131

123132
# resample is memory-hungry; choose a smaller number of threads

sdcflows/workflows/fit/pepolar.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636

3737
def init_topup_wf(
3838
grid_reference=0,
39+
use_metadata_estimates=False,
40+
fallback_total_readout_time=None,
3941
omp_nthreads=1,
4042
sloppy=False,
4143
debug=False,
@@ -122,7 +124,10 @@ def init_topup_wf(
122124

123125
# Calculate the total readout time of each run
124126
readout_time = pe.MapNode(
125-
GetReadoutTime(),
127+
GetReadoutTime(
128+
use_estimate=use_metadata_estimates,
129+
fallback=fallback_total_readout_time,
130+
),
126131
name="readout_time",
127132
iterfield=["metadata", "in_file"],
128133
run_without_submitting=True,

sdcflows/workflows/fit/syn.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
def init_syn_sdc_wf(
4343
*,
4444
atlas_threshold=3,
45+
use_metadata_estimates=False,
46+
fallback_total_readout_time=None,
4547
sloppy=False,
4648
debug=False,
4749
name="syn_sdc_wf",
@@ -160,7 +162,10 @@ def init_syn_sdc_wf(
160162
outputnode.inputs.method = 'FLB ("fieldmap-less", SyN-based)'
161163

162164
readout_time = pe.Node(
163-
GetReadoutTime(),
165+
GetReadoutTime(
166+
use_estimate=use_metadata_estimates,
167+
fallback=fallback_total_readout_time,
168+
),
164169
name="readout_time",
165170
run_without_submitting=True,
166171
)

0 commit comments

Comments
 (0)