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

Provide console script entry point #69

Merged
merged 1 commit into from
Oct 26, 2021
Merged
Show file tree
Hide file tree
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
31 changes: 31 additions & 0 deletions BrainChart/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This Python file uses the following encoding: utf-8
"""
contact: software@cbica.upenn.edu
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/BrainChart/blob/main/LICENSE
"""

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


def main():
parser = argparse.ArgumentParser(description='iSTAGING 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)

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

app = QtWidgets.QApplication(sys.argv)
mw = MainWindow(dataFile=data_file,
harmonizationModelFile=harmonization_model_file,
SPAREModelFile=SPARE_model_file)
mw.show()
sys.exit(app.exec_())
31 changes: 0 additions & 31 deletions BrainChart/main.py

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
After proper installation, the tools can be used as follows

```shell
python -m BrainChart.main --data_file istaging.pkl.gz --harmonization_model_file MUSE_harmonization_model.pkl
BrainChart --data_file istaging.pkl.gz --harmonization_model_file MUSE_harmonization_model.pkl
```

where `istaging.pkl.gz` and `MUSE_harmonization_model.pkl` are the data and
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,6 @@
entry_points = {'brainchart.plugin' :
['plugin1=plugins:P1',
'plugin2=plugins:ScatterPlotSPAREs',
'plugin3=plugins:P2']}
'plugin3=plugins:P2'],
'console_scripts': ['BrainChart=BrainChart:main']}
)