@@ -149,6 +149,37 @@ can also be obtained from the pipeline object directly:
149149 dict_used_to_make_pipeline = preprocessing_pipeline.preprocessor_dict
150150
151151
152+ Some preprocessing steps, such as :code: `detect_and_remove_artifacts `, allow you to specify an input recording
153+ and optionally another recording to perform some computation (e.g., detect artifacts on the output of a previous
154+ preprocessor, but remove them on the the parent preprocessor). In this case, the string "pipeline[preprocessor_name]"
155+ can be used in the dictionary to specify that the recording argument for this step should be the output of a previous
156+ preprocessor in the same pipeline. For example, if we want to use the output of the "bandpass_filter" step as the
157+ recording to detect artifacts, we can specify it as follows:
158+
159+ .. code-block :: python
160+
161+ preprocessing_dict = {
162+ ' bandpass_filter' : {' freq_min' : 250 },
163+ ' common_reference' : {' operator' : ' median' , ' reference' : ' global' },
164+ ' detect_and_remove_artifacts' : {' recording_to_detect' : ' pipeline[bandpass_filter]' },
165+ }
166+
167+ This will detect artifacts on the output of the "bandpass_filter" step, but the artifacts will be removed on the output
168+ of the "common_reference" step (since the parent recording for "detect_and_remove_artifacts" is by default the output of
169+ the previous step in the pipeline, which is "common_reference" in this case).
170+ To specify the "raw" recording, i.e., the input to the pipeline, we can use "pipeline[raw]".
171+ For example, if we want to detect artifacts on the raw recording, we can specify it as follows:
172+
173+
174+ .. code-block :: python
175+
176+ preprocessing_dict = {
177+ ' bandpass_filter' : {' freq_min' : 250 },
178+ ' common_reference' : {' operator' : ' median' , ' reference' : ' global' },
179+ ' detect_and_remove_artifacts' : {' recording_to_detect' : ' pipeline[raw]' },
180+ }
181+
182+
152183 Impact on recording dtype
153184-------------------------
154185
0 commit comments