Skip to content

Instantly share code, notes, and snippets.

from ij import ImagePlus, IJ
from emblcmci import BleachCorrection
url = "/home/miura/yeastNucleus2DT.tif"
imp = ImagePlus(url)
print imp.getStackSize()
bc = BleachCorrection()
### simple rtio method
{
"WFE_output_params_file": "wfe_module_params_1.json",
"3d_image_stack" : "/input/Skeleton.tif",
"prune_cycle_method": "shortest branch",
"prune_ends": false
}
// ImageJ macro
//*** change the window title here, depending on your input image.
OriginalTitle = "BloodVessels_small.tif";
// following window titles are always same.
LabelMask = "FastFiltered_Tubeness_LabelMask.tif";
tagged = "FastFiltered_Tubeness_LabelMask_Skeleton_tagged_skeleton.tif";
VisualisationDilation = 2;
Nthreads = 4;
\lstdefinelanguage{IJM}{%
language = Java,
morekeywords = {var, macro, return, function, get, set, is,
abs, acos, Array, asin, atan, atan2, autoUpdate, beep, bitDepth, calibrate, call, changeValues, charCodeAt, close, cos, d2s, debug, Dialog, doCommand, doWand, drawLine, drawOval, drawRect, drawString, dump, endsWith, eval, exec, exit, exp, File, fill, fillOval, fillRect, Fit, floodFill, floor, fromCharCode, getArgument, getBoolean, getBoundingRect, getCursorLoc, getDateAndTime, getDimensions, getDirectory, getDir, getDisplayedArea, getFileList, getFontList, getHeight, getHistogram, getImageID, getImageInfo, getInfo, getLine, getList, getLocationAndSize, getLut, getMetadata, getMinAndMax, getNumber, getPixel, getPixelSize, getProfile, getRawStatistics, getResult, getResultString, getResultLabel, getSelectionBounds, getSelectionCoordinates, getSliceNumber, getStatistics, getString, getStringWidth, getThreshold, getTime, getTitle, getValue, getVoxelSize, getVersion, getWidth, getZoom, IJ, imageCalcul
//20200909 Kota Miura
// temporal colorcode fix
testpath = "/Users/miura/Desktop/tmp/rewritemacro/Temporal-Color_Code.ijm";
ijmpath = testpath;
ijpluginDir = getDir("plugins");
thefile = ijpluginDir + "Scripts/Image/Hyperstacks/Temporal-Color_Code.ijm";
ijmpath = thefile;
// @ImagePlus(label="Skeleton image", description="Binary image skeletonized with Skeletonize3D") image
// @double(label="Length threshold", description="Minimum branch length to keep") threshold
// @OUTPUT ImagePlus prunedImage
// https://forum.image.sc/t/skeletonize-remove-or-prune-short-end-segments/4704
import sc.fiji.analyzeSkeleton.AnalyzeSkeleton_;
import sc.fiji.analyzeSkeleton.Edge;
import sc.fiji.analyzeSkeleton.Point;
import ij.IJ;
@miura
miura / IJ macro course codes
Last active May 9, 2019 10:22
IJ macro course codes
//variables
a = 1;
b = 2;
c = a + b;
print("\\Clear");
print( c );
print(a, "+", b, "=", c);
//variables, exercise, an example answer
a = 1;
@miura
miura / settings.local.php
Last active October 26, 2021 07:19
template settings local file for bise.
<?php
/** database settings
**/
//$databases['default']['default'] = [
// 'database' => getenv('MYSQL_DATABASE'),
// 'driver' => 'mysql',
// 'host' => getenv('MYSQL_HOSTNAME'),
// 'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
/* 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
};