This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
macro"drawGrids"{ | |
newImage("Untitled", "8-bit black", 400, 400, 1); | |
y1=0; | |
y2=399; | |
setColor("white"); | |
setLineWidth(1); | |
for (x1=20;x1<400;x1+=20){ | |
drawLine(x1,y1,x1,y2); | |
} | |
x2=0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
macro "grid_perp" { | |
width = getNumber("width?",400); | |
height = getNumber("height?",400); | |
factor = getNumber("how many lines?",10) | |
newImage("grid", "8-bit black", width, height, 1); | |
setColor("white"); | |
for (i = width/factor; i < width; i+=width/factor) | |
drawLine(i, 0, i, height); | |
for (i = width/factor; i < height; i+=height/factor) | |
drawLine(0, i, width, i); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from ij.plugin import ChannelSplitter as CS | |
imp = IJ.getImage() | |
chs = CS.split(imp) | |
for aimp in chs: | |
aimp.show() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
macro "delete even frames" { | |
for (i=2; i<=nSlices; i++) { | |
setSlice(i); | |
run("Delete Slice"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Gtitle = "map"; | |
var Rtitle = "nuc"; | |
twoImageChoice(); | |
selectWindow(Rtitle); | |
//makeLine(0, 0, 0, 0); | |
run("Gaussian Blur...", "sigma=0.75 scaled stack"); | |
//setAutoThreshold("IsoData dark"); | |
//setOption("BlackBackground", false); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fiji.threshold import Auto_Local_Threshold as ALT | |
# nucleus selection | |
#imp = IJ.getImage() | |
imp = IJ.openImage("/Users/miyanari/Desktop/EMBL_with Kota/FISH_data/DNA-FISH_Demo.tif") | |
#IJ.run(imp, "Split Channels", "") | |
imps = ChannelSplitter.split(imp) | |
nucimp = imps[0] | |
#nucimp.show() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
imp = IJ.getImage() | |
midslice = int(imp.getStackSize() / 2) | |
imp.setSlice(midslice) | |
#IJ.setThreshold(-50, -0.62) | |
ip.setAutoThreshold(AutoThresholder.Method.Default, False) | |
IJ.setThreshold(ip.getMinThreshold(), ip.getMaxThreshold()) | |
print ip.getMaxThreshold() | |
print ip.getMinThreshold() | |
#th = ip.getMaxThreshold() | |
IJ.run("Convert to Mask", "method=Default background=Light black") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def floatStackThresholder(ip, pix, th): | |
for i in range(pix): | |
if ip.get(i) > th: | |
ip.setf(i, 255.0) | |
else: | |
ip.setf(i, 0.0) | |
ip = ip.convertToByte(False) | |
return ip | |
imp = IJ.getImage() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def stacklistGenerate(imp): | |
stk = imp.getStack() | |
imglist = [] | |
print len(imglist) | |
for i in range(imp.getStackSize()): | |
ip = stk.getProcessor(i+1) | |
title = "img" + str(i+1) | |
impsingle = ImagePlus(title, ip.duplicate()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Opens series of .lsm files as a single hyperstack | |
20130712 Kota Miura (cmci.embl.de) | |
Choose a file among the file series, and this script searchs all the | |
files with a pattern | |
(basename)_R(fixed)_GR(.*)_B(block number)_L(location number)\.lsm |