gpt4 book ai didi

ij.plugin.ZProjector.setMethod()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-15 04:27:31 29 4
gpt4 key购买 nike

本文整理了Java中ij.plugin.ZProjector.setMethod()方法的一些代码示例,展示了ZProjector.setMethod()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZProjector.setMethod()方法的具体详情如下:
包路径:ij.plugin.ZProjector
类名称:ZProjector
方法名:setMethod

ZProjector.setMethod介绍

暂无

代码示例

代码示例来源:origin: net.imagej/ij

/** Performs projection using the specified method and stack range, and returns
   the result, where 'method' is "avg", "min", "max", "sum", "sd" or "median".
  Add " all" to 'method' to project all hyperstack time points. <br>
  Example: http://imagej.nih.gov/ij/macros/js/ProjectionDemo.js
*/
 public static ImagePlus run(ImagePlus imp, String method, int startSlice, int stopSlice) {
  ZProjector zp = new ZProjector(imp);
  zp.setStartSlice(startSlice);
  zp.setStopSlice(stopSlice);
  zp.isHyperstack = imp.isHyperStack();
  if (zp.isHyperstack && startSlice==1 && stopSlice==imp.getStackSize())
    zp.setDefaultBounds();
  if (method==null) return null;
  method = method.toLowerCase();
  int m = -1;
  if (method.startsWith("av")) m = AVG_METHOD;
  else if (method.startsWith("max")) m = MAX_METHOD;
  else if (method.startsWith("min")) m = MIN_METHOD;
  else if (method.startsWith("sum")) m = SUM_METHOD;
  else if (method.startsWith("sd")) m = SD_METHOD;
  else if (method.startsWith("median")) m = MEDIAN_METHOD;
  if (m<0)
    throw new IllegalArgumentException("Invalid projection method: "+method);
  zp.allTimeFrames = method.contains("all");
  zp.setMethod(m);
  zp.doProjection(true);
  return zp.getProjection();
}

代码示例来源:origin: imagej/ImageJA

/** Performs projection using the specified method and stack range, and returns
   the result, where 'method' is "avg", "min", "max", "sum", "sd" or "median".
  Add " all" to 'method' to project all hyperstack time points. <br>
  Example: http://imagej.nih.gov/ij/macros/js/ProjectionDemo.js
*/
 public static ImagePlus run(ImagePlus imp, String method, int startSlice, int stopSlice) {
  ZProjector zp = new ZProjector(imp);
  zp.setStartSlice(startSlice);
  zp.setStopSlice(stopSlice);
  zp.isHyperstack = imp.isHyperStack();
  if (zp.isHyperstack && startSlice==1 && stopSlice==imp.getStackSize())
    zp.setDefaultBounds();
  if (method==null) return null;
  method = method.toLowerCase();
  int m = -1;
  if (method.startsWith("av")) m = AVG_METHOD;
  else if (method.startsWith("max")) m = MAX_METHOD;
  else if (method.startsWith("min")) m = MIN_METHOD;
  else if (method.startsWith("sum")) m = SUM_METHOD;
  else if (method.startsWith("sd")) m = SD_METHOD;
  else if (method.startsWith("median")) m = MEDIAN_METHOD;
  if (m<0)
    throw new IllegalArgumentException("Invalid projection method: "+method);
  zp.allTimeFrames = method.contains("all");
  zp.setMethod(m);
  zp.doProjection(true);
  return zp.getProjection();
}

代码示例来源:origin: sc.fiji/Simple_Neurite_Tracer

zp.setMethod(ZProjector.MAX_METHOD);
zp.doProjection();
final ImagePlus overlay = zp.getProjection();

代码示例来源:origin: fiji/Stitching

zp.setMethod(ZProjector.MAX_METHOD);
zp.setImage(iI.imp);
if (iI.imp.getType() == ImagePlus.COLOR_RGB || iI.imp.getType() == ImagePlus.COLOR_256)

代码示例来源: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

public ImagePlus groupZProject(ImagePlus imp, int method, int groupSize) {
  if (method<0 || method>=ZProjector.METHODS.length)
    return null;
  int[] dim = imp.getDimensions();
  int projectedStackSize = imp.getStackSize()/groupSize;
  imp.setDimensions(1, groupSize, projectedStackSize);
  ZProjector zp = new ZProjector(imp);
  zp.setMethod(method);
  zp.setStartSlice(1);
  zp.setStopSlice(groupSize);
  zp.doHyperStackProjection(true);
  imp.setDimensions(dim[2], dim[3], dim[4]);
  ImagePlus zProjectorOutput = zp.getProjection();
  int[] zProjectDim = zProjectorOutput.getDimensions();
  for (int i=2; i<dim.length; i++) {
    if (dim[i] != 1)
      zProjectDim[i] = projectedStackSize;
    else
      zProjectDim[i] = 1;
  }
  // Fix dimensions for output ImagePlus
  zProjectorOutput.setDimensions(zProjectDim[2], zProjectDim[3], zProjectDim[4]);
  return zProjectorOutput;
}

代码示例来源:origin: sc.fiji/Trainable_Segmentation

for (int i=1;i<=2; i++)
  zp.setMethod(i);
  zp.doProjection();
  resultStack.addSlice(availableFeatures[GABOR] + "_" + i

代码示例来源:origin: fiji/Trainable_Segmentation

for (int i=1;i<=2; i++)
  zp.setMethod(i);
  zp.doProjection();
  resultStack.addSlice(availableFeatures[GABOR] + "_" + i

代码示例来源:origin: sc.fiji/Trainable_Segmentation

for (int i=1;i<=2; i++)
  zp.setMethod(i);
  zp.doProjection();
  resultStack.addSlice(availableFeatures[GABOR] + "_" + i

代码示例来源: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: fiji/Trainable_Segmentation

for (int i=1;i<=2; i++)
  zp.setMethod(i);
  zp.doProjection();
  resultStack.addSlice(availableFeatures[GABOR] + "_" + i

代码示例来源:origin: imagej/ImageJA

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: imagej/ImageJA

public ImagePlus groupZProject(ImagePlus imp, int method, int groupSize) {
  if (method<0 || method>=ZProjector.METHODS.length)
    return null;
  int[] dim = imp.getDimensions();
  int projectedStackSize = imp.getStackSize()/groupSize;
  imp.setDimensions(1, groupSize, projectedStackSize);
  ZProjector zp = new ZProjector(imp);
  zp.setMethod(method);
  zp.setStartSlice(1);
  zp.setStopSlice(groupSize);
  zp.doHyperStackProjection(true);
  imp.setDimensions(dim[2], dim[3], dim[4]);
  ImagePlus zProjectorOutput = zp.getProjection();
  int[] zProjectDim = zProjectorOutput.getDimensions();
  for (int i=2; i<dim.length; i++) {
    if (dim[i] != 1)
      zProjectDim[i] = projectedStackSize;
    else
      zProjectDim[i] = 1;
  }
  // Fix dimensions for output ImagePlus
  zProjectorOutput.setDimensions(zProjectDim[2], zProjectDim[3], zProjectDim[4]);
  return zProjectorOutput;
}

代码示例来源:origin: fiji/Trainable_Segmentation

zp.setStopSlice(is.getSize());
for (int i=0;i<6; i++){
  zp.setMethod(i);
  zp.doProjection();
  membraneStack.addSlice(availableFeatures[MEMBRANE] + "_" +i+"_"+patchSize+"_"+membraneSize, zp.getProjection().getChannelProcessor());

代码示例来源:origin: sc.fiji/Trainable_Segmentation

zp.setStopSlice(is.getSize());
for (int i=0;i<6; i++){
  zp.setMethod(i);
  zp.doProjection();
  membraneStack.addSlice(availableFeatures[MEMBRANE] + "_" +i+"_"+patchSize+"_"+membraneSize, zp.getProjection().getChannelProcessor());

代码示例来源:origin: fiji/Trainable_Segmentation

zp.setStopSlice(is.getSize());
for (int i=0;i<6; i++){
  zp.setMethod(i);
  zp.doProjection();
  membraneStack.addSlice(availableFeatures[MEMBRANE] + "_" +i+"_"+patchSize+"_"+membraneSize, zp.getProjection().getChannelProcessor());

代码示例来源:origin: sc.fiji/Trainable_Segmentation

zp.setStopSlice(is.getSize());
for (int i=0;i<6; i++){
  zp.setMethod(i);
  zp.doProjection();
  membraneStack.addSlice(availableFeatures[MEMBRANE] + "_" +i+"_"+patchSize+"_"+membraneSize, zp.getProjection().getChannelProcessor());

代码示例来源:origin: sc.fiji/Image_5D

zp.setStartSlice(startSlice);
zp.setStopSlice(stopSlice);
zp.setMethod(method);
zp.doProjection();
final ImagePlus proj = zp.getProjection();

代码示例来源:origin: sc.fiji/Image_5D

zp.setStartSlice(startSlice);
zp.setStopSlice(stopSlice);
zp.setMethod(method);
zp.doProjection();
final ImagePlus proj = zp.getProjection();

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com