Processing defaults#
This page lists the default settings of the EIT, EMG and ventilator processing in one place. It also lists the settings where two places use different values for the same thing.
M3Resp gets most of its processing from eitprocessing (EIT) and resurfemg (EMG and part of the ventilator processing). Each package has its own defaults. M3Resp shows some of them as step settings. Others are fixed in the code of the package.
Checked versions#
The values come from the code on 2026-10-01. Both packages come from the m3resp-integration branch of the M3RESP copies, at the commits in uv.lock:
eitprocessing 1.8.7, commit
6d6da6a825a08201ad01c0a7b68f4de07d4501f3ReSurfEMG 1.1.1.dev47, commit
c63668689030e4581d5f985e7d09d3a8c01e7a77
Check the values again after an update of either package.
The “Set by” column#
Value |
Meaning |
|---|---|
m3resp |
A step setting. It shows in a workflow file and in the GUI. |
m3resp (undeclared) |
M3Resp gives it to the package, but the step does not list it as a setting. You can set it in a workflow file, but the GUI does not show it. |
m3resp (fixed) |
A value in the M3Resp code. You cannot change it. |
eitprocessing, ReSurfEMG |
A value in the code of the package. You cannot change it from a workflow file. |
1. Open points#
Each point is one kind of value with different values in two places. The last column is a proposal for the team.
# |
What |
Current values |
Proposal |
|---|---|---|---|
D1 |
Butterworth filter order |
EIT |
One default order for all band filters, and make the EMG order a setting. |
D2 |
Shortest breath accepted |
EIT |
One value in seconds for all three modalities, as a setting of each breath detection step. |
D3 |
Highest breathing rate allowed |
EIT rate search, adult: 60 /min (neonate 85 /min). Ventilator |
Take the limits from |
D4 |
Highest heart rate allowed |
EIT rate search, adult: 200 /min (neonate 210 /min). EMG |
Same heart-rate range for both devices, taken from |
D5 |
ECG gate width, when not set |
|
Fall back to 0.1 s instead of 205 samples. |
D6 |
How a gate is filled |
|
Choose one method. ReSurfEMG uses method 3 in its own workflow. |
D7 |
Slope window for breath onset/offset |
|
Choose one value. ReSurfEMG uses 0.2 s. |
D8 |
Same step, different default from Python |
|
Make the Python default and the step setting the same value. |
All EMG and ventilator baselines use a window of 7.5 s, a step of 0.2 s and the 33rd percentile, as in ReSurfEMG: emg.moving_baseline, emg.slopesum_baseline, the "emg" preset, M3Session.postprocess_emg without a baseline, and ventilator.pocc_intervals. The EIT breath detection uses a moving average of 15 s.
2. Values that M3Resp chose#
The packages give no default for these settings, so M3Resp chose the values. Each value needs a reason or a reference in the docs.
Step |
Setting |
Value |
|---|---|---|
|
|
|
|
shortest breath ( |
0.5 s |
|
|
0.5 s |
|
|
0.2 s / 0.15 / 2.0 s |
|
|
median airway pressure |
|
envelope window and method after ECG gating |
the ones recorded by |
3. All defaults, by modality#
EIT (eitprocessing)#
Step |
Setting |
Value |
Set by |
|---|---|---|---|
|
shortest breath |
0.67 s |
m3resp (same as eitprocessing) |
moving-average window |
15 s, Blackman shape |
eitprocessing |
|
smallest breath, as a fraction of the typical breath |
0.25 |
eitprocessing |
|
removal of bad data: window / percentile / factor |
0.5 s / 5th / ×4 |
eitprocessing |
|
|
|
adult |
m3resp |
Welch window |
30 s (shortest allowed 10 s) |
eitprocessing, can be set with |
|
Welch overlap |
0.5 |
eitprocessing |
|
breathing rate, adult / neonate |
6 to 60 /min / 15 to 85 /min |
eitprocessing |
|
heart rate, adult / neonate |
40 to 200 /min / 90 to 210 /min |
eitprocessing |
|
|
upper noise limit |
220 /min |
eitprocessing |
notch distance |
10 /min |
eitprocessing |
|
filter order |
10 |
eitprocessing |
|
|
see section 2 |
m3resp |
|
|
|
negative amplitude |
m3resp (same as eitprocessing) |
|
0.67 s |
m3resp (same as eitprocessing) |
|
|
|
continuous |
m3resp |
|
|
0.15 |
m3resp (same as eitprocessing) |
|
|
0.15 |
m3resp (same as eitprocessing) |
|
|
10 pixels / 1 (4 neighbours) |
m3resp (same as eitprocessing) |
EMG (ReSurfEMG)#
Step |
Setting |
Value |
Set by |
|---|---|---|---|
|
channel |
picked from the channel labels |
m3resp |
|
band-pass edges |
20 Hz to the lower of 500 Hz and 0.95 × half the sampling rate |
m3resp, same as ReSurfEMG |
band-pass order |
3 |
ReSurfEMG |
|
|
harmonic notch (EIT frame-rate comb) |
off in |
m3resp |
notch quality factor / upper limit / applied |
30 / half the sampling rate / after the band-pass |
m3resp |
|
|
envelope window / method |
0.25 s / RMS |
m3resp, same as ReSurfEMG |
|
shortest breath |
0.5 s |
m3resp (undeclared) |
prominence: factor × (75th + 50th percentile of the envelope above baseline) |
0.5 |
m3resp (undeclared), same as ReSurfEMG |
|
merge peaks closer than the shortest breath |
no |
m3resp (undeclared) |
|
|
window / step / percentile |
7.5 s / 0.2 s / 33 |
m3resp |
|
window / step / percentile / extra percentile |
7.5 s / 0.2 s / 33 / 25 |
m3resp |
smoothing window / percentile window |
0.5 s / 1.0 s |
m3resp |
|
|
|
0.4 |
m3resp (same as ReSurfEMG) |
band-pass before detection |
1 to 500 Hz |
ReSurfEMG |
|
shortest peak width / shortest gap between peaks |
1 ms / 0.33 s |
ReSurfEMG, can be set |
|
|
gate width / fill method |
205 samples / 1 |
m3resp (same as the ReSurfEMG function) |
|
levels / wavelet / threshold / hard thresholding |
4 / db2 / 4.5 / yes |
m3resp (same as ReSurfEMG) |
|
|
0.5 s |
m3resp |
|
|
5 s |
m3resp (same as ReSurfEMG) |
|
window / limit |
the breath’s own onset to offset / 40 % |
m3resp (limit same as ReSurfEMG) |
|
percentile / factor |
75 / ×4 |
m3resp (same as ReSurfEMG) |
|
upper percentile and factor / lower percentile and factor |
95, ×10 / 5, ×0.1 |
m3resp (same as ReSurfEMG) |
|
|
0.1 |
m3resp (same as ReSurfEMG) |
|
|
1.1 |
m3resp (same as ReSurfEMG) |
|
largest bell-curve error for a valid breath |
40 % |
m3resp (fixed), same as ReSurfEMG |
|
how far the EMG peak may come before the ventilator peak: least / most |
−0.5 s / 2.0 s |
m3resp (fixed) |
|
|
none (measure only) |
m3resp |
respiratory rate |
outlier percentile / factor |
33 / ×3 |
m3resp (fixed), same as ReSurfEMG |
Ventilator#
Step |
Setting |
Value |
Set by |
|---|---|---|---|
|
|
0.5 s (0.25 s from Python, see D8) |
m3resp |
height / prominence, first pass (× 90th percentile of volume) |
0.25 / 0.10 |
m3resp (fixed) |
|
height / prominence, second pass (× 90th percentile of volume) |
0.5 / 0.5 |
m3resp (fixed) |
|
|
|
0.5 s |
m3resp |
|
see section 2 |
m3resp |
|
|
prominence: factor × (PEEP − lowest pressure) |
0.8 |
m3resp (fixed), same as ReSurfEMG |
shortest occlusion / shortest gap between occlusions |
0.1 s / 0.5 s |
m3resp (fixed) |
|
|
window / step / percentile |
7.5 s / 0.2 s / 33 |
m3resp |
|
dP thresholds at 10 % / 90 % / 90 % scaled |
0.0 / 2.0 / 0.8 |
m3resp (same as ReSurfEMG) |
|
add area under baseline / its window |
yes / 5 s |
m3resp |
4. Other findings#
emg.preprocessandemg.detect_breathslist onlyvariantas a setting. You can set their filter limits, envelope window, channel and shortest breath in a workflow file, but the GUI does not show them.Some default values are numbers of samples, for example the gate width in D5. So their duration in seconds depends on the sampling rate.
Continue with Migration guide.