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

Set ROI to DLICV if invalid entry is entered #67

Merged
merged 1 commit into from
Oct 21, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 17 additions & 13 deletions BrainChart/mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,20 +394,24 @@ def UpdatePlot(self):
currentROI = self.comboBoxROI.currentText()
currentHue = self.comboBoxHue.currentText()


# Translate ROI name back to ROI ID
MUSEDictNAMEtoID, _ = self.model.GetMUSEDictionaries()
if currentROI.startswith('(MUSE)'):
currentROI = list(map(MUSEDictNAMEtoID.get, [currentROI[7:]]))[0]

if currentROI.startswith('(Harmonized MUSE)'):
currentROI = 'H_' + list(map(MUSEDictNAMEtoID.get, [currentROI[18:]]))[0]

if currentROI.startswith('(Residuals MUSE)'):
currentROI = 'RES_' + list(map(MUSEDictNAMEtoID.get, [currentROI[17:]]))[0]

if currentROI.startswith('(WMLS)'):
currentROI = list(map(MUSEDictNAMEtoID.get, [currentROI[7:]]))[0].replace('MUSE_', 'WMLS_')
try:
MUSEDictNAMEtoID, _ = self.model.GetMUSEDictionaries()
if currentROI.startswith('(MUSE)'):
currentROI = list(map(MUSEDictNAMEtoID.get, [currentROI[7:]]))[0]

if currentROI.startswith('(Harmonized MUSE)'):
currentROI = 'H_' + list(map(MUSEDictNAMEtoID.get, [currentROI[18:]]))[0]

if currentROI.startswith('(Residuals MUSE)'):
currentROI = 'RES_' + list(map(MUSEDictNAMEtoID.get, [currentROI[17:]]))[0]

if currentROI.startswith('(WMLS)'):
currentROI = list(map(MUSEDictNAMEtoID.get, [currentROI[7:]]))[0].replace('MUSE_', 'WMLS_')
except:
currentROI = 'DLICV'
self.comboBoxROI.setCurrentText('DLICV')
print("Could not translate combo box item. Setting to `DLICV`.")


#create empty dictionary of plot options
Expand Down