Skip to content

Commit

Permalink
Fix crash because of non-existing WMLS column names
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdulkadirA authored and melhemr committed Sep 20, 2022
1 parent fc7ee75 commit c9ca099
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
13 changes: 9 additions & 4 deletions NiBAx/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,22 @@ def main():
output_file = args.output_file_name
noGUI = args.nogui

if(noGUI == None):

if(noGUI):
app = QtCore.QCoreApplication(sys.argv)
if(compute_spares):
if((data_file == None) or (SPARE_model_file == None) or (output_file == None)):
print("Please provide '--data_file', '--SPARE_model_file' and '--output_file_name' to compute spares.")
exit()
NiBAxCmdApp().ComputeSpares(data_file,SPARE_model_file,output_file)
else:
app = QtWidgets.QApplication(sys.argv)
mw = MainWindow(dataFile=data_file,
harmonizationModelFile=harmonization_model_file,
SPAREModelFile=SPARE_model_file)
mw.show()

sys.exit(app.exec_())
else:
app = QtCore.QCoreApplication(sys.argv)
NiBAxCmdApp().ComputeSpares(data_file,SPARE_model_file,output_file)

if __name__ == '__main__':
main()
13 changes: 5 additions & 8 deletions NiBAx/plugins/agetrends/agetrends.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,11 @@ def PopulateROI(self):
+ ['SPARE_AD','SPARE_BA','Non-existing-ROI','DLICV'])

# !!! remove ROI with no dictionary entry
if 'WMLS_Volume_43' in roiList:
roiList.remove('WMLS_Volume_43')

if 'WMLS_Volume_42' in roiList:
roiList.remove('WMLS_Volume_42')

if 'WMLS_Volume_69' in roiList:
roiList.remove('WMLS_Volume_69')
for invalid_ROI in ['WMLS_Volume_43', 'WMLS_Volume_42', 'WMLS_Volume_69',
'WMLS_Volume_1', 'WMLS_Volume_621', 'WMLS_Volume_622',
'WMLS_Volume_700' ]:
if invalid_ROI in roiList:
roiList.remove(invalid_ROI)


_, MUSEDictIDtoNAME = self.datamodel.GetMUSEDictionaries()
Expand Down

0 comments on commit c9ca099

Please sign in to comment.