Skip to content

Instantly share code, notes, and snippets.

/* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript+markdown&plugins=line-numbers+file-highlight */
var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(){var e=/\blang(?:uage)?-(\w+)\b/i,t=0,n=_self.Prism={manual:_self.Prism&&_self.Prism.manual,util:{encode:function(e){return e instanceof a?new a(e.type,n.util.encode(e.content),e.alias):"Array"===n.util.type(e)?e.map(n.util.encode):e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).match(/\[object (\w+)\]/)[1]},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++t}),e.__id},clone:function(e){var t=n.util.type(e);switch(t){case"Object":var a={};for(var r in e)e.hasOwnProperty(r)&&(a[r]=n.util.clone(e[r]));return a;case"Array":return e.map(function(e){return n.util.clone(e)})}return e}},languages:{extend:function(e,t){var a=n.util.clone(n.langua
@miura
miura / imageToText.gs
Created July 28, 2017 00:44 — forked from tagplus5/imageToText.gs
google apps script image to text ocr
function doGet(request) {
if (request.parameters.url != undefined && request.parameters.url != "") {
var imageBlob = UrlFetchApp.fetch(request.parameters.url).getBlob();
var resource = {
title: imageBlob.getName(),
mimeType: imageBlob.getContentType()
};
var options = {
ocr: true
};
@miura
miura / TurboRegMacro.ijm
Created September 17, 2012 11:45 — forked from schiklen/TurboRegMacro.ijm
Using TurboReg from ImageJ macro, to output shifts.
var npos = 0; // this variable is better be global.
var directapply = 0; // "boolean" user input direct application of driftcorrect
var crop = 0; // "boolean" user input crop to ROI
var splitch = 0; // "boolean" user input splitting of channels
var targetstack = 1 // ImageID of the stack that is to be processed
var dir;
var cropxmax = 0;
var cropymax = 0;
var minout = 0;
var maxout = 0;
@miura
miura / FRET MAP
Last active December 9, 2016 21:30 — forked from PMLLancao/FRET MAP
Calculation for FRET Maps.
macro "Ratiometric FRET" {
path = getDirectory("Choose a Directory");
list = getFileList(path);
length = list.length;
File.makeDirectory(path + "Imaging/");
//FRET map creation
@miura
miura / gist:6e0682c73e732426c699a5842c0101ce
Created July 14, 2016 11:59
`fiji --headless test.py` error
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=128m; support was removed in 8.0
Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release
error importing site
Traceback (most recent call last):
File "/Users/miura/.m2/repository/org/scijava/jython-shaded/2.5.3/jython-shaded-2.5.3.jar/site$py.class", line 62, in <module>
File "/Users/miura/.m2/repository/org/scijava/jython-shaded/2.5.3/jython-shaded-2.5.3.jar/os$py.class", line 50, in <module>
java.lang.ArrayIndexOutOfBoundsException: 8
at org.python.objectweb.asm.ClassReader.a(Unknown Source)
at org.python.objectweb.asm.ClassReader.accept(Unknown Source)
at org.python.objectweb.asm.ClassReader.accept(Unknown Source)
run("Blobs (25K)");
run("Radial Profile Angle",
"x_center=127.50 y_center=127.50 radius=127.50 starting_angle=0 integration_angle=180");
run("Clear Results");
for(j = 0; j < Ext.getBinSize; j++){
setResult("Radius", j, Ext.getXValue(j));
setResult("Intensity", j, Ext.getYValue(0, j));
}
updateResults();
saveAs("results", "");
$cd ~/Applications/IBM/ILOG/CPLEX_Studio1251/concert/lib/x86-64_osx/static_pic
$g++ -fpic -shared -Wl,-all_load libconcert.a -Wl,-noall_load -o libconcert.dylib
ld: warning: option -noall_load is obsolete and being ignored
$cd ~/Applications/IBM/ILOG/CPLEX_Studio1251/cplex/lib/x86-64_osx/static_pic
$g++ -fpic -shared -Wl,-all_load libcplex.a -Wl,-noall_load -o libcplex.dylib
ld: warning: option -noall_load is obsolete and being ignored
$g++ -fpic -shared -Wl,-all_load libilocplex.a -Wl,-noall_load -L.:../../../../concert/lib/x86-64_osx/static_pic -lcplex -lconcert -o libilocplex.dylib
ld: warning: option -noall_load is obsolete and being ignored
@miura
miura / log20140122.txt
Created January 22, 2014 12:57
error log of g++ -fpic -shared -Wl,-all_load libilocplex.a -Wl,-noall_load -o libilocplex.dylib
ld: warning: option -noall_load is obsolete and being ignored
Undefined symbols for architecture x86_64:
"_CPXEaddabs", referenced from:
IloCplexI::addAbs(IloExtractableI const*, int*, int*, char const*) in libilocplex.a(ilocplex.o)
"_CPXEaddindconstr", referenced from:
IloCplexI::addIndicator(IloExtractableI const*, int*, double, int, IloCarray<int*> const&, IloCarray<double> const&) in libilocplex.a(ilocplex.o)
"_CPXEaddmaxexpr", referenced from:
IloCplexI::addMax(IloExtractableI const*, int*, IloCarray<int*> const&, double, char const*) in libilocplex.a(ilocplex.o)
"_CPXEaddminexpr", referenced from:
IloCplexI::addMin(IloExtractableI const*, int*, IloCarray<int*> const&, double, char const*) in libilocplex.a(ilocplex.o)
from de.embl.cmci.radial import RadialProfile
def radMeasure(rp, rt, slicenum):
imp.setSlice(slicenum)
rp.doit(imp, "")
data = rp.getAccumulator()
for d in data:
print d
index = data[0]
intensity = data[1]
t1 = System.currentTimeMillis()
imp = IJ.getImage()
imps = ChannelSplitter.split(imp)
ch1A = imps[0].getProcessor().convertToFloat().getPixels()
ch2A = imps[1].getProcessor().convertToFloat().getPixels()
t2 = System.currentTimeMillis()
min1 = min(ch1A)
max1 = max(ch1A)
min2 = min(ch2A)
max2 = max(ch2A)