Skip to content

Instantly share code, notes, and snippets.

tar -cf - . | ssh [email protected] "tar -xf - -C /www/basic/ahc/labmed/slides.pathology.umn.edu/htdocs"
@bdunnette
bdunnette / process-svs.sh
Last active November 20, 2020 06:30
Process Aperio SVS files into web tiles (with Leaflet-based viewer)
#!/bin/bash
# Copyright (c) 2014 Regents of the University of Minnesota
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
@bdunnette
bdunnette / add-drupalgap.sh
Last active August 29, 2015 13:55
Script to add Drupalgap to your Phonegap project
cordova platform add android
cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information.git
cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-console.git
cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git
cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-file.git
cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser.git
cordova build
cd www
wget https://github.com/signalpoint/DrupalGap/archive/drupalgap_7.x-1.7-alpha.zip
unzip drupalgap_7.x-1.7-alpha.zip
@bdunnette
bdunnette / aperio-get-image.md
Last active January 3, 2016 22:59
A demonstration of using Leaflet to load WSI tiles directly from Aperio ImageServer.

GET image?x+y+w+h+z+q+m+f+r ‐ returns region from image file

Returns region from an Aperio image file (SVS) at the specified image path. The region is returned as a JPEG image. The following parameters may be supplied:

  • x X‐coordinate of region, in pixels (upper left is [0,0]). Default is 0.
  • y Y‐coordinate of region, in pixels (upper left is [0,0]). Default is 0.
  • w width of region, in pixels. Maximum width is 2000 pixels. Default is image width or 2000, whichever is less.
  • h height of region, in pixels. Maximum height is 2000 pixels. Default is image height or 2000, whichever is less.
  • z zoom level of region (float), .5 = 200%, 2 = 50%, 4 = 25%. Other special values:
  • ‐1 = thumbnail image
@bdunnette
bdunnette / gist:7901201
Created December 10, 2013 22:11 — forked from sartak/a.md
-- cards are what you review. easy!
CREATE TABLE cards (
id integer primary key,
-- the epoch milliseconds of when the card was created
nid integer not null,
-- notes.id
did integer not null,
-- deck id (available in col table)
ord integer not null,
-- ordinal, seems like. for when a model has multiple templates, or thereabouts
var soap = require('soap');
var url = 'http://gleason.ahc.umn.edu:86/Aperio.Image/Image.aspx?method=wsdl';
var args = {name: 'value'};
soap.createClient(url, function(err, client) {
console.log(err);
console.log(client);
});
var fs = require('fs');
var path = require('path');
var http = require('http');
var querystring = require('querystring');
var args = process.argv.splice(2);
if (args.length >= 2) {
var sourceDir = args[0];
var caseNum = args[1];
curl --form file=@159_02_marked.jpg --form data='{"item": {"id": 13456}}' http://160.94.51.184/omeka/api/files?key=insert_key_here
goog.provide('L.SingleTileWMSLayer');
goog.require('L.Map');
L.SingleTileWMSLayer = L.ImageOverlay.extend({
defaultWmsParams: {
service: 'WMS',
request: 'GetMap',
version: '1.1.1',
/*
* L.SingleTile uses L.ImageOverlay to display a single-tile WMS layer.
* url parameter must accept WMS-style width, height and bbox.
*/
L.SingleTile = L.ImageOverlay.extend({
defaultWmsParams: {
service: 'WMS',
request: 'GetMap',
version: '1.1.1',