Skip to content

Latest commit

 

History

History

DataProcessing

Requirements

User needs to download the Eye Gaze dataset as well as the images from MIMIC-CXR dataset.

Note: The Eye Gaze dataset should be placed in the Resources folder.

Once the files are downloaded then the following scripts are functional. The Data Preperation section is totally optional and they are shared for transparency purposes. We have the pre-processed data hosted on Physionet.

Description

There are four (4) folders containing the scripts used in the data preparation, data post-processing and validation tasks as described in the paper. Everything with the [OPTIONAL] tag is already data you have downloaded and needs to be run only if you want to dive deeper into the data preperation. Essentially the only script that you have to run is create_heatmap_images_and_or_videos.py script.

This folder contains scripts to reproduce data preparation for the eye gaze experiment. There are 3 scripts (run in sequence) that were used to query the MIMIC-IV Database (Google Cloud Big Query) and apply the inclusion/exclusion criteria as described in the paper:

  1. Linking_CXRs_to_ED_admissions.ipynb: This Google Cloud Big Query script produces a table linking all MIMIC-CXRs that are associated with an ED admission in MIMIC-IV Database. User is recommended to follow instructions here to run these queries:
  2. Sample_CXR_eye_gaze_dataset.ipynb: This Google Cloud Big Query script applies the inclusion/exclusion criteria to generate one table per condition: Pneumonia, CHF, and Normal. User is recommended to follow instructions here to run this script:
  3. preparing_images_master_sheet.py: This script generates the master_sheet.csv table as well as the resized images to use in the eye gaze experiment. It uses the condition tables (Pneumonia, CHF, Normal) from step 2 above. As a requirement, MIMIC-CXR images have to be downloaded first. User may skip the Google Cloud Big Query scripts (1 and 2 above) and just run this script using the downloaded files found in inclusion_exclusion_criteria_outputs folder in our PhysioNet project.
  • calibration_image.png: This is the calibration image used in the eye gaze experiment
  • create_heatmap_images_and_or_videos.py: This script generates the temporal and static heatmaps using the eye_gaze.csv and fixations.csv. It requires that MIMIC images have been downloaded.
  • [OPTIONAL]map_eye_gaze_from_screen_to_image_coordinates.py: This script maps eye gaze from screen coordinates (i.e. FPOGX,FPOGY) to original image coordinates (i.e X_ORIGINAL,Y_ORIGINAL). Running this script is optional since both eye_gaze.csv and fixations.csv contain this information. This is only if you want to replicate the Eye gaze mapping.
  • [OPTIONAL]speech_to_text.py: This script was used to call Google's Speech-To-Text API to generate the transcripts from audio

[OPTIONAL]Validation

  • validation: This script can be used to replicate validation analysis found in the Validation section of the paper