This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import Firebase; | |
@import FirebaseMessaging; | |
/** | |
* Manually set the APNS token when the user successfully registered for remote notifications | |
*/ | |
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { | |
[[FIRMessaging messaging] setAPNSToken: deviceToken]; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# run with: gunicorn coreslicer:app --daemon | |
@app.route('/endpoint', methods = ['POST']) | |
def handle_endpoint_function(): | |
pass | |
def app(environ, start_response): | |
port = 8000 | |
app.run(host='0.0.0.0', port=port) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, request, send_file | |
import numpy as np, os, json | |
from scipy.misc import imsave | |
from coreslicer import read_dcm | |
app = Flask(__name__) | |
APP_ROOT = os.path.dirname(os.path.abspath(__file__)) | |
UPLOAD_FOLDER = os.path.join(APP_ROOT, '../tmp/coreslicer') | |
app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Serves as a repository for images used in the CoreSlicer documentation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# on remote machine | |
cd /home/coreslicer/www/ | |
mkdir coreslicer && cd coreslicer | |
git init | |
git config receive.denyCurrentBranch updateInstead | |
cd .. && mkdir coreslicer_pipeline && cd coreslicer_pipeline | |
git init | |
git config receive.denyCurrentBranch updateInstead |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def window_level(arr, window_center, window_width, lut_min=0, lut_max=255): | |
# Basic sanity checking. | |
if np.isreal(arr).sum() != arr.size: raise ValueError | |
if lut_max != 255: raise ValueError | |
if arr.dtype != np.float64: arr = arr.astype(np.float64) | |
# Get window information. | |
window_width = max(1, window_width) | |
wc, ww = np.float64(window_center), np.float64(window_width) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys, glob | |
import numpy as np | |
import os | |
import matplotlib.pyplot as plt | |
from matplotlib import colors | |
from scipy.signal import convolve2d | |
import scipy | |
from scipy import ndimage | |
from scipy.misc import imread |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys, glob | |
import numpy as np | |
import os | |
import matplotlib.pyplot as plt | |
from matplotlib import colors | |
from scipy.signal import convolve2d | |
import scipy | |
from scipy import ndimage | |
from scipy.misc import imread |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FalseClass | |
def +(b); 0 + b.to_i; end | |
def to_i; 0; end | |
end | |
class TrueClass | |
def +(b); 1 + b.to_i; end | |
def to_i; 1; end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function | |
""" | |
A very simple 'animation' of a 3D plot | |
""" | |
from mpl_toolkits.mplot3d import axes3d | |
import matplotlib.pyplot as plt | |
import numpy as np | |
import time | |
def generate(X, Y, phi): |