Skip to content

Commit

Permalink
Added filter to remove stimuli with no fixations
Browse files Browse the repository at this point in the history
  • Loading branch information
hkhanuja authored Dec 16, 2023
1 parent b3ae536 commit a4d8803
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pysaliency/filter_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,3 +288,10 @@ def filter_scanpaths_by_length(scanpaths: FixationTrains, intervals: list):
scanpaths = scanpaths.filter_fixation_trains(indices)

return scanpaths


def remove_stimuli_without_fixations(stimuli: Stimuli, fixations: Fixations):
"""Remove stimuli with no fixations"""

stimuli_indices_with_fixations = list(set(fixations.n))
return create_subset(stimuli, fixations, stimuli_indices_with_fixations)

0 comments on commit a4d8803

Please sign in to comment.