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

Unexpected behavior for parcellation label picking #7

Open
Aaronearlerichardson opened this issue Jun 27, 2023 · 0 comments
Open

Unexpected behavior for parcellation label picking #7

Aaronearlerichardson opened this issue Jun 27, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@Aaronearlerichardson
Copy link
Collaborator

Intended Behavior

The popTaskSubjectData script determines the volume label for each electrode according to the following rules:

In volume percentage order, what brain parcellations are contained within a 3 mm radius of an electrode?

  1. If the parcellation contains the keyword White-Matter and is a volume percentage of <80%, consider the next largest volume label
  2. If the majority parcellation label contains the keywords Unknown or hypointensities and is <100%, consider the next largest volume label.

Actual Behavior

relevent snippet:

for iElec=1:size(TXT,1)
elec_nameT=strcat(Subject(SN).Name, '-',Tname(iElec,:));
iN=1;
while (contains(Trest(iElec,iN),'White-Matter')) && iN<=7 && NUM(iElec,iN)<0.8
%|| NUM(iElec,iN-2)<0.5
iN=iN+1;
end
% while (contains(Trest(iElec,iN),'Unknown') || contains(Trest(iElec,iN),'unknown') || contains(Trest(iElec,iN),'hypointensities') ) && NUM(iElec,iN)==1
% subj_labels_loc(iElecS+iElec)='Unknown';
% end
while (contains(Trest(iElec,iN),'Unknown') || contains(Trest(iElec,iN),'unknown') || contains(Trest(iElec,iN),'hypointensities') ) && NUM(iElec,iN)<1 && iN<=7
%|| NUM(iElec,iN-2)<0.5
iN=iN+1;
end
subj_labels2(iElecS+iElec)=elec_nameT;
%
subj_labels_loc(iElecS+iElec)=Trest(iElec,iN); % percentages
% subj_labels_loc{iElecS+iElec}=TXT(iElec+1,1); % first column
end

This code runs these rules, but in sequential order. This means that if a label breaks rule 2, and then the next label breaks rule 1 it will not be caught. An example of this test case might be:

[Unkown, 0.40], [Left-Cerebral-White-Matter, 0.31], [ctx_lh_G_temporal_middle, 0.29]

Will incorrectly choose the label Left-Cerebral-White-Matter when it should choose ctx_lh_G_temporal_middle

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

No branches or pull requests

2 participants