作者热门文章
- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中ij.plugin.ZProjector.setStartSlice()
方法的一些代码示例,展示了ZProjector.setStartSlice()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZProjector.setStartSlice()
方法的具体详情如下:
包路径:ij.plugin.ZProjector
类名称:ZProjector
方法名:setStartSlice
暂无
代码示例来源: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: 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: 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: net.imagej/ij
int startSlice2 = startSlice;
int stopSlice2 = stopSlice;
setStartSlice((int)gd.getNextNumber());
setStopSlice((int)gd.getNextNumber());
boolean rangeChanged = startSlice!=startSlice2 || stopSlice!=stopSlice2;
代码示例来源:origin: imagej/ImageJA
int startSlice2 = startSlice;
int stopSlice2 = stopSlice;
setStartSlice((int)gd.getNextNumber());
setStopSlice((int)gd.getNextNumber());
boolean rangeChanged = startSlice!=startSlice2 || stopSlice!=stopSlice2;
代码示例来源:origin: sc.fiji/Image_5D
new ImagePlus(imp.getTitle() + " Projection", i5d.getStack());
final ZProjector zp = new ZProjector(tempImg);
zp.setStartSlice(startSlice);
zp.setStopSlice(stopSlice);
zp.setMethod(method);
代码示例来源:origin: sc.fiji/Image_5D
new ImagePlus(imp.getTitle() + " Projection", i5d.getStack());
final ZProjector zp = new ZProjector(tempImg);
zp.setStartSlice(startSlice);
zp.setStopSlice(stopSlice);
zp.setMethod(method);
本文整理了Java中ij.plugin.ZProjector.setStartSlice()方法的一些代码示例,展示了ZProjector.setStartSlice()的具体用法。这些代码示例主要来
我是一名优秀的程序员,十分优秀!