Skip to content

Commit

Permalink
Renamed NiBAxV2 to NiChart.
Browse files Browse the repository at this point in the history
  • Loading branch information
MUSA-650 committed Nov 14, 2022
0 parents commit a3ddb5f
Show file tree
Hide file tree
Showing 136 changed files with 41,942 additions and 0 deletions.
3 changes: 3 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
By using NiChart, the user agrees to the following license:

See https://www.med.upenn.edu/cbica/software-agreement-non-commercial.html
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include NiChart/plugins/loadsave/MUSE_ROI_Dictionary.csv
include README.md
19 changes: 19 additions & 0 deletions NiChart/NiChartCmdApp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# This Python file uses the following encoding: utf-8
"""
contact: [email protected]
Copyright (c) 2018 University of Pennsylvania. All rights reserved.
Use of this source code is governed by license located in license file: https://github.com/CBICA/NiChart/blob/main/LICENSE
"""

from PyQt5 import QtCore, QtGui, QtWidgets
import os
import pandas as pd
from NiChart.core.dataio import DataIO
from NiChart.core.model.datamodel import DataModel

class NiChartCmdApp:
def __init__(self):
pass

if __name__ == '__main__':
main()
47 changes: 47 additions & 0 deletions NiChart/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# This Python file uses the following encoding: utf-8
"""
contact: [email protected]
Copyright (c) 2018 University of Pennsylvania. All rights reserved.
Use of this source code is governed by license located in license file: https://github.com/CBICA/NiChart/blob/main/LICENSE
"""

from PyQt5 import QtCore, QtGui, QtWidgets
import argparse
import os, sys
from NiChart.mainwindow import MainWindow
from NiChart.NiChartCmdApp import NiChartCmdApp

def main():
parser = argparse.ArgumentParser(description='NiChart Data Visualization and Preparation')
parser.add_argument('--data_file', type=str, help='Data file containing data frame.', default=None, required=False)
parser.add_argument('--dict_file', type=str, help='Dict file containing data dictionary.', default=None, required=False)
parser.add_argument("-nogui", action="store_true", help="Launch application in CLI mode to do data processing without any visualization or graphical user interface.")

args = parser.parse_args(sys.argv[1:])

data_file = args.data_file
dict_file = args.dict_file
noGUI = args.nogui

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()
NiChartCmdApp().ComputeSpares(data_file, SPARE_model_file, output_file)
else:
app = QtWidgets.QApplication(sys.argv)

# Set the style sheet
with open('./style.qss', 'r') as f: ## FIXME this is absolute path to curr dir
style = f.read()
app.setStyleSheet(style)

mw = MainWindow(dataFile = data_file, dictFile = dict_file)
mw.show()

sys.exit(app.exec_())

if __name__ == '__main__':
main()
59 changes: 59 additions & 0 deletions NiChart/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# This Python file uses the following encoding: utf-8
"""
contact: [email protected]
Copyright (c) 2018 University of Pennsylvania. All rights reserved.
Use of this source code is governed by license located in license file: https://github.com/CBICA/NiChart/blob/main/LICENSE
"""

from PyQt5 import QtCore, QtGui, QtWidgets
import argparse
import os, sys
from NiChart.mainwindow import MainWindow
from NiChart.NiChartCmdApp import NiChartCmdApp

def main():
parser = argparse.ArgumentParser(description='NiChart Data Visualization and Preparation')
parser.add_argument('--data_file', type=str, help='Data file containing data frame.', default=None, required=False)
parser.add_argument('--harmonization_model_file', type=str, help='Harmonization model file.', default=None, required=False)
parser.add_argument('--SPARE_model_file', type=str, help='Model file for SPARE-scores.', default=None, required=False)
parser.add_argument('--harmonize', type=str, help='Do harmonization or not.', default=None, required=False)
parser.add_argument('--compute_spares', type=str, help='Compute SPARE-scores or not.', default=None, required=False)
parser.add_argument('--output_file_name', type=str, help='Name of the output file with extension.', default=None, required=False)
parser.add_argument("-nogui", action="store_true", help="Launch application in CLI mode to do data processing without any visualization or graphical user interface.")

args = parser.parse_args(sys.argv[1:])

data_file = args.data_file
harmonization_model_file = args.harmonization_model_file
SPARE_model_file = args.SPARE_model_file
harmonize = args.harmonize
compute_spares = args.compute_spares
output_file = args.output_file_name
noGUI = args.nogui


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()
NiChartCmdApp().ComputeSpares(data_file,SPARE_model_file,output_file)
else:
app = QtWidgets.QApplication(sys.argv)

with open('./style.qss', 'r') as f:
style = f.read()
# Set the current style sheet
app.setStyleSheet(style)


mw = MainWindow(dataFile=data_file,
harmonizationModelFile=harmonization_model_file,
SPAREModelFile=SPARE_model_file)
mw.show()

#sys.exit(app.exec_())

if __name__ == '__main__':
main()
Binary file added NiChart/__pycache__/NiChartCmdApp.cpython-38.pyc
Binary file not shown.
Binary file added NiChart/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file added NiChart/__pycache__/aboutdialog.cpython-38.pyc
Binary file not shown.
Binary file added NiChart/__pycache__/mainwindow.cpython-38.pyc
Binary file not shown.
27 changes: 27 additions & 0 deletions NiChart/aboutdialog.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# This Python file uses the following encoding: utf-8
"""
contact: [email protected]
Copyright (c) 2018 University of Pennsylvania. All rights reserved.
Use of this source code is governed by license located in license file: https://github.com/CBICA/NiChart/blob/main/LICENSE
Author: Ashish Singh
"""

from PyQt5 import QtCore, QtWidgets, uic
import os
from NiChart.resources import resources

class AboutDialog(QtWidgets.QDialog):
def __init__(self,parent=None):
super(AboutDialog,self).__init__(parent)
self.SetupUi()
self.SetupConnections()

def SetupConnections(self):
self.buttonBox.accepted.connect(self.OnOkBtnClicked)

def OnOkBtnClicked(self):
self.hide()

def SetupUi(self):
root = os.path.dirname(__file__)
self.ui = uic.loadUi(os.path.join(root, 'aboutdialog.ui'), self)
127 changes: 127 additions & 0 deletions NiChart/aboutdialog.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Dialog</class>
<widget class="QDialog" name="Dialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>716</width>
<height>395</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="windowTitle">
<string>About NiChart</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="imagearea">
<property name="maximumSize">
<size>
<width>256</width>
<height>256</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap>resources/NiChartLogo.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:7.875pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:9pt; font-weight:600;&quot;&gt;Version 0.1 &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:9pt; font-weight:600;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;© &lt;/span&gt;&lt;span style=&quot; font-size:9pt;&quot;&gt;University of Pennsylvania&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:9pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:9pt;&quot;&gt;NiChart facilitates preparation of neuro-imaging data for machine learning applications.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:9pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a href=&quot;https://github.com/CBICA/NiChart&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;https://github.com/CBICA/NiChart&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:9pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:9pt; font-weight:600;&quot;&gt;License&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:9pt;&quot;&gt;By using NiChart, the user agrees to the following license:&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a href=&quot;https://www.med.upenn.edu/cbica/software-agreement-non-commercial.html&quot;&gt;&lt;span style=&quot; font-size:8pt; text-decoration: underline; color:#0000ff;&quot;&gt;https://www.med.upenn.edu/cbica/software-agreement-non-commercial.html&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot; font-size:9pt;&quot;&gt; &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:9pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:9pt; font-weight:600;&quot;&gt;Developers:&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:9pt;&quot;&gt;Ahmed Abdulkadir, Ashish Singh, Randa Melhem&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:9pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:9pt; font-weight:600;&quot;&gt;Documentation Writers:&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:9pt;&quot;&gt;Ahmed Abdulkadir, Ashish Singh, Randa Melhem&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt; text-decoration: underline; color:#0000ff;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>Dialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>Dialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>
Loading

0 comments on commit a3ddb5f

Please sign in to comment.