本文整理汇总了Java中ij.plugin.filter.ParticleAnalyzer类的典型用法代码示例。如果您正苦于以下问题:Java ParticleAnalyzer类的具体用法?Java ParticleAnalyzer怎么用?Java ParticleAnalyzer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ParticleAnalyzer类属于ij.plugin.filter包,在下文中一共展示了ParticleAnalyzer类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: identifyGoodCores
import ij.plugin.filter.ParticleAnalyzer; //导入依赖的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
示例2: findParticles
import ij.plugin.filter.ParticleAnalyzer; //导入依赖的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
示例3: findParticles
import ij.plugin.filter.ParticleAnalyzer; //导入依赖的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
示例4: particleAnaylis
import ij.plugin.filter.ParticleAnalyzer; //导入依赖的package包/类
/**
* Realiza uma analise de particulas na imagem do bullet. Estes resultados serao analizados juntamente com as outras imagens de bullets de alternativas.
* @param bi
* @return
*/
protected ResultsTable particleAnaylis(BufferedImage bi) {
// wrapper de imagem do ImageJ para analise
ImagePlus ip = new ImagePlus("bullet", bi);
// prepara imagem para analise
contrastImageThresholds(ip, JazzOMRImageParser.THRESHOLD_HUANG);
// cria tabela de resultados
ResultsTable rt = new ResultsTable();
// determina parametros de analise
double area = bi.getHeight() * bi.getWidth();
double minArea = area * bulletMinAreaFactor;
double maxArea = area * bulletMaxAreaFactor;
/*
private double bulletMinAreaFactor = 0.10;
private double bulletMaxAreaFactor = 0.95;
private double bulletMinCirc = 0.30;
*/
// cria analizador de particulas para bullets
ParticleAnalyzer jpa = new ParticleAnalyzer(0, Measurements.AREA+Measurements.CIRCULARITY, rt, minArea, maxArea, bulletMinCirc, JazzOMRImageParser.MAX_CIRCULARITY);
// executa analise
jpa.analyze(ip);
// testa se foram encotradas particulas
//boolean checked = rt.getCounter() > 0;
//imageDocLogger.logBullet(checked,bi,rt);
//if(log.isDebugEnabled()){
//}
return rt;
}
开发者ID:darciopacifico,项目名称:omr,代码行数:43,代码来源:JazzOMRImageParser.java
示例5: particleAnaylis
import ij.plugin.filter.ParticleAnalyzer; //导入依赖的package包/类
/**
* Realiza uma analise de particulas na imagem do bullet. Estes resultados serao analizados juntamente com as outras imagens de bullets de alternativas.
*
* @param bi
* @return
*/
private ResultsTable particleAnaylis(BufferedImage bi) {
// wrapper de imagem do ImageJ para analise
ImagePlus ip = new ImagePlus("bullet", bi);
// prepara imagem para analise
contrastImageThresholds(ip, JazzOMRImageParser.THRESHOLD_HUANG);
// cria tabela de resultados
ResultsTable rt = new ResultsTable();
// determina parametros de analise
double area = bi.getHeight() * bi.getWidth();
double minArea = area * bulletMinAreaFactor;
double maxArea = area * bulletMaxAreaFactor;
/*
* private double bulletMinAreaFactor = 0.10; private double bulletMaxAreaFactor = 0.95; private double bulletMinCirc = 0.30;
*/
// cria analizador de particulas para bullets
ParticleAnalyzer jpa = new ParticleAnalyzer(0, Measurements.AREA + Measurements.CIRCULARITY, rt, minArea, maxArea, bulletMinCirc, JazzOMRImageParser.MAX_CIRCULARITY);
// executa analise
jpa.analyze(ip);
// testa se foram encotradas particulas
boolean checked = rt.getCounter() > 0;
if (log.isDebugEnabled()) {
imageDocLogger.logBullet(checked, bi, rt);
}
return rt;
}
开发者ID:darciopacifico,项目名称:omr,代码行数:42,代码来源:JazzOMRImageParser.java
示例6: run
import ij.plugin.filter.ParticleAnalyzer; //导入依赖的package包/类
public void run(ImageProcessor inputIp)
{
// Just run the particle analyser
noOfParticles = 0;
// Avoid destructively modifying the image. Work on the selected channel for thresholding
int index = imp.getStackIndex(thresholdChannel, imp.getSlice(), imp.getFrame());
ImageProcessor ip = imp.getImageStack().getProcessor(index).duplicate();
if (!checkData(ip))
{
IJ.error(TITLE, "Channel has no data range");
resetImage();
return;
}
if (containsRoiMask && maskOption == 1)
{
ip = maskIp.duplicate();
ip.setThreshold(254, 255, ImageProcessor.NO_LUT_UPDATE);
}
else
{
// Blur the image
if (blur > 0)
{
GaussianBlur gb = new GaussianBlur();
gb.blurGaussian(ip, blur, blur, 0.002);
}
// Threshold
int t = AutoThreshold.getThreshold(thresholdMethod, ip.getHistogram());
ip.setThreshold(t, 65536, ImageProcessor.NO_LUT_UPDATE);
}
// Analyse particles
ImagePlus particlesImp = new ImagePlus(imp.getTitle() + " Particles", ip);
int analyserOptions = ParticleAnalyzer.SHOW_ROI_MASKS + ParticleAnalyzer.IN_SITU_SHOW +
ParticleAnalyzer.EXCLUDE_EDGE_PARTICLES;
int measurements = 0;
ResultsTable rt = new ResultsTable();
double maxSize = Double.POSITIVE_INFINITY;
ParticleAnalyzer pa = new ParticleAnalyzer(analyserOptions, measurements, rt, minSize, maxSize);
pa.analyze(particlesImp, ip);
ImageProcessor particlesIp = particlesImp.getProcessor();
noOfParticles = rt.getCounter();
if (label != null)
label.setText(String.format("%d particle%s", noOfParticles, (noOfParticles == 1) ? "" : "s"));
// Show the particles
inputIp.copyBits(particlesIp, 0, 0, Blitter.COPY);
inputIp.setMinAndMax(0, noOfParticles);
imp.updateAndDraw();
}
开发者ID:aherbert,项目名称:GDSC,代码行数:57,代码来源:SpotAnalyser.java
注:本文中的ij.plugin.filter.ParticleAnalyzer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论