This function is largely outdated and will not undergo continued maintenance or updates.
pupil_preprocess(
import_dir = NULL,
pattern = ".txt",
taskname = NULL,
subj_prefix = NULL,
subj_suffix = NULL,
timing_file = NULL,
output_dir = NULL,
output_steps = FALSE,
eyetracker = NULL,
hz = NULL,
eye_use = NULL,
px_to_mm.conversion = NULL,
start_tracking.message = "default",
start_tracking.match = "exact",
trial_onset.message = NULL,
trial_onset.match = "exact",
deblink_extend = 0,
pretrial.duration = NULL,
missing_allowed = 1,
interpolate = NULL,
interpolate.maxgap = Inf,
smooth = NULL,
smooth.window = 5,
method_first = NULL,
bc = NULL,
pre_bc.duration = NULL,
bc_onset.message = NULL,
bc_onset.match = "exact",
include_col = NULL,
trial_exclude = c(),
files_merge = FALSE,
starttracking.message = NULL,
starttracking.match = NULL,
trialonset.message = NULL,
trialonset.match = NULL,
pre_trial.duration = NULL,
prebc.duration = NULL,
bconset.message = NULL,
bconset.match = NULL
)
Folder path to raw data files
Pattern to look for in data files (e.g. ".txt")
Name of task - to be used in naming pre-processed files
The unique pattern prefix (letter(s) and/or symbol(s)) that comes before the subject number in the data file. This is mostly for SMI eyetrackers that are not good at including subject number in the data and therefore the subject number needs to be determined and extracted from the file name. If the filename is "pitch_discrimination_19-1_001 Samples.txt" and the Subject number is 19, then the subj_prefix = "n_" because that uniquely identifies a pattern that comes directly before the subject number in the file path. This can also be used for EyeLink or other eyetrackers, that include a subject number in a column in the datafile, to remove characters or numbers in front of a subject number.
The unique pattern suffix (letter(s) or symbol(s)) that comes after the subject number in the data file. This is mostly for SMI eyetrackers that are not good at including subject number in the data and therefore the subject number needs to be determined and extracted from the file name. If the filename is "pitch_discrimination_19-1_001 Samples.txt" and the Subject number is 19, then the subj_suffix = "-1" because that uniquely identifies a pattern that comes directly before the subject number in the file path. This can also be used for EyeLink or other eyetrackers, that include a subject number in a column in the datafile, to remove characters or numbers following (coming after) a subject number.
File location and name that contains timing information for message markers. This is only to be used if your data does not already have message markers embedded in the raw pupil data.
Folder path to output preprocessed data to
Output files for each step in preprocessing? This creates many more data files and therefore takes up more storage, but this can be useful if you want to analyze the data before and after a certain preprocessing method.
The eye-tracker used to record data. Options: "smi", "eyelink".
At which frequency was pupil data sampled at? (only required for interpolation and smoothing)
Which eye to use? "left" or "right"
The conversion factor to go from px pupil diameter to mm pupil diameter
Message used to mark when eyetracking has started. For SMI eyetrackers, the default value is "StartTracking.bmp". For EyeLink eyetrackers, the default value is "TRIALID". For more information on how to use message markers see https://dr-jt.github.io/pupillometry/articles/message_markers.html
Is the message string an "exact" match or a partial "pattern" match?
Message string that marks the start of a trial. For more information on how to use message markers see https://dr-jt.github.io/pupillometry/articles/message_markers.html
Is the message string an "exact" match or a partial "pattern" match
How many milliseconds to extend blinks before and after blink detection
Duration of pre-trial baseline period in milliseconds
What proportion of missing data is allowed, on a trial-by-trial basis? If a trial exceeds this amount then it will be removed from further preprocessing.
What type of interpolation to use? "linear" or "cubic-spline"
Maximum number of NAs to interpolate over. Any missing data gaps over this value will not be interpolated.
The type of smoothing function to apply. "hann" or "mwa" (moving window average)
Window size of smoothing function
Should "smooth" or "interpolate" be applied first? It is highly suggested to apply smoothing before interpolation. See: https://dr-jt.github.io/pupillometry/articles/smooth_interpolate_first.html
Do you want to use "subtractive" or "divisive" baseline correction?
Duration of baseline period to use that comes before the baseline corrected period
Message string(s) that marks the onset of the period to be baseline corrected. For more information on how to use message markers see https://dr-jt.github.io/pupillometry/articles/message_markers.html
Is the message string an "exact" match or a partial "pattern" match
Extra columns from the raw data file to include
Specify if there are any trials to exclude. Trial number
Do you want to create a single merge output file? TRUE or FALSE
See start_tracking.message
See start_tracking.match
See trial_onset.message
See trial_onset.match
See pretrial.duration
See pre_bc.duration
See bc_onset.duration
See bc_onset.match