braindecode.preprocessing.Anonymize#
- class braindecode.preprocessing.Anonymize(daysback=None, keep_his=False, verbose=None)[source]#
Braindecode preprocessor wrapper for
anonymize().Anonymize measurement information in place.
- Parameters:
- daysbackint | None
Number of days to subtract from all dates. If
None(default), the acquisition date,info['meas_date'], will be set toJanuary 1ˢᵗ, 2000. This parameter is ignored ifinfo['meas_date']isNone(i.e., no acquisition date has been set).- keep_hisbool | “his_id” | “sex” | “hand” | sequence of {“his_id”, “sex”, “hand”}
If
True,his_id,sex, andhandofsubject_infowill not be overwritten. IfFalse, these fields will be anonymized. If"his_id","sex", or"hand"(or any combination thereof in a sequence), only those fields will not be anonymized. Defaults toFalse.Warning
Setting
keep_histo anything other thanFalsemay result ininfonot being fully anonymized. Use with caution.Changed in version 1.12: Added support for sequence of
str.- verbosebool | str | int | None
Control verbosity of the logging output. If
None, use the default verbosity level. See the logging documentation andmne.verbose()for details. Should only be passed as a keyword argument.
- Returns:
- instsame type as the input data
The modified instance.
Notes
Removes potentially identifying information if it exists in
info. Specifically for each of the following we use:- meas_date, file_id, meas_id
A default value, or as specified by
daysback.
- subject_info
Default values, except for ‘birthday’, which is adjusted to maintain the subject age. If
keep_hisis notFalse, then the fields ‘his_id’, ‘sex’, and ‘hand’ are not anonymized, depending on the value ofkeep_his.
- experimenter, proj_name, description
Default strings.
- utc_offset
None.
- proj_id
Zeros.
- proc_history
Dates use the
meas_datelogic, and experimenter a default string.
- helium_info, device_info
Dates use the
meas_datelogic, meta info uses defaults.
If
info['meas_date']isNone, it will remainNoneduring processing the above fields.Operates in place.
Added in version 0.13.0.
Examples using braindecode.preprocessing.Anonymize#
Comprehensive Preprocessing with MNE-based Classes