本文整理汇总了Java中ij.plugin.ZProjector.doProjection方法的典型用法代码示例。如果您正苦于以下问题:Java ZProjector.doProjection方法的具体用法?Java ZProjector.doProjection怎么用?Java ZProjector.doProjection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ij.plugin.ZProjector
的用法示例。
在下文中一共展示了ZProjector.doProjection方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showConvolvedImages
import ij.plugin.ZProjector; //导入方法依赖的package包/类
/**
* Debugging method to show the results of convolution
*
* @param convolved
*/
@SuppressWarnings("unused")
private void showConvolvedImages(HashMap<Integer, FloatProcessor> convolved)
{
ImageProcessor ip = convolved.get(0);
ImageStack stack = new ImageStack(ip.getWidth(), ip.getHeight());
for (int rotation : rotationAngles)
stack.addSlice("Rotation " + rotation, convolved.get(rotation));
ImagePlus imp = new ImagePlus("Membrane filter", stack);
imp.show();
// Output different projections of the results
ZProjector projector = new ZProjector(imp);
for (int projectionMethod = 0; projectionMethod < ZProjector.METHODS.length; projectionMethod++)
{
IJ.showStatus("Projecting " + ZProjector.METHODS[projectionMethod]);
projector.setMethod(projectionMethod);
projector.doProjection();
ImagePlus projImp = projector.getProjection();
projImp.show();
}
}
示例2: getBackgroundLevel
import ij.plugin.ZProjector; //导入方法依赖的package包/类
private float getBackgroundLevel(AssignedPoint[] points)
{
// Get a maximum intensity project of the image
ZProjector projector = new ZProjector(imp);
projector.setMethod(ZProjector.MAX_METHOD);
projector.doProjection();
ImageProcessor ip = projector.getProjection().getProcessor();
// Set background using the lowest currently picked point
float background = Float.POSITIVE_INFINITY;
for (AssignedPoint point : points)
{
final float v = ip.getf(point.getXint(), point.getYint());
if (background > v)
background = v;
}
// Subtract the image Std.Dev. to get a buffer for error.
ImageStatistics stats = ip.getStatistics();
background -= stats.stdDev;
return background;
}
示例3: getSkeletonizedProjection
import ij.plugin.ZProjector; //导入方法依赖的package包/类
/**
* Retrieves a MIP of skeletonized paths.
*
* @throws RuntimeException
* if called before successfully loading a file
* @return a MIP projection of an untagged skeleton (8-bit binary image)
*/
public ImageProcessor getSkeletonizedProjection() {
final ImagePlus imp = renderPathsAsSkeleton(false);
final ZProjector zp = new ZProjector(imp);
zp.setMethod(ZProjector.MAX_METHOD);
zp.setStartSlice(1);
zp.setStopSlice(imp.getNSlices());
zp.doProjection();
return zp.getProjection().getProcessor();
}
示例4: runProjection
import ij.plugin.ZProjector; //导入方法依赖的package包/类
public void runProjection(int methodProj){
IJ.showProgress((progressbar));
ZProjector zproject = new ZProjector();
zproject.setImage(rawImage.duplicate());
zproject.setMethod(methodProj);
zproject.doProjection();
projImage = zproject.getProjection();
}
示例5: getProjection
import ij.plugin.ZProjector; //导入方法依赖的package包/类
private ImageProcessor getProjection()
{
// Get median intensity projection
ZProjector p = new ZProjector(imp);
p.setMethod(ZProjector.MEDIAN_METHOD);
p.doProjection();
ImageProcessor median = p.getProjection().getProcessor();
return median;
}
示例6: runDetection
import ij.plugin.ZProjector; //导入方法依赖的package包/类
@Override
public Collection<PathObject> runDetection(final ImageData<BufferedImage> imageData, ParameterList params, ROI pathROI) {
double fullCoreDiameterPx;
ImageServer<BufferedImage> server = imageData.getServer();
if (server.hasPixelSizeMicrons())
fullCoreDiameterPx = params.getDoubleParameterValue("coreDiameterMM") / server.getAveragedPixelSizeMicrons() * 1000;
else
fullCoreDiameterPx = params.getDoubleParameterValue("coreDiameterPixels");
String horizontalLabels = params.getStringParameterValue("labelsHorizontal").trim();
String verticalLabels = params.getStringParameterValue("labelsVertical").trim();
boolean horizontalLabelFirst = params.getChoiceParameterValue("labelOrder").toString().startsWith("Column");
// TODO: Consider fluorescence mode in TMA dearraying
boolean isFluorescence = imageData.isFluorescence();
double densityThreshold = params.getIntParameterValue("densityThreshold") * 0.01;
double roiScaleFactor = params.getIntParameterValue("boundsScale") * 0.01;
logger.trace("ROI scale: " + roiScaleFactor);
double maxDimLength = Math.max(server.getWidth(), server.getHeight());
double dimRequested = 1200;
double downsample = Math.pow(2, Math.round(Math.log(maxDimLength / dimRequested)/Math.log(2)));
// // Compute alternative downsample factor based on requested pixel size
// // This is likely to be a bit more reproducible - so use it instead
// if (server.hasPixelSizeMicrons()) {
// double preferredCoreDiameterPixels = 60;
// double downsample2 = Math.round(fullCoreDiameterPx / preferredCoreDiameterPixels);
// if (downsample2 > 1 && (maxDimLength / downsample2 < dimRequested*2)) {
// downsample = downsample2;
// }
// }
// Compute alternative downsample factor based on requested pixel size
// This is likely to be a bit more reproducible - so use it instead
if (server.hasPixelSizeMicrons()) {
double preferredPixelSizeMicrons = 25;
double downsample2 = Math.round(preferredPixelSizeMicrons / server.getAveragedPixelSizeMicrons());
if (downsample2 > 1 && (maxDimLength / downsample2 < dimRequested*2))
downsample = downsample2;
}
// Read the image
PathImage<ImagePlus> pathImage = PathImagePlus.createPathImage(server, downsample);
ImagePlus imp = pathImage.getImage();
if (imp.getType() == ImagePlus.COLOR_RGB || imp.getNChannels() == 1)
ip = imp.getProcessor();
else {
ZProjector zProjector = new ZProjector(imp);
zProjector.setMethod(ZProjector.AVG_METHOD);
zProjector.doProjection();
ip = zProjector.getProjection().getProcessor();
}
bp = null;
String[] hLabelsSplit = PathObjectTools.parseTMALabelString(horizontalLabels);
String[] vLabelsSplit = PathObjectTools.parseTMALabelString(verticalLabels);
updateGrid(tmaGrid, downsample);
tmaGrid = doDearraying(fullCoreDiameterPx, downsample, densityThreshold, roiScaleFactor, isFluorescence, hLabelsSplit, vLabelsSplit, horizontalLabelFirst);
return tmaGrid == null ? null : new ArrayList<>(tmaGrid.getTMACoreList());
}