本文整理了Java中ij.plugin.ZProjector.<init>()
方法的一些代码示例,展示了ZProjector.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZProjector.<init>()
方法的具体详情如下:
包路径:ij.plugin.ZProjector
类名称:ZProjector
方法名:<init>
[英]Construction of ZProjector with image to be projected.
[中]带图像投影的ZP投影仪的构造。
代码示例来源: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
final ZProjector zp = new ZProjector();
zp.setImage(imagePlus);
zp.setMethod(ZProjector.MAX_METHOD);
代码示例来源: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 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: sc.fiji/Trainable_Segmentation
final ZProjector zp = new ZProjector(projectStack);
zp.setStopSlice(is.getSize());
for (int i=1;i<=2; i++)
代码示例来源: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: fiji/Trainable_Segmentation
final ZProjector zp = new ZProjector(projectStack);
zp.setStopSlice(is.getSize());
for (int i=1;i<=2; i++)
代码示例来源:origin: sc.fiji/Trainable_Segmentation
final ZProjector zp = new ZProjector(projectStack);
zp.setStopSlice(is.getSize());
for (int i=1;i<=2; 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
final ZProjector zp = new ZProjector(projectStack);
zp.setStopSlice(is.getSize());
for (int i=1;i<=2; 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
ZProjector zp = new ZProjector(projectStack);
zp.setStopSlice(is.getSize());
for (int i=0;i<6; i++){
代码示例来源:origin: sc.fiji/Trainable_Segmentation
ZProjector zp = new ZProjector(projectStack);
zp.setStopSlice(is.getSize());
for (int i=0;i<6; i++){
代码示例来源:origin: fiji/Trainable_Segmentation
ZProjector zp = new ZProjector(projectStack);
zp.setStopSlice(is.getSize());
for (int i=0;i<6; i++){
代码示例来源:origin: sc.fiji/Trainable_Segmentation
ZProjector zp = new ZProjector(projectStack);
zp.setStopSlice(is.getSize());
for (int i=0;i<6; i++){
代码示例来源:origin: sc.fiji/Image_5D
final ImagePlus tempImg =
new ImagePlus(imp.getTitle() + " Projection", i5d.getStack());
final ZProjector zp = new ZProjector(tempImg);
zp.setStartSlice(startSlice);
zp.setStopSlice(stopSlice);
代码示例来源:origin: sc.fiji/Image_5D
final ImagePlus tempImg =
new ImagePlus(imp.getTitle() + " Projection", i5d.getStack());
final ZProjector zp = new ZProjector(tempImg);
zp.setStartSlice(startSlice);
zp.setStopSlice(stopSlice);
内容来源于网络,如有侵权,请联系作者删除!