Logfile Extraction
What is a log file and why do I need it?¶
A "log file" is a file in which events on computer systems or in networks are logged. The log file is a useful tool for documenting or archiving the various processes in a traceable manner. Especially in fMRI we are interested in how the conditions influence our brain signal.
We receive this information via a log file after every MRI measurement. Especially if you present your stimuli in a randomised manner, the log file is essential in order to be able to trace when which stimuli were delivered. Even if analysing data from an experiment that you have not programmed yourself, the log file is the first point of reference for understanding the experiment.
How to open a log file¶
The log file is available as a text document. Click on it to open the document automatically in your standard text editor (generally on Windows: the Windows Editor). Generally, any text editor can be used to view the log files however, it is adivised to use Excel to open the document. This makes it easier to recognise the shifted rows of the log file table.
To do so follow these instructions:
First, instead of "All Excel Files" → "All Files" must be selected, then the file is visible and can be opened. The previous settings can be retained for the "Text Import Wizard". After clicking on "Finish", the log file is displayed in a more structured form.
How to read a log file¶
The title of the experiment or scenario and the creation date are given under 1.
Under 2 you will find the column designations. The subject number ("Subject"), the trial
("Trial"), the event type ("Eventtype", which indicates when an image was shown), the code (important: here is when fixation and when different stimuli were shown), the time ("Time") at which the stimulus was presented and the duration of the stimulus ("Duration"). The unit is 10,000 milliseconds.
Under 3, a box is drawn around the offsets. In this example, these are the times or
starting points that have to be calculated. To avoid T1 effects, a few pulses are given at the beginning of the measurement without starting the actual experiment, the log file already records this process.
In order to calculate when the first actual stimulus was given, the time ("Time") must be subtracted from the 1st stimulus (stimulus_f with 899783 in our example).
This is indicated by the blue arrow.
Then 4 more offsets must be subtracted (numbers from 1-4). In our example, this is 1.45 seconds, which must then be subtracted 4x.
The red arrow points to the 1st trial, this is where the measurement starts.