MultiMatch comparison¶
Install the optional feature first with pip install "pyxations[multimatch]". This example generates BIDS data from the committed EyeLink source example and compares two trials from its single subject/session.
In [1]:
Copied!
from pathlib import Path
from pyxations import (
VisualSearchExperiment,
compute_derivatives_for_dataset,
dataset_to_bids,
)
repo = next(
path
for path in (Path.cwd(), *Path.cwd().parents)
if (path / "pyproject.toml").is_file()
)
files_folder_path = repo / "examples" / "eyelink_visual_search"
output_folder = repo / "generated"
bids_dataset_folder = dataset_to_bids(
output_folder, files_folder_path, "example_dataset", overwrite=True
)
msg_keywords = ["begin", "end", "press"]
start_msgs = {"search": ["beginning_of_stimuli"]}
end_msgs = {"search": ["end_of_stimuli"]}
detection_algorithm = "eyelink"
dataset_format = "eyelink"
derivatives_path = compute_derivatives_for_dataset(
bids_dataset_folder,
dataset_format,
detection_algorithm,
msg_keywords=msg_keywords,
start_msgs=start_msgs,
end_msgs=end_msgs,
overwrite=True,
)
from pathlib import Path
from pyxations import (
VisualSearchExperiment,
compute_derivatives_for_dataset,
dataset_to_bids,
)
repo = next(
path
for path in (Path.cwd(), *Path.cwd().parents)
if (path / "pyproject.toml").is_file()
)
files_folder_path = repo / "examples" / "eyelink_visual_search"
output_folder = repo / "generated"
bids_dataset_folder = dataset_to_bids(
output_folder, files_folder_path, "example_dataset", overwrite=True
)
msg_keywords = ["begin", "end", "press"]
start_msgs = {"search": ["beginning_of_stimuli"]}
end_msgs = {"search": ["end_of_stimuli"]}
detection_algorithm = "eyelink"
dataset_format = "eyelink"
derivatives_path = compute_derivatives_for_dataset(
bids_dataset_folder,
dataset_format,
detection_algorithm,
msg_keywords=msg_keywords,
start_msgs=start_msgs,
end_msgs=end_msgs,
overwrite=True,
)
In [2]:
Copied!
exp = VisualSearchExperiment(bids_dataset_folder, "search", "mem")
exp.load_data("eyelink")
exp = VisualSearchExperiment(bids_dataset_folder, "search", "mem")
exp.load_data("eyelink")
In [3]:
Copied!
# Compare two trials from the bundled subject/session
session = exp["0001"]["second"]
trial_one = session[0]
trial_two = session[1]
# Compute multimatch
multimatch = trial_one.compute_multimatch(trial_two, 1080, 1920)
print(multimatch)
# Compare two trials from the bundled subject/session
session = exp["0001"]["second"]
trial_one = session[0]
trial_two = session[1]
# Compute multimatch
multimatch = trial_one.compute_multimatch(trial_two, 1080, 1920)
print(multimatch)
[np.float64(0.9859759308048632), np.float64(0.33305162534908994), np.float64(0.9826406452134908), np.float64(0.9266035869922108), np.float64(0.636785733411878)]