Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

antisaccade notebook and initial refactor #3

Merged
merged 3 commits into from
Jan 5, 2024
Merged

Conversation

scott-huberty
Copy link
Member

Hey @jadesjardins I created a notebook specifically for antisaccade (so different team members don't have to change the subject/task when they pull the notebook if they want to work on a different task).

I Also refactored some of the code.. I'll leave comments to those sections for you.

As far as AS - we are close...

The head channels show up and do have the gaps as I'd expect (just visually inspecting). But the eyegaze and pupil channels are missing.

image

event_dict = {event: int(i) + 1
for i, event in enumerate(stim_names)
if event != 'STI 014'}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I understand it when you did

for i in range(0,len(stim_names)-1):
    event_dict[stim_names[i]] = i + 1

You wanted to create a dict with each stim channel as a key, and an integer (starting at 1) as a value, excluding the last stim channel.. STI 014. If True, I'd prefer this method as it is a little more explicit.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact now that I'm looking at this I realized that You don't even need the int() wrapped around that i. I don't know why I did that.

print('no dstr label found.. continuing')"""

return event_dict

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wrapping that whole commented section in triple quotes instead of having a # on each line.


# calculate the inter trial interval between stimulus onset DIN events
eeg_iti = np.diff(eeg_stims[:, 0])
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I refactored the section starting with elif task_name == as.

I used np.where to do matrix operations instead of a big for loop of the indices. I Tested the code on my side.

@scott-huberty
Copy link
Member Author

Can this be merged?

@jadesjardins, how many changes have you made to your notebooks since you last pushed?

@scott-huberty
Copy link
Member Author

Alternatively, If I don't hear back I will assume I have administrator rights and will merge next week.

@jadesjardins jadesjardins merged commit 353ad0d into main Jan 5, 2024
@jadesjardins jadesjardins deleted the scott_refactor branch January 5, 2024 14:52
@scott-huberty
Copy link
Member Author

Hey @jadesjardins let me know if the code in this PR still works for you (I havent' tested in a while).

On a related note I opened mne-tools/mne-python#12300 with MNE to read EGI events directly as annotations, which should make your lives easier.

I started a branch for standardizing external pilot files (starting with GO), but havent' gotten around to finishing it yet..

@jadesjardins
Copy link
Collaborator

yes, thanks... I had been developing things locally in an unorganized way and now I am working on bringing everything together to be current and get q1k BIDS compliant at the onset. The direct read of events to annotations would be great! thanks! I am testing a generic BIDS process to run pylossless.. once that I am happy with that I am going to start working with the events and task specific details. I will take a look at what you have done with GO.

@scott-huberty
Copy link
Member Author

Alright I'll try to push that forward for you in the next week or two! If I can't I'll share the WIP work for GO that I have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants