Skip to content

Instantly share code, notes, and snippets.

@bogovicj
bogovicj / shapeDemo.groovy
Created April 2, 2024 14:12
ImageJ2 script that displays a Diamond or Hypersphere neighborhood for a given radius
#@ DatasetService ds
#@ UIService ui
#@ Long radius = 13
#@ String (choices={"Diamond", "Hypersphere"}, style="listBox") shapeType
/*
* Displays a Diamond or Hypersphere neighborhood for a given radius
*/
if( shapeType.equals("Diamond"))
shp = new DiamondShape(radius);
@lacan
lacan / simpleKNN.py
Last active March 16, 2018 20:56
2D K Nearest Neighbors Python script when we have a point selection in ImageJ #Fiji #Python #ImageJ
#@ImagePlus imp
#@Integer(label="Number of Neighbors") k
#@Boolean(label="Give Each Neighbor's Distance") is_show_each
'''
Simple 2D KNN script
Olivier Burri, BioImaging & Optics Platform
Ecole Polytechnique Fédérale de Lausanne
July 12th 2016
@agosto-calvinbehling
agosto-calvinbehling / gist-gadget.xml
Created November 13, 2015 04:00 — forked from takuya0301/gist-gadget.xml
Google gadget for embedding Gist.
<?xml version="1.0" encoding="UTF-8"?>
<Module>
<ModulePrefs title="Gist">
<Require feature="dynamic-height"/>
</ModulePrefs>
<UserPref name="id" display_name="Gist ID" required="true" default_value="9088612"/>
<UserPref name="font_size" display_name="Font size (px)" required="true" default_value="12"/>
<UserPref name="line_height" display_name="Line height (px)" required="true" default_value="16"/>
<Content type="html">
<![CDATA[
@dsparks
dsparks / Marimekko.R
Created September 23, 2012 14:34
Simplest marimekko/mosaic plot
# Simplest possible marimekko/mosaic plot
doInstall <- TRUE # Change to FALSE if you don't want packages installed.
toInstall <- c("vcd", "ggplot2", "RColorBrewer")
if(doInstall){install.packages(toInstall, repos = "http://cran.us.r-project.org")}
lapply(toInstall, library, character.only = TRUE)
theme_set(theme_gray(base_size = 7))
# All you need to start with is individual count data, and a grouping variable
@mhawksey
mhawksey / gist:1170597
Created August 25, 2011 13:02
Google Apps Script to fill in a Document template with Spreadsheet data
function onOpen() {
var menuEntries = [ {name: "Create Diary Doc from Sheet", functionName: "createDocFromSheet"}];
var ss = SpreadsheetApp.getActiveSpreadsheet();
ss.addMenu("Fitness Diaries", menuEntries);
}
function createDocFromSheet(){
var templateid = "1O4afl8SZmMxMFpAiN16VZIddJDaFdeRBbFyBtJvepwM"; // get template file id
var FOLDER_NAME = "Fitness Diaries"; // folder name of where to put completed diaries
// get the data from an individual user