本文整理汇总了Java中ij.plugin.filter.Analyzer.saveResults方法的典型用法代码示例。如果您正苦于以下问题:Java Analyzer.saveResults方法的具体用法?Java Analyzer.saveResults怎么用?Java Analyzer.saveResults使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ij.plugin.filter.Analyzer
的用法示例。
在下文中一共展示了Analyzer.saveResults方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createPathObjectsFromROIs
import ij.plugin.filter.Analyzer; //导入方法依赖的package包/类
/**
* Turn an array of ImageJ ROIs into a list of QuPath PathObjects, optionally adding measurements as well.
*
* @param imp
* @param rois
* @param server
* @param downsample
* @param asDetection
* @param includeMeasurements
* @return
*/
public static List<PathObject> createPathObjectsFromROIs(final ImagePlus imp, final Roi[] rois, final ImageServer<?> server, final double downsample, final boolean asDetection, final boolean includeMeasurements, final int c, final int z, final int t) {
List<PathObject> pathObjects = new ArrayList<>();
ResultsTable rt = new ResultsTable();
Analyzer analyzer = new Analyzer(imp, Analyzer.getMeasurements(), rt);
String[] headings = null;
for (Roi roi : rois) {
PathObject pathObject = IJTools.convertToPathObject(imp, server, roi, downsample, asDetection, c, z, t);
if (pathObject == null)
IJ.log("Sorry, I could not convert " + roi + " to a value QuPath object");
else {
// Make measurements
if (includeMeasurements) {
ImageProcessor ip = imp.getProcessor();
ip.setRoi(roi);
ImageStatistics stats = ImageStatistics.getStatistics(ip, Analyzer.getMeasurements(), imp.getCalibration());
analyzer.saveResults(stats, roi);
// Get measurements from table and append
if (headings == null)
headings = rt.getHeadings();
int row = rt.getCounter()-1;
MeasurementList ml = pathObject.getMeasurementList();
for (String h : headings) {
if ("Label".equals(h))
continue;
ml.putMeasurement(h, rt.getValue(h, row));
}
ml.closeList();
}
pathObjects.add(pathObject);
}
}
return pathObjects;
}
示例2: getHyperstackProfile
import ij.plugin.filter.Analyzer; //导入方法依赖的package包/类
private float[] getHyperstackProfile(Roi roi, double minThreshold, double maxThreshold) {
int slices = imp.getNSlices();
int frames = imp.getNFrames();
int c = imp.getC();
int z = imp.getZ();
int t = imp.getT();
int size = slices;
if (firstTime)
timeProfile = slices==1 && frames>1;
if (slices>1 && frames>1 && (!isPlotMaker ||firstTime)) {
showingDialog = true;
GenericDialog gd = new GenericDialog("Profiler");
gd.addChoice("Profile", choices, choice);
gd.showDialog();
if (gd.wasCanceled())
return null;
choice = gd.getNextChoice();
timeProfile = choice.equals(choices[0]);
}
if (timeProfile)
size = frames;
else
size = slices;
float[] values = new float[size];
Calibration cal = imp.getCalibration();
Analyzer analyzer = new Analyzer(imp);
int measurements = Analyzer.getMeasurements();
boolean showResults = !isPlotMaker && measurements!=0 && measurements!=LIMIT;
measurements |= MEAN;
if (showResults) {
if (!Analyzer.resetCounter())
return null;
}
ImageStack stack = imp.getStack();
for (int i=1; i<=size; i++) {
int index = 1;
if (timeProfile)
index = imp.getStackIndex(c, z, i);
else
index = imp.getStackIndex(c, i, t);
ImageProcessor ip = stack.getProcessor(index);
if (minThreshold!=ImageProcessor.NO_THRESHOLD)
ip.setThreshold(minThreshold,maxThreshold,ImageProcessor.NO_LUT_UPDATE);
ip.setRoi(roi);
ImageStatistics stats = ImageStatistics.getStatistics(ip, measurements, cal);
analyzer.saveResults(stats, roi);
values[i-1] = (float)stats.mean;
}
if (showResults) {
ResultsTable rt = Analyzer.getResultsTable();
rt.show("Results");
}
return values;
}
示例3: getZAxisProfile
import ij.plugin.filter.Analyzer; //导入方法依赖的package包/类
private float[] getZAxisProfile(Roi roi, double minThreshold, double maxThreshold) {
ImageStack stack = imp.getStack();
if (firstTime) {
int slices = imp.getNSlices();
int frames = imp.getNFrames();
timeProfile = slices==1 && frames>1;
}
int size = stack.getSize();
float[] values = new float[size];
Calibration cal = imp.getCalibration();
Analyzer analyzer = new Analyzer(imp);
int measurements = Analyzer.getMeasurements();
boolean showResults = !isPlotMaker && measurements!=0 && measurements!=LIMIT;
boolean showingLabels = firstTime && showResults && ((measurements&LABELS)!=0 || (measurements&SLICE)!=0);
measurements |= MEAN;
if (showResults) {
if (!Analyzer.resetCounter())
return null;
}
boolean isLine = roi!=null && roi.isLine();
int current = imp.getCurrentSlice();
for (int i=1; i<=size; i++) {
if (showingLabels)
imp.setSlice(i);
ImageProcessor ip = stack.getProcessor(i);
if (minThreshold!=ImageProcessor.NO_THRESHOLD)
ip.setThreshold(minThreshold,maxThreshold,ImageProcessor.NO_LUT_UPDATE);
ip.setRoi(roi);
ImageStatistics stats = null;
if (isLine)
stats = getLineStatistics(roi, ip, measurements, cal);
else
stats = ImageStatistics.getStatistics(ip, measurements, cal);
analyzer.saveResults(stats, roi);
values[i-1] = (float)stats.mean;
}
if (showResults) {
ResultsTable rt = Analyzer.getResultsTable();
rt.show("Results");
}
if (showingLabels)
imp.setSlice(current);
return values;
}