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

Change White Matter removal process for electrode plotting #77

Closed
Aaronearlerichardson opened this issue Jun 27, 2023 · 2 comments · Fixed by #90
Closed

Change White Matter removal process for electrode plotting #77

Aaronearlerichardson opened this issue Jun 27, 2023 · 2 comments · Fixed by #90
Assignees
Labels
bug Something isn't working

Comments

@Aaronearlerichardson
Copy link
Collaborator

Change the electrode parcellation label picking process from current implementation to match the MATLAB implementation.

@Aaronearlerichardson Aaronearlerichardson added the bug Something isn't working label Jun 27, 2023
@Aaronearlerichardson Aaronearlerichardson self-assigned this Jun 27, 2023
@Aaronearlerichardson
Copy link
Collaborator Author

Current intended MATLAB implementation: coganlab/MATLAB-env#7

@Aaronearlerichardson
Copy link
Collaborator Author

Current label picking logic implemented here:

def pick_no_wm(picks: list[str], labels: OrderedDict[str, list[str]]):
"""Picks the channels that are not in the white matter
Parameters
----------
picks : list[str | int]
The channels to pick from
labels : dict[str | int, list[str]]
The labels for each channel
Returns
-------
list[str | int]
The channels that are not in the white matter
"""
# remove 'Unknown' values from label lists
for k, v in labels.items():
while 'Unknown' in v:
labels[k].remove('Unknown')
v = labels[k]
# remove corresponding picks with either 'White-Matter' in the left most
# entry or empty lists
if isinstance(picks[0], int):
picks = [list(labels.keys())[p] for p in picks]
picks = [p for p in picks if labels[p]]
picks = [p for p in picks if 'White-Matter' not in labels[p][0]]
return picks

@Aaronearlerichardson Aaronearlerichardson linked a pull request Dec 12, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant