spinsight 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- spinsight/__init__.py +0 -0
- spinsight/constants.py +2 -0
- spinsight/deploy.py +37 -0
- spinsight/hoverCallback.js +6 -0
- spinsight/main.py +1821 -0
- spinsight/paramBounds.tex +231 -0
- spinsight/phantoms/abdomen/abdomen.svg +276 -0
- spinsight/phantoms/brain/brain.svg +329 -0
- spinsight/sequence.py +139 -0
- spinsight-1.0.0.dist-info/LICENSE.md +674 -0
- spinsight-1.0.0.dist-info/METADATA +55 -0
- spinsight-1.0.0.dist-info/RECORD +14 -0
- spinsight-1.0.0.dist-info/WHEEL +4 -0
- spinsight-1.0.0.dist-info/entry_points.txt +3 -0
spinsight/__init__.py
ADDED
|
File without changes
|
spinsight/constants.py
ADDED
spinsight/deploy.py
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Deploy app on network
|
|
2
|
+
|
|
3
|
+
import socket
|
|
4
|
+
import panel as pn
|
|
5
|
+
import optparse
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
import sys
|
|
8
|
+
sys.path.append(str(Path(__file__).parent.parent))
|
|
9
|
+
from spinsight import main
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def CLI():
|
|
13
|
+
# parse command line
|
|
14
|
+
p = optparse.OptionParser()
|
|
15
|
+
p.add_option('--port', '-p', default=80, type="int",
|
|
16
|
+
help="Port to deploy SpinSight")
|
|
17
|
+
p.add_option('--network', '-n', action='store_true',
|
|
18
|
+
help="Deploy on local network")
|
|
19
|
+
p.add_option('--url', '-u', default='', type="string",
|
|
20
|
+
help="URL identifying server")
|
|
21
|
+
options, arguments = p.parse_args()
|
|
22
|
+
|
|
23
|
+
hosts = []
|
|
24
|
+
if options.network: # get IP number
|
|
25
|
+
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
|
26
|
+
s.connect(('8.8.8.8', 80))
|
|
27
|
+
hosts = [s.getsockname()[0]] # IP number
|
|
28
|
+
if options.url:
|
|
29
|
+
hosts.append(options.url)
|
|
30
|
+
|
|
31
|
+
if len(hosts)>0:
|
|
32
|
+
print('Deploying SpinSight at:')
|
|
33
|
+
for host in hosts:
|
|
34
|
+
print('* http://{}:{}'.format(host, options.port))
|
|
35
|
+
|
|
36
|
+
# serve application
|
|
37
|
+
pn.serve(main.getApp, show=False, title='SpinSight', port=options.port, websocket_origin=['{}:{}'.format(host, options.port) for host in hosts])
|