# file: ./params_v01.txt
#
# A parameter file that defines key paramters for decoding EEG signals.
# The standard NEDC parameter file parser is used to load this. There is
# a function in the decoder class, called load_parameters, that loads this.
#
# revision history:
#
# 20230422 (JP): reviewed for release
# 20220906 (JP): final code review
# 20220818 (JP): another code review
# 20220816 (JP): code review
# 20220721 (ML): initial version
#

# set version information
#
version = param_v1.0.0

#------------------------------------------------------------------------------
#
RESNET_DECODE {

    # sample_frequency is measured in Hz (50 Hz).
    # frame_duration is the duration of a frame in secs (256 samples @ 50 Hz).
    # transform_crop is the amount of time we away (32 samples @ 50 Hz).
    #    The combination of frame_duration and transform_crop were based on
    #    what was used for the ImageNet competitions.
    # The transform order is frame_duration_in_samples - transform_crop.
    #
    sample_frequency = 50.000
    frame_duration = 5.1200
    transform_crop = 32
    
    # model filename
    #
    mdl_fname = '$NEDC_NFC/models/model.pckl'

    #  The first set of numbers for transforms.Normalize are RGB means,
    #  while the second set of numbers are the standard deviations of
    #  pixel values for the ImageNet database.
    #
    # Notes:
    #  Using Imagenet data is common practice when using images in deep
    #  learning. This is because of the large database that ImageNet
    #  boasts (over 1 million classified images). More information
    #  about ImageNet can be found here:
    #   https://www.image-net.org/about.php	
    #	
    #  transforms.Resize resizes the image to a specified length and width
    #  transforms.CenterCrop crops the image to a specified length and width
    #  transforms.ToTensor converts the PIL image to tensor format and scales
    #    the pixel values between 0.0 and 1.0
    #  transforms.Normalize normalizes (smooths) the image by applying the
    #    formula: out = (in - mean) / standard deviation, the first list
    #    contains mean values for the red, blue and green channels.
    #
    transforms = 'transforms.Compose([transforms.Resize(self.frmsize), transforms.CenterCrop(transform_order), transforms.ToTensor(), transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])])'

    # list of channels for the json object:
    #  the channels are tagged with a label in the JSON object:
    #
    #   {"timeStart": ..., "sampleRate": 50, "data": {"F3": ... "F4": ......}}
    #
    # The channel labels below indicate the order in which these channels
    # are assembled into the signal matrix.
    #
    channel_order = "['EEG FP1-REF', 'EEG FP2-REF', 'EEG F3-REF', 'EEG F4-REF', 'EEG C3-REF', 'EEG C4-REF', 'EEG P3-REF', 'EEG P4-REF', 'EEG O1-REF', 'EEG O2-REF', 'EEG F7-REF', 'EEG F8-REF', 'EEG T3-REF', 'EEG T4-REF', 'EEG T5-REF', 'EEG T6-REF', 'EEG CZ-REF']"
    montage_order = "['FP1-F7', 'F7-T3', 'T3-T5', 'T5-O1', 'FP2-F8', 'F8-T4', 'T4-T6', 'T6-O2', 'T3-C3', 'C3-CZ', 'CZ-C4', 'C4-T4', 'FP1-F3', 'F3-C3', 'C3-P3', 'P3-O1', 'FP2-F4', 'F4-C4', 'C4-P4', 'P4-O2']"
    
    # select a CPU or GPU device:
    #  decoding does not run significantly faster on a GPU, so we use
    #  CPUs for decoding since we have a lot of available CPUs.
    #
    # device = 'cuda:0'
    device = 'cpu'

    # set the postprocessor parameters:
    #  seizure_threshold: the minimum probability for a seizure event
    #  minimum_background_duration: the minimum time for an acceptable
    #     background event
    #  minimum_seizure_duration: the minimum time for an acceptable
    #     seizure event
    #  postprocessing_window_duration: the maximum amount of time before
    #     an event can be output
    #
    # These values were optimized on TUSZ v1.5.3 and v1.5.4.
    #
    seizure_threshold = 0.94
    minimum_background_duration = 80
    minimum_seizure_duration = 20
    postprocessing_window_duration = 120
}

#------------------------------------------------------------------------------
#
# end of file
#
#------------------------------------------------------------------------------
