Skip to content

Commit

Permalink
🥅 Update schema to match motion_estimate_filter requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
shnizzedy committed Feb 5, 2021
1 parent fa4f851 commit c83bf0f
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions CPAC/pipeline/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@
'motion_correction_reference_volume': int,
},
'motion_estimate_filter': Required(
Any({
Any({ # no motion estimate filter
'run': Maybe(Any([False], False)),
'filter_type': Maybe(In({'notch', 'lowpass'})),
'filter_order': Maybe(int),
Expand All @@ -445,16 +445,16 @@
'center_frequency': Maybe(Number),
'filter_bandwidth': Maybe(Number),
'lowpass_cutoff': Maybe(Number),
}, {
}, { # notch filter with breathing_rate_* set
'run': forkable,
'filter_type': 'notch',
'filter_order': int,
'breathing_rate_min': Number,
'breathing_rate_max': Number,
'center_frequency': None,
'filter_bandwidth': None,
'center_frequency': Maybe(Number),
'filter_bandwidth': Maybe(Number),
'lowpass_cutoff': Maybe(Number),
}, {
}, { # notch filter with manual parameters set
'run': forkable,
'filter_type': 'notch',
'filter_order': int,
Expand All @@ -463,27 +463,26 @@
'center_frequency': Number,
'filter_bandwidth': Number,
'lowpass_cutoff': Maybe(Number),
}, {
}, { # lowpass filter with breathing_rate_min
'run': forkable,
'filter_type': 'lowpass',
'filter_order': int,
'breathing_rate_min': Number,
'breathing_rate_max': Maybe(Number),
'center_frequency': Maybe(Number),
'filter_bandwidth': Maybe(Number),
'lowpass_cutoff': None,
}, {
'lowpass_cutoff': Maybe(Number),
}, { # lowpass filter with lowpass_cutoff
'run': forkable,
'filter_type': 'lowpass',
'filter_order': int,
'breathing_rate_min': None,
'breathing_rate_max': Maybe(Number),
'center_frequency': Maybe(Number),
'filter_bandwidth': Maybe(Number),
'lowpass_cutoff': Maybe(Number),
'lowpass_cutoff': Number,
},),
msg='Some mutually exclusive filter options are ambiguous in '
'this pipeline configuration'
msg='motion_estimate_filter configuration is invalid.'
),
},
'distortion_correction': {
Expand Down

0 comments on commit c83bf0f

Please sign in to comment.