Skip to content

Instantly share code, notes, and snippets.

View louismullie's full-sized avatar

L louismullie

View GitHub Profile
@louismullie
louismullie / Encounter.js
Last active July 27, 2020 17:05
JSON template for the Encounter FHIR resource
{
// The type of resource
"resourceType" : "Encounter",
// Identifier. No special coding system.
"id": "some-encounter-id",
// The status of the encounter
"status": "in-progress",
@louismullie
louismullie / Observation-VitalSigns.js
Last active July 20, 2020 20:42
JSON template for the Observation FHIR resource
{
// The type of resource
"resourceType" : "Observation",
// The status of the observation
"status": "final",
// Time of the observation
"effectiveDateTime": "YYYY-MM-DDThh:mm:ss+zz:zz",
@louismullie
louismullie / Patient.js
Created July 20, 2020 20:14
JSON template for the FHIR Patient resource.
{
// The type of resource
"resourceType" : "Patient",
// An identifier for this patient
"identifier" : [{
// Indicate that this ID is a medical record number
"type": {
"coding": [
{
"system" : "http://loinc.org",
"version" : "2.62",
"code" : "55423-8",
"display" : "Number of steps in unspecified time Pedometer"
}
@louismullie
louismullie / segment.sh
Created July 17, 2020 00:17
Add segment to pathway app
#Step 1. Add the Analytics dependency to your Podfile
# The recommended way to install Analytics for iOS is via Cocoapods, since it means you can create a build with specific integrations, and because it makes it dead simple to install and upgrade.
pod 'Analytics', '~> 3.0'
# Step 2. Initialize the Client
# Add this snippet to your application delegate’s - application:didFinishLaunchingWithOptions: method.
SEGAnalyticsConfiguration *configuration = [SEGAnalyticsConfiguration configurationWithWriteKey:@"fvOmVqVIrSuOiJclgSWOFtUtD36Vksqd"];
# Enable this to record certain application events automatically!
<script>
!function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","page","once","off","on","addSourceMiddleware","addIntegrationMiddleware","setAnonymousId","addDestinationMiddleware"];analytics.factory=function(e){return function(){var t=Array.prototype.slice.call(arguments);t.unshift(e);analytics.push(t);return analytics}};for(var e=0;e<analytics.methods.length;e++){var t=analytics.methods[e];analytics[t]=analytics.factory(t)}analytics.load=function(e,t){var n=document.createElement("script");n.type="text/javascript";n.async=!0;n.src="https://cdn.segment.com/analytics.js/v1/"+e+"/analytics.min.js";var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(n,a);analytics._loadOptions=t};analytics.
import numpy as np
def image_histogram_equalization(image, number_bins=256):
# from http://www.janeriksolem.net/2009/06/histogram-equalization-with-python-and.html
# get image histogram
image_histogram, bins = np.histogram(image.flatten(), number_bins, density=True)
cdf = image_histogram.cumsum() # cumulative distribution function
cdf = 255 * cdf / cdf[-1] # normalize
from scipy import ndimage
from geometric_utils import find_largest_object
def extract_body_mask(im):
im_thresholded = im > 90
im_filled = ndimage.binary_erosion(im_thresholded, iterations=1)
im_filled = ndimage.binary_fill_holes(im_filled)
im_filled = ndimage.binary_erosion(im_filled, iterations=3)
block_header1: pageList[pageNameText, pageActionUrl] buttonActionText buttonActionUrl
block_footer1: companyNameText contactInformationText
socialIcons:
imageList[imageSourceUrl, imageActionUrl]
websiteSections:
sectionList[sectionNameText, pageList: [pageNameText, pageActionUrl]]
@louismullie
louismullie / CDVAppDelegate.m
Last active June 21, 2018 00:25
didRegisterForRemoteNotificationsWithDeviceToken
@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];