当前位置: 首页>>代码示例>>Java>>正文


Java ResultsTable类代码示例

本文整理汇总了Java中ij.measure.ResultsTable的典型用法代码示例。如果您正苦于以下问题:Java ResultsTable类的具体用法?Java ResultsTable怎么用?Java ResultsTable使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ResultsTable类属于ij.measure包,在下文中一共展示了ResultsTable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: showResults

import ij.measure.ResultsTable; //导入依赖的package包/类
/**
 * Show a Results table containing some performance information
 *
 * @param duration time elapsed in purifying.
    * @param imp the purified image.
    * @param slicesPerChunk slices processed by each chunk.
    * @param labelMethod labelling method used.
 */
private void showResults(final double duration, final ImagePlus imp, int slicesPerChunk, final int labelMethod) {
	if (labelMethod == ParticleCounter.LINEAR)
		slicesPerChunk = imp.getImageStackSize();
	final ParticleCounter pc = new ParticleCounter();
	final int nChunks = pc.getNChunks(imp, slicesPerChunk);
	final int[][] chunkRanges = pc.getChunkRanges(imp, nChunks, slicesPerChunk);
	final ResultsTable rt = ResultsTable.getResultsTable();
	rt.incrementCounter();
	rt.addLabel(imp.getTitle());
	rt.addValue("Algorithm", labelMethod);
	rt.addValue("Threads", Runtime.getRuntime().availableProcessors());
	rt.addValue("Slices", imp.getImageStackSize());
	rt.addValue("Chunks", nChunks);
	rt.addValue("Chunk size", slicesPerChunk);
	rt.addValue("Last chunk size", chunkRanges[1][nChunks - 1] - chunkRanges[0][nChunks - 1]);
	rt.addValue("Duration (s)", duration);
	rt.show("Results");
	return;
}
 
开发者ID:bonej-org,项目名称:BoneJ2,代码行数:28,代码来源:Purify.java

示例2: identifyGoodCores

import ij.measure.ResultsTable; //导入依赖的package包/类
/**
 * Identify regions in a binary image likely to correspond to complete TMA cores,
 * based both on size and circularity.
 * @param bp - The binary image to process; 0 should be background, 255 foreground
 * @param minArea - Minimum area of a region to keep (in pixels)
 * @param maxArea - Maximum area of a region to keep (in pixels)
 * @param minCircularity - Minimum circularity of a region to keep.
 * @param labelCores - TRUE if the output should be a labelled image (unique integer value per core), otherwise a binary image will be returned
 * @param polyCentroids - A Polygon to which the centroids of the detected regions will be added (if not null).
 * @return Binary or labelled image showing containing only the regions of bp with shapes & sizes corresponding to likely complete TMA cores.
 */	
private static ImageProcessor identifyGoodCores(ByteProcessor bp, double minArea, double maxArea, double minCircularity, boolean labelCores, Polygon polyCentroids) {
	// Create a binary image of only the roundest structures of approximately the correct area
	bp.setThreshold(127, 512, ImageProcessor.NO_LUT_UPDATE);
	int options = labelCores ? ParticleAnalyzer.SHOW_ROI_MASKS : ParticleAnalyzer.SHOW_MASKS;
	int measurements = Measurements.CENTROID;
	ResultsTable rt = new ResultsTable();
	ParticleAnalyzer pa = new ParticleAnalyzer(options, measurements, rt, minArea, maxArea, minCircularity, 1.0);
	pa.setHideOutputImage(true);
	pa.analyze(new ImagePlus("Temp", bp), bp);
	if (polyCentroids != null) {
		for (int i = 0; i < rt.getCounter(); i++) {
			int x = (int)(rt.getValueAsDouble(ResultsTable.X_CENTROID, i) + .5);
			int y = (int)(rt.getValueAsDouble(ResultsTable.Y_CENTROID, i) + .5);
			polyCentroids.addPoint(x, y);
		}
	}
	return pa.getOutputImage().getProcessor();
}
 
开发者ID:qupath,项目名称:qupath,代码行数:30,代码来源:TMADearrayer.java

示例3: sendToResultTable

import ij.measure.ResultsTable; //导入依赖的package包/类
private void sendToResultTable(final float[][] centers, final String[] labels) {
    // Send cluster centers to a Result Table
    final ResultsTable rt = new ResultsTable();
    for (int i = 0; i < centers.length; i++) {
        rt.incrementCounter();
        final float[] center = centers[i];
        rt.addValue("Cluster", i);
        if (center.length == 1) {
            rt.addValue("Value", center[0]);
        } else {
            for (int j = 0; j < center.length; j++) {
                final float v = center[j];
                rt.addValue(labels[j] != null ? "" + labels[j] : "Band " + j, v);
            }
        }
    }
    rt.show(RESULTS_WINDOW_TITLE);
}
 
开发者ID:ij-plugins,项目名称:ijp-toolkit,代码行数:19,代码来源:KMeansClusteringPlugin.java

示例4: getResultsTable

import ij.measure.ResultsTable; //导入依赖的package包/类
/**
 * Returns the instance of the ResultsTable.
 *
 * @return	Instance of the ResultsTable
 */
public static Object getResultsTable(){
    ResultsTable rt=Analyzer.getResultsTable();
    int col=0;
    int[] index=new int[ResultsTable.MAX_COLUMNS];
    for  (int cnt=0;cnt<ResultsTable.MAX_COLUMNS; cnt++) {
        if (rt.columnExists(cnt)){
            index[col]=cnt;
            col++;
        }
    }
    int counter=rt.getCounter();
    double [][] results=new double[counter][col];
    for( int i=0;i<col;i++) {
        for( int j=0;j<counter;j++) {
            results[j][i]=rt.getValueAsDouble(index[i],j);
        }
    }
    return results;
}
 
开发者ID:TOMIGalway,项目名称:cmoct-sourcecode,代码行数:25,代码来源:MIJ.java

示例5: setColumn

import ij.measure.ResultsTable; //导入依赖的package包/类
/**
 * Set a specifying column into the current instance ResultsTable.
 *
 * @param heading	heading of a column	
 * @param object
 */
public static void setColumn(String heading, Object object){
    ResultsTable rt=Analyzer.getResultsTable();
    
    int col= rt.getColumnIndex(heading);
    if (col==ResultsTable.COLUMN_NOT_FOUND) 
    	col=rt.getFreeColumn(heading);
    int cc=rt.getCounter();
    if (object instanceof double[]) {
        double[] values = (double[]) object;
        for (int i=0; i<values.length; i++){
if (cc<=i) rt.incrementCounter();
            	rt.setValue(col, i, values[i]);
        }
    }
}
 
开发者ID:TOMIGalway,项目名称:cmoct-sourcecode,代码行数:22,代码来源:MIJ.java

示例6: readAlternativeBullets

import ij.measure.ResultsTable; //导入依赖的package包/类
/**
 * @param imageDocVO
 * @param questionCoordinateVO
 * @param examVO
 * @param questionResult TODO
 * @return
 * @throws JazzOMRException
 */
protected void  readAlternativeBullets(ImageDocVO imageDocVO, RelatorioVO relatorioVO, List<CriterionResultVO> critQuestResults, ISortable questionVO ) throws JazzOMRException {

	for (CriterionResultVO criterionResultVO : critQuestResults) {
		
		if(isAlternative(criterionResultVO) ){
			BufferedImage imgAlternativeAnswer = cropOMRMark(imageDocVO, relatorioVO, criterionResultVO, imageDocVO.getBufferedImage());
			ResultsTable resultsTable = particleAnaylis(imgAlternativeAnswer);
			criterionResultVO.setTransientResultAnalysis(resultsTable);
			criterionResultVO.setTransientImage(imgAlternativeAnswer);
		} 
	
	}
	//este metodo nao determina quais bullets foram checados.
	
}
 
开发者ID:darciopacifico,项目名称:omr,代码行数:24,代码来源:JazzOMRImageParser.java

示例7: findParticles

import ij.measure.ResultsTable; //导入依赖的package包/类
/**
 * Lista partículas encontradas na imagem de acordo com o template de particulas informado
 * 
 * @param imp
 * @param options
 * @param medidas
 * @param parameterObject
 *          TODO
 * @return
 */
protected List<ParticleVO> findParticles(ImageDocVO data, int options, int medidas, ParticleAnalyzerParamDTO analyzerParams) {
	// int measurements=0;
	ResultsTable rt = new ResultsTable();

	double minArea = analyzerParams.getMinArea(data.getImgArea());
	double maxArea = analyzerParams.getMaxArea(data.getImgArea());
	double minCirc = analyzerParams.getMinCirc();

	ParticleAnalyzer jpa = new ParticleAnalyzer(options, medidas, rt, minArea, maxArea, minCirc, JazzOMRImageParser.MAX_CIRCULARITY);

	// executa analise
	jpa.analyze(data.getImagePlus());

	// itera resultados e preenche VOs
	List<ParticleVO> particles = fillParticleVOs(data, rt);

	return particles;
}
 
开发者ID:darciopacifico,项目名称:omr,代码行数:29,代码来源:JazzOMRImageParser.java

示例8: evaluate

import ij.measure.ResultsTable; //导入依赖的package包/类
/**
 * Predicate: Apenas para filtrar alternativas que nao foram encontradas particulas
 */
@Override
public boolean evaluate(Object object) {
	CriterionResultVO altRes = (CriterionResultVO) object;
	
	AbstractCriterionVO abstractCriterionVO = altRes.getCriterionCoordinateVO().getAbstractCriterionVO();
	
	if(abstractCriterionVO instanceof AlternativeVO){
		
		ResultsTable rt = altRes.getTransientResultAnalysis();
		return rt.getCounter()>0;
		
	}else{
		return false;
	}
}
 
开发者ID:darciopacifico,项目名称:omr,代码行数:19,代码来源:AlternativeComparator.java

示例9: findParticles

import ij.measure.ResultsTable; //导入依赖的package包/类
/**
 * Lista partículas encontradas na imagem de acordo com o template de particulas informado
 * 
 * @param imp
 * @param options
 * @param medidas
 * @param parameterObject
 *          TODO
 * @return Measurements.SHAPE_DESCRIPTORS + Measurements.CENTER_OF_MASS + Measurements.AREA + Measurements.PERIMETER + Measurements.CENTROID;
 */
private List<ParticleVO> findParticles(ImageDocVO data, int options, int medidas, ParticleAnalyzerParamDTO analyzerParams) {
	// int measurements=0;
	ResultsTable rt = new ResultsTable();

	double minArea = analyzerParams.getMinArea(data.getImgArea());
	double maxArea = analyzerParams.getMaxArea(data.getImgArea());
	double minCirc = analyzerParams.getMinCirc();

	ParticleAnalyzer jpa = new ParticleAnalyzer(options, medidas, rt, minArea, maxArea, minCirc, JazzOMRImageParser.MAX_CIRCULARITY);

	// executa analise
	jpa.analyze(data.getImagePlus());

	// itera resultados e preenche VOs
	List<ParticleVO> particles = fillParticleVOs(data, rt);

	return particles;
}
 
开发者ID:darciopacifico,项目名称:omr,代码行数:29,代码来源:JazzOMRImageParser.java

示例10: evaluate

import ij.measure.ResultsTable; //导入依赖的package包/类
/**
 * Predicate: Apenas para filtrar alternativas que nao foram encontradas particulas
 */
@Override
public boolean evaluate(Object object) {

	/*
	return false;
	*/
	
	CriterionResultVO altRes = (CriterionResultVO) object;
	
	if("A".equals(altRes.getCritType())){

		ResultsTable rt = altRes.getTransientResultAnalysis();
		
		return rt.getCounter()>0;
		
	}else{
		return false;
	}
	/*
	 */
}
 
开发者ID:darciopacifico,项目名称:omr,代码行数:25,代码来源:AlternativeComparator.java

示例11: compareAttribute

import ij.measure.ResultsTable; //导入依赖的package包/类
/**
 * Metodo utilitario, compara atributo informado
 * @param rt1
 * @param rt2
 * @param atribute
 * @return
 */
protected int compareAttribute(ResultsTable rt1, ResultsTable rt2, COLUMNS_PARTICLE atribute) {
	double c1 = getGreaterParticleValue(rt1, atribute);
	double c2 = getGreaterParticleValue(rt2, atribute);
	
	if(c1==c2){
		return 0; 

	}else if(c1>c2){
		return -1;
		
	}else {
		return 1;
		
	}
}
 
开发者ID:darciopacifico,项目名称:omr,代码行数:23,代码来源:AlternativeComparator.java

示例12: fillParticleVOs

import ij.measure.ResultsTable; //导入依赖的package包/类
/**
 * Apenas faz o trabalho bracal de preencher a lista de VOs
 * 
 * @param rt
 * @return
 */
private List<ParticleVO> fillParticleVOs(ImageDocVO data, ResultsTable rt) {
	int rowCount = rt.getCounter();
	List<ParticleVO> particles = new ArrayList<ParticleVO>(rowCount);

	if (rowCount > 0) {

		for (int row = 0; row < rowCount; row++) {

			ParticleVO particleVO = new ParticleVO();

			particleVO.setArea(getValue(rt, COLUMNS_PARTICLE.AREA, row));
			particleVO.setPerimeter(getValue(rt, COLUMNS_PARTICLE.PERIM, row));
			particleVO.setSolidity(getValue(rt, COLUMNS_PARTICLE.SOLIDITY, row));

			particleVO.setX(getValue(rt, COLUMNS_PARTICLE.X, row));
			particleVO.setY(getValue(rt, COLUMNS_PARTICLE.Y, row));

			particleVO.setCircularity(getValue(rt, COLUMNS_PARTICLE.CIRC, row));

			particles.add(particleVO);
		}

	}
	return particles;
}
 
开发者ID:darciopacifico,项目名称:omr,代码行数:32,代码来源:JazzOMRImageParser.java

示例13: readAlternativeBullets

import ij.measure.ResultsTable; //导入依赖的package包/类
/**
 * @param imageDocVO
 * @param questionCoordinateVO
 * @param examVO
 * @param questionResult TODO
 * @return
 * @throws JazzOMRException
 */
protected void  readAlternativeBullets(ImageDocVO imageDocVO, ExamVO examVO, List<CriterionResultVO> critQuestResults, ISortable questionVO ) throws JazzOMRException {

	for (CriterionResultVO criterionResultVO : critQuestResults) {
		
		if(isAlternative(criterionResultVO) ){
			BufferedImage imgAlternativeAnswer = cropOMRMark(imageDocVO, examVO, criterionResultVO, imageDocVO.getBufferedImage());
			ResultsTable resultsTable = particleAnaylis(imgAlternativeAnswer);
			criterionResultVO.setTransientResultAnalysis(resultsTable);
			criterionResultVO.setTransientImage(imgAlternativeAnswer);
		} 
	
	}
	//este metodo nao determina quais bullets foram checados.
	
}
 
开发者ID:darciopacifico,项目名称:omr,代码行数:24,代码来源:JazzOMRImageParser.java

示例14: fillParticleVOs

import ij.measure.ResultsTable; //导入依赖的package包/类
/**
 * Apenas faz o trabalho bracal de preencher a lista de VOs
 * 
 * @param rt
 * @return
 */
protected List<ParticleVO> fillParticleVOs(ImageDocVO data, ResultsTable rt) {
	int rowCount = rt.getCounter();
	List<ParticleVO> particles = new ArrayList<ParticleVO>(rowCount);

	if (rowCount > 0) {

		for (int row = 0; row < rowCount; row++) {

			ParticleVO particleVO = new ParticleVO();

			particleVO.setArea(getValue(rt, COLUMNS_PARTICLE.AREA, row));
			particleVO.setPerimeter(getValue(rt, COLUMNS_PARTICLE.PERIM, row));
			particleVO.setSolidity(getValue(rt, COLUMNS_PARTICLE.SOLIDITY, row));

			particleVO.setX(getValue(rt, COLUMNS_PARTICLE.X, row));
			particleVO.setY(getValue(rt, COLUMNS_PARTICLE.Y, row));

			particleVO.setCircularity(getValue(rt, COLUMNS_PARTICLE.CIRC, row));

			particles.add(particleVO);
		}

	}
	return particles;
}
 
开发者ID:darciopacifico,项目名称:omr,代码行数:32,代码来源:JazzOMRImageParser.java

示例15: createPathObjectsFromROIs

import ij.measure.ResultsTable; //导入依赖的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;
}
 
开发者ID:qupath,项目名称:qupath,代码行数:45,代码来源:QUPath_Send_Overlay_to_QuPath.java


注:本文中的ij.measure.ResultsTable类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。