-
Notifications
You must be signed in to change notification settings - Fork 0
/
CellAnnotator.py
executable file
·65 lines (50 loc) · 1.57 KB
/
CellAnnotator.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/usr/bin/env Python
"""
CellAnnotator.py
"""
__author__ = 'rudolf.hoefler@gmail.com'
__licence__ = 'GPL'
import os
from os.path import dirname, join
import sys
import argparse
# special case on windoze
try:
import PyQt5.sip as sip
except ImportError:
import sip
sip.setapi('QString', 2)
sip.setapi('QVariant', 2)
from matplotlib import use
use("Qt5Agg")
from PyQt5 import QtGui
from PyQt5.QtWidgets import QApplication, QSplashScreen
from PyQt5.QtGui import QPixmap
from PyQt5.QtCore import Qt
from cat.gui.main import AtMainWindow
from cat import version
if __name__ == '__main__':
parser = argparse.ArgumentParser(\
description='Test script for tiled graphicview widget')
parser.add_argument('--file', '-f', help='hdf file to load', default=None)
args = parser.parse_args()
if args.file is not None and not os.path.isfile(args.file):
raise SystemExit("File does not exist!")
app = QApplication(sys.argv)
# windows always sucks!!
if sys.platform.startswith("win"):
sqldrivers = join(dirname(QtGui.__file__), "plugins")
app.addLibraryPath(sqldrivers)
splash_pix = QPixmap(':annotationtool_about.png')
splash = QSplashScreen(splash_pix, Qt.WindowStaysOnTopHint)
splash.setMask(splash_pix.mask())
splash.show()
splash.showMessage(version.information,
alignment=Qt.AnchorHorizontalCenter|
Qt.AnchorVerticalCenter)
app.processEvents()
mw = AtMainWindow(args.file)
mw.show()
app.thread().msleep(1000)
splash.finish(mw)
sys.exit(app.exec_())