Anonymize & Upload EDFs to ieeg.org¶
Shared with the CNT
This procedure runs on infrastructure the lab and the CNT operate together. The CNT manual keeps its own copy; changes to the shared steps are agreed with the CNT.
What this page tells you
Anonymize Mxene EDFs on cnt1 with anonymize_edfs.sh (-n, -i, -d, -o required; date-shifts to 1/1/2000), create an ieeg-dataset.ini channel mapping, then upload the deid folder with ieeg upload-directory.
Mxene EEG Processing/Uploading¶
Use this procedure to de-identify and upload each EDF recording from the Mxene project.
- Move the EDF file into cnt-fs.
- For Mxene EEG:
/eeg_raw/Mxene_project/RIDXXXX/original
- For Mxene EEG:
- De-identify the EDF file.
- Open MobaXterm, and in cnt1 navigate to
/project/eeg_process/programs/edf_anonymize. - On the command line, run
bash anonymize_edfs.sh -n NAME -i ID -d DIRECTORY_INPUT -o DIRECTORY_OUTPUT -a ADD_DATE -s SUBTRACT_DATE.- This creates a new EDF file with anonymized headers.
- The de-identified file is named
<original_filename>_deid.edf.
- The de-identified file is named
- Options
-n: Removes the patient name from the header and replaces it with the name given here. The recommended value isdeid.-i: Removes the patient ID from the header and replaces it with the ID given here. The recommended value isdeid.-d: The path to the source directory where the EDF is stored, for example/mnt/cnt-fs/eeg_raw/Mxene_project/RIDXXXX/original.-o: The path to the output directory where the de-identified EDF is written, for example/mnt/cnt-fs/eeg_raw/Mxene_project/RIDXXXX/deid.-a: By default, the recording date of the EDF is shifted to 1/1/2000. To shift the date by adding days to the original recording date instead, give the number of days to add.-s: By default, the recording date of the EDF is shifted to 1/1/2000. To shift the date by subtracting days from the original recording date instead, give the number of days to subtract.
- The
-n,-i,-d, and-oflags are mandatory. The script errors if any of them is missing. - The
-aand-sflags are optional. Without them, the script shifts the EDF date to 1/1/2000, which is generally recommended. If both flags are given, the script errors.
- This creates a new EDF file with anonymized headers.
- Open MobaXterm, and in cnt1 navigate to
- Create the
ieeg-dataset.inichannel mapping file.- Copy the
ieeg-dataset.initemplate file and paste it into cnt-fs/eeg_raw/Mxene_project/RIDXXXX/deid. - Open the
ieeg-dataset.inifile in Notepad and edit the channel mappings as needed for the EDF recording.- Template:
channels=Fp1,Fp2,F7,F8,.... - Notes:
- Separate each channel with a comma. Do not put spaces between the channels.
- The order of the channels matters. It determines the order of the channels in ieeg.org.
- To rename a channel, use this form:
channels=FP1:Fp1,FP2:Fp2,F7,F8,T3:T7,T4:T8,....- The old channel name goes to the left of the colon, and the new channel name goes to the right of the colon.
- Do not rename the
ieeg-dataset.inifile. If it is renamed, the upload process fails.
- Template:
- Copy the
- Upload the deid EDF folder to ieeg.org.
- Make sure that the
<original_filename>_deid.edffile and theieeg-dataset.inichannel mapping file are both in the cnt-fs/eeg_raw/Mxene_project/RIDXXXX/deiddirectory, and that no other files are there. - In cnt1, navigate to
/project/eeg_process/programs/ieeg-cli-1.14.60. - Run
./ieeg upload-directory -n 'Human_Data/Hospital of the University of Pennsylvania/Mxene/RIDXXXX' '/mnt/cnt-fs/eeg_raw/Mxene_project/RIDXXXX/deid'. - Check ieeg.org and verify that the EDF looks correct.
- Make sure that the