thartbm / PyVMEC

A Python-based GUI to create and run visuo-motor experiments.
GNU General Public License v3.0
1 stars 3 forks source link

Add preprocessing button #37

Closed thartbm closed 6 years ago

thartbm commented 6 years ago

The data for every participant that did the same experiment should look the same, so we can do some preprocessing to get it into a shape that can be analyzed by students using relatively simple tools in Excel. We want a button for this that brings up a pop-up to control how the preprocessing will be done.

It should have a list of participants that did the experiment with tick boxes in front of them that say which ones should be used for the preprocessing. By default all of them are used. That is, when we see that one participant is really bad after opening the preprocessing files, then we can re-run preprocessing without that participant.

It should allow splitting the output by task, or just having one gigantic file (except for target-wise analysis). The pause-tasks should be omitted regardless.

The output should be a csv file, or several files. Each column is now a participant (their ID should be in the header). Each row is one of three things (these will be separate files):

The trial-by-trial output I hope is obvious. Output by block should have the average cursor error over a specific set of trials. These blocks are the same as what determines the number of trials (do we record block number?). Target-wise output doesn't care about time (in either blocks or trials), but calculates the average cursor error for all trials in one specific task that had the same target.

All tasks should be pre-processed by trial and by block, but there should also be a list of tasks with tick boxes that allow target-wise pre-processing. By default no task should be selected for target-wise preprocessing. The output for target-wise pre-processing should always be one file per task (putting it all in one file is either hard or very confusing for the person analyzing the data).

All tasks should have output per trial (for figures), and for blocks (for statistical analysis), so there is nothing to select there.

So users can decide these things in the pop-up:

Before generating the output, we should also eliminate obvious outliers, and this can most easily be done when we have all the participants' responses on all trials of all tasks in one big array or data frame. So that should be generated first. It would be good to have the rotation magnitude and direction available for all of those trials as well, so perhaps the first column can be trial number, and the second column can be (rotation magnitude * rotation direction).

The same array or data frame should still be there after outlier removal, but with some trials cursor-errors replaced with NaN. This data can then be saved for the trial-wise files, and is used for the block-wise and target-wise output as well. In order to be able to generate the target-wise output, we need the same size data frame or array but with targets instead of cursor errors. I guess it makes sense to collect that information at the same time.

Hope this makes sense and will get you started.