# # This example Jython script shows how to # reslice an image in the GPU. # # # Author: Robert Haase, [email protected] # October 2019 ########################################## from net.haesleinhuepf.clij import CLIJ; from ij import IJ; IJ.run("Close All"); # init CLIJ and GPU clij = CLIJ.getInstance(); # get an example data set imp = IJ.openImage("http://imagej.nih.gov/ij/images/t1-head.zip"); imp.show(); imp.setRoi(86,3,100,250); imp = imp.crop("25-74"); imp.show(); # push it to the GPU src = clij.push(imp); # generate the output-image on the GPU with thee right size dst = clij.create([src.getWidth(), src.getDepth(), src.getHeight()], src.getNativeType()); # Reslice on GPU clij.op().resliceTop(src, dst);
# load single image #imp = IJ.openImage("C:/structure/data/florence/000300.raw.tif"); #IJ.run(imp, "32-bit", ""); #imp.show(); # load sequence IJ.run("Image Sequence...", "open=[" + data_folder + "] sort use") IJ.run( "Stack to Hyperstack...", "order=xyczt(default) channels=1 slices=" + str(number_of_z_planes) + " frames=" + str(number_of_images) + " display=Color") imp = IJ.getImage() # init GPU clij = CLIJ.getInstance("1070") # configure initial scaling step calib = imp.getCalibration() scaleX = calib.pixelWidth / calib.pixelDepth * zoom scaleY = calib.pixelHeight / calib.pixelDepth * zoom scaleZ = 1.0 * zoom # initialize state input = None formerT = None resultCylinderMaxProjection = None resultMaxProjection = None spots = None circles = None blobs = None