tjmahr / lookr

Scripts for looking-while-listening and visual-world eyetracking experiments
Other
7 stars 2 forks source link

open up AddAOIData function #19

Closed tjmahr closed 6 years ago

tjmahr commented 8 years ago

The AddAOIData function doesn't accept any other parameters (like new or custom AOI definitions).

> lookr:::AddAOIData.Trial
function (x) 
{
    trial <- x
    stim <- LookUpAOIs(trial)
    # Bunch of code to map looks to the AOIs in stim
}

Originally made this design decision because the AOI defs were pretty limited and could be hard-coded and automatically selected. Time to open things up.

tjmahr commented 8 years ago

How to resolve... Add AOIs parameter to function definition: function(x, AOIs = NULL).

Assign AOIs as trial level attributes, using some other function. Have this function peek at those attributes if the passed in AOIs are NULL

trial %@% "AOIs"
#> $ImageL
#> List of 2
#>  $ x: num [1:2] 0.0521 0.3646
#>  $ y: num [1:2] 0.25 0.75
#>  - attr(*, "class")= chr "AOI"
#> 
#> $ImageR
#> List of 2
#>  $ x: num [1:2] 0.635 0.948
#>  $ y: num [1:2] 0.25 0.75
#>  - attr(*, "class")= chr "AOI"
tjmahr commented 6 years ago

Nope. lookr is going into long-term maintenance mode. The next package can be more general.