本文整理了Java中ij.plugin.ZProjector
类的一些代码示例,展示了ZProjector
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZProjector
类的具体详情如下:
包路径:ij.plugin.ZProjector
类名称:ZProjector
[英]This plugin performs a z-projection of the input stack. Type of output image is same as type of input image.
[中]这个插件执行输入堆栈的z投影。输出图像的类型与输入图像的类型相同。
代码示例来源:origin: ca.mcgill/Sholl_Analysis
private ImageProcessor projImp() {
ImageProcessor ip;
final ZProjector zp = new ZProjector(imp);
zp.setMethod(ZProjector.MAX_METHOD);
zp.setStartSlice(minZ);
zp.setStopSlice(maxZ);
if (imp.isComposite()) {
zp.doHyperStackProjection(false);
final ImagePlus projImp = zp.getProjection();
projImp.setC(channel);
ip = projImp.getChannelProcessor();
} else {
zp.doProjection();
ip = zp.getProjection().getProcessor();
}
return ip;
}
代码示例来源:origin: net.imagej/ij
/** Construction of ZProjector with image to be projected. */
public ZProjector(ImagePlus imp) {
setImage(imp);
}
代码示例来源:origin: net.imagej/ij
private ImagePlus mergeUsingRGBProjection(ImagePlus[] images, boolean createComposite) {
ImageStack stack = new ImageStack(imp.getWidth(),imp.getHeight());
for (int i=0; i<images.length; i++) {
if (images[i]!=null)
stack.addSlice(images[i].getProcessor());
}
ImagePlus imp2 = new ImagePlus("temp", stack);
ZProjector zp = new ZProjector(imp2);
zp.setMethod(ZProjector.MAX_METHOD);
zp.doRGBProjection();
imp2 = zp.getProjection();
if (createComposite) {
imp2 = CompositeConverter.makeComposite(imp2);
imp2.setTitle("Composite");
} else
imp2.setTitle("RGB");
return imp2;
}
代码示例来源:origin: net.imagej/ij
public void doRGBProjection(boolean handleOverlay) {
doRGBProjection(imp.getStack());
Overlay overlay = imp.getOverlay();
if (handleOverlay && overlay!=null)
projImage.setOverlay(projectRGBHyperStackRois(overlay));
}
代码示例来源:origin: net.imagej/ij
/** Performs actual projection using specified method.
If handleOverlay, adds stack overlay
elements from startSlice to stopSlice to projection. */
public void doProjection(boolean handleOverlay) {
if (isHyperstack)
doHyperStackProjection(allTimeFrames);
else if (imp.getType()==ImagePlus.COLOR_RGB)
doRGBProjection(handleOverlay);
else {
doProjection();
Overlay overlay = imp.getOverlay();
if (handleOverlay && overlay!=null)
projImage.setOverlay(projectStackRois(overlay));
}
if (projImage!=null)
projImage.setCalibration(imp.getCalibration());
}
代码示例来源:origin: sc.fiji/Simple_Neurite_Tracer
final ZProjector zp = new ZProjector();
zp.setImage(imagePlus);
zp.setMethod(ZProjector.MAX_METHOD);
zp.doProjection();
final ImagePlus overlay = zp.getProjection();
代码示例来源:origin: imagej/ImageJA
setDefaultBounds();
GenericDialog gd = buildControlDialog(startSlice,stopSlice);
gd.showDialog();
if (gd.wasCanceled()) return;
int startSlice2 = startSlice;
int stopSlice2 = stopSlice;
setStartSlice((int)gd.getNextNumber());
setStopSlice((int)gd.getNextNumber());
boolean rangeChanged = startSlice!=startSlice2 || stopSlice!=stopSlice2;
startSlice2 = startSlice;
if (isHyperstack)
allTimeFrames = imp.getNFrames()>1&&imp.getNSlices()>1?gd.getNextBoolean():false;
doProjection(true);
IJ.register(ZProjector.class);
if (Recorder.scriptMode()) {
String m = getMethodAsString();
if (isHyperstack && allTimeFrames)
m = m + " all";
代码示例来源:origin: imagej/ImageJA
stopSlice = (frame-1)*channels*slices + (stop-1)*channels + channel;
if (rgb)
doHSRGBProjection(imp);
else
doProjection();
stack.addSlice(null, projImage.getProcessor());
projImage = new ImagePlus(makeTitle(), stack);
projImage.setDimensions(channels, 1, frames);
if (channels>1) {
stopSlice = stop;
if (imp.getType()==ImagePlus.COLOR_RGB)
projImage.setOverlay(projectRGBHyperStackRois(overlay));
else
projImage.setOverlay(projectHyperStackRois(overlay));
代码示例来源:origin: net.imagej/ij
public void run(String arg) {
ImagePlus imp = IJ.getImage();
int size = imp.getStackSize();
if (size==1) {
IJ.error("Z Project", "This command requires a stack");
return;
}
if (imp.isHyperStack()) {
new ZProjector().run("");
return;
}
if (!showDialog(imp))
return;
ImagePlus imp2 = groupZProject(imp, method, groupSize);
imp2.setCalibration(imp.getCalibration());
Calibration cal = imp2.getCalibration();
cal.pixelDepth *= groupSize;
if (imp!=null)
imp2.show();
}
代码示例来源:origin: net.imagej/ij
ImagePlus saveImp = imp;
imp = red;
color = "(red)"; doProjection();
ImagePlus red2 = projImage;
imp = green;
color = "(green)"; doProjection();
ImagePlus green2 = projImage;
imp = blue;
color = "(blue)"; doProjection();
ImagePlus blue2 = projImage;
int w = red2.getWidth(), h = red2.getHeight(), d = red2.getStackSize();
ImageStack stack2 = merge.mergeStacks(w, h, d, red2.getStack(), green2.getStack(), blue2.getStack(), true);
imp = saveImp;
projImage = new ImagePlus(makeTitle(), stack2);
代码示例来源:origin: imagej/ImageJA
return;
if (imp.getBitDepth()==24) {
doRGBProjection();
return;
sliceCount++;
if (method==MEDIAN_METHOD) {
projImage = doMedianProjection();
return;
RayFunction rayFunc = getRayFunction(method, fp);
if (IJ.debugMode==true) {
IJ.log("\nProjecting stack from: "+startSlice
projectSlice(stack.getPixels(n), rayFunc, ptype);
sliceCount++;
fp.subtract(sliceCount*32768.0);
fp.resetMinAndMax();
projImage = new ImagePlus(makeTitle(), fp);
} else if (method==SD_METHOD) {
rayFunc.postProcess();
fp.resetMinAndMax();
projImage = new ImagePlus(makeTitle(), fp);
} else {
rayFunc.postProcess();
projImage = makeOutputImage(imp, fp, ptype);
代码示例来源:origin: net.imagej/ij
public void doRGBProjection() {
doRGBProjection(imp.getStack());
}
代码示例来源:origin: fiji/Stitching
private ArrayList<OverlapProperties> findOverlappingTiles(final ArrayList<ImageInformation> imageInformationList, final boolean createPreview, final String fusionMethod)
final ZProjector zp = new ZProjector();
zp.setMethod(ZProjector.MAX_METHOD);
zp.setImage(iI.imp);
if (iI.imp.getType() == ImagePlus.COLOR_RGB || iI.imp.getType() == ImagePlus.COLOR_256)
zp.doRGBProjection();
iI.maxIntensity = zp.getProjection();
iI.maxIntensity.setProcessor(iI.maxIntensity.getTitle(), iI.maxIntensity.getProcessor().convertToFloat());
zp.doProjection();
iI.maxIntensity = zp.getProjection();
iI.maxIntensity.setProcessor(iI.maxIntensity.getTitle(), iI.maxIntensity.getProcessor().convertToFloat());
代码示例来源:origin: net.imagej/ij
setDefaultBounds();
GenericDialog gd = buildControlDialog(startSlice,stopSlice);
gd.showDialog();
if (gd.wasCanceled()) return;
int startSlice2 = startSlice;
int stopSlice2 = stopSlice;
setStartSlice((int)gd.getNextNumber());
setStopSlice((int)gd.getNextNumber());
boolean rangeChanged = startSlice!=startSlice2 || stopSlice!=stopSlice2;
startSlice2 = startSlice;
if (isHyperstack)
allTimeFrames = imp.getNFrames()>1&&imp.getNSlices()>1?gd.getNextBoolean():false;
doProjection(true);
IJ.register(ZProjector.class);
if (Recorder.scriptMode()) {
String m = getMethodAsString();
if (isHyperstack && allTimeFrames)
m = m + " all";
代码示例来源:origin: imagej/ImageJA
/** Performs actual projection using specified method.
If handleOverlay, adds stack overlay
elements from startSlice to stopSlice to projection. */
public void doProjection(boolean handleOverlay) {
if (isHyperstack)
doHyperStackProjection(allTimeFrames);
else if (imp.getType()==ImagePlus.COLOR_RGB)
doRGBProjection(handleOverlay);
else {
doProjection();
Overlay overlay = imp.getOverlay();
if (handleOverlay && overlay!=null)
projImage.setOverlay(projectStackRois(overlay));
}
if (projImage!=null)
projImage.setCalibration(imp.getCalibration());
}
代码示例来源:origin: net.imagej/ij
stopSlice = (frame-1)*channels*slices + (stop-1)*channels + channel;
if (rgb)
doHSRGBProjection(imp);
else
doProjection();
stack.addSlice(null, projImage.getProcessor());
projImage = new ImagePlus(makeTitle(), stack);
projImage.setDimensions(channels, 1, frames);
if (channels>1) {
stopSlice = stop;
if (imp.getType()==ImagePlus.COLOR_RGB)
projImage.setOverlay(projectRGBHyperStackRois(overlay));
else
projImage.setOverlay(projectHyperStackRois(overlay));
代码示例来源:origin: imagej/ImageJA
public void run(String arg) {
ImagePlus imp = IJ.getImage();
int size = imp.getStackSize();
if (size==1) {
IJ.error("Z Project", "This command requires a stack");
return;
}
if (imp.isHyperStack()) {
new ZProjector().run("");
return;
}
if (!showDialog(imp))
return;
ImagePlus imp2 = groupZProject(imp, method, groupSize);
imp2.setCalibration(imp.getCalibration());
Calibration cal = imp2.getCalibration();
cal.pixelDepth *= groupSize;
if (imp!=null)
imp2.show();
}
代码示例来源:origin: imagej/ImageJA
ImagePlus saveImp = imp;
imp = red;
color = "(red)"; doProjection();
ImagePlus red2 = projImage;
imp = green;
color = "(green)"; doProjection();
ImagePlus green2 = projImage;
imp = blue;
color = "(blue)"; doProjection();
ImagePlus blue2 = projImage;
int w = red2.getWidth(), h = red2.getHeight(), d = red2.getStackSize();
ImageStack stack2 = merge.mergeStacks(w, h, d, red2.getStack(), green2.getStack(), blue2.getStack(), true);
imp = saveImp;
projImage = new ImagePlus(makeTitle(), stack2);
代码示例来源:origin: net.imagej/ij
return;
if (imp.getBitDepth()==24) {
doRGBProjection();
return;
sliceCount++;
if (method==MEDIAN_METHOD) {
projImage = doMedianProjection();
return;
RayFunction rayFunc = getRayFunction(method, fp);
if (IJ.debugMode==true) {
IJ.log("\nProjecting stack from: "+startSlice
projectSlice(stack.getPixels(n), rayFunc, ptype);
sliceCount++;
fp.subtract(sliceCount*32768.0);
fp.resetMinAndMax();
projImage = new ImagePlus(makeTitle(), fp);
} else if (method==SD_METHOD) {
rayFunc.postProcess();
fp.resetMinAndMax();
projImage = new ImagePlus(makeTitle(), fp);
} else {
rayFunc.postProcess();
projImage = makeOutputImage(imp, fp, ptype);
代码示例来源:origin: imagej/ImageJA
public void doRGBProjection(boolean handleOverlay) {
doRGBProjection(imp.getStack());
Overlay overlay = imp.getOverlay();
if (handleOverlay && overlay!=null)
projImage.setOverlay(projectRGBHyperStackRois(overlay));
}
内容来源于网络,如有侵权,请联系作者删除!