This file contains hidden or 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 | |
from ij.gui import Roi | |
from imagescience.image import Image | |
from imagescience.feature import Laplacian | |
from process3d import Erode_, Dilate_, MinMaxMedian | |
from process3d import DistanceTransform3D as D3D | |
from Utilities import Counter3D | |
from ij.plugin import Thresholder, GaussianBlur3D, ZProjector, Duplicator | |
from ij.process import ImageProcessor | |
import os, csv |
This file contains hidden or 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
''' | |
writing data to a csv file. | |
''' | |
import os, csv | |
# prepare test data to wirte to a csv file | |
data1 = range(10) | |
data2 = [x * x for x in data1] | |
data3 = [pow(x, 3) for x in data1] | |
print data3 |
This file contains hidden or 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
''' | |
loading multiple tif files and store them in a list. | |
''' | |
import os | |
from ij import IJ | |
from ij.io import DirectoryChooser | |
def run(): | |
srcDir = DirectoryChooser("Choose!").getDirectory() | |
IJ.log("directory: "+srcDir) |
This file contains hidden or 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 | |
from ij.gui import Roi | |
from imagescience.image import Image | |
from imagescience.feature import Laplacian | |
from process3d import Erode_, Dilate_, MinMaxMedian | |
from process3d import DistanceTransform3D as D3D | |
from Utilities import Counter3D | |
from ij.plugin import Thresholder, GaussianBlur3D, ZProjector, Duplicator | |
from ij.process import ImageProcessor |
This file contains hidden or 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 hidden or 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 hidden or 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 process3d import Dilate_ | |
imp = IJ.getImage() | |
#IJ.run(imp, "Erode (3D)", "iso=255") | |
dil = Dilate_() | |
dilimp = dil.dilate(imp, 255, True) | |
dilimp.show() |
This file contains hidden or 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 process3d import Erode_ | |
imp = IJ.getImage() | |
#IJ.run(imp, "Erode (3D)", "iso=255") | |
er = Erode_() | |
ip = imp.getProcessor() | |
erimp = er.erode(imp, 255, True) | |
erimp.show() | |
This file contains hidden or 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 imagescience.image import Image | |
from imagescience.feature import Laplacian | |
imp = IJ.getImage() | |
#fjimp = FJ_Laplacian() | |
img = Image.wrap(imp) | |
lap =Laplacian() | |
lapimg = lap.run(img, 2.0) | |
lapimp = lapimg.imageplus() | |
lapimp.show() |
This file contains hidden or 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 process3d import MinMaxMedian | |
imp = IJ.getImage() | |
#mmm = MinMaxMedian() | |
medimp = MinMaxMedian.convolve(imp, MinMaxMedian.MEDIAN) | |
medimp.show() |
NewerOlder