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


Java Plot.scaleXtoPxl方法代码示例

本文整理汇总了Java中ij.gui.Plot.scaleXtoPxl方法的典型用法代码示例。如果您正苦于以下问题:Java Plot.scaleXtoPxl方法的具体用法?Java Plot.scaleXtoPxl怎么用?Java Plot.scaleXtoPxl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ij.gui.Plot的用法示例。


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

示例1: update

import ij.gui.Plot; //导入方法依赖的package包/类
private void update()
{
	double fwhm = getFWHM();
	label.setText(String.format("FWHM = %s px (%s nm)", Utils.rounded(fwhm), Utils.rounded(fwhm * scale)));

	Plot plot = pw.getPlot();

	double x = plot.scaleXtoPxl(centre);
	double min = plot.scaleYtoPxl(0);
	double max = plot.scaleYtoPxl(maxY);

	pw.getImagePlus().setRoi(new Line(x, min, x, max));

	imp.setSlice(centre);
	imp.resetDisplayRange();
	imp.updateAndDraw();
}
 
开发者ID:aherbert,项目名称:GDSC-SMLM,代码行数:18,代码来源:PSFDrift.java

示例2: addRoi

import ij.gui.Plot; //导入方法依赖的package包/类
private void addRoi(PlotWindow pw)
{
	Plot plot = pw.getPlot();
	int x1 = (int) plot.scaleXtoPxl(z[minz]);
	int x2 = (int) plot.scaleXtoPxl(z[maxz]);
	double[] limits = plot.getLimits();
	int y1 = (int) plot.scaleYtoPxl(limits[3]);
	int y2 = (int) plot.scaleYtoPxl(limits[2]);
	pw.getImagePlus().setRoi(new Roi(x1, y1, x2 - x1, y2 - y1));
}
 
开发者ID:aherbert,项目名称:GDSC-SMLM,代码行数:11,代码来源:AstigmatismModelManager.java

示例3: clusterSelected

import ij.gui.Plot; //导入方法依赖的package包/类
public void clusterSelected(ClusterSelectedEvent e)
{
	// Ignore events generated by the plot
	if (e.getSource() == id)
		return;
	if (!inputSettings.getOpticsEventSettingsOrBuilder().getPlotShowSelection())
		return;

	PlotCanvas pc = lastCanvas;
	if (pc == null)
		return;

	int[] selectedClusters = e.getClusters();
	int[] parents = clusteringResult.getParents(selectedClusters);
	if (parents == null || parents.length == 0)
		return;

	// Move the profile to the cover the range of the selected clusters
	int[] order = clusteringResult.getOrder();

	int min = Integer.MAX_VALUE;
	int max = 0;
	for (int i : parents)
	{
		int o = order[i];
		if (min > o)
			min = o;
		if (max < o)
			max = o;
	}

	// Find the range of the profile
	double minR = Double.POSITIVE_INFINITY, maxR = 0;

	// The scale should not matter as the result is cached
	double[] profile = clusteringResult.getProfile(Double.NaN);
	for (int i = min; i < max; i++)
	{
		double r = profile[i];
		if (minR > r)
			minR = r;
		if (maxR < r)
			maxR = r;
	}

	// Pad?
	double padR = Math.max(0.5, (maxR - minR) * 0.05);
	maxR += padR;
	minR -= padR;

	// TODO - Optionally add y-range of the clusters drawn underneath

	Plot plot = pc.getPlot();

	// Pad order by 0.5 so we can see the ends of the range
	int x = (int) plot.scaleXtoPxl(min - 0.5);
	int endX = (int) Math.ceil(plot.scaleXtoPxl(max + 0.5));
	int y = (int) plot.scaleYtoPxl(maxR);
	int endY = (int) Math.ceil(plot.scaleYtoPxl(minR));
	//System.out.printf("%d,%d to %d,%d\n", x, y, endX, endY);

	// Setting an ROI and calling zoom will reset the view window
	// and then kill the ROI
	pc.getImage().setRoi(new Roi(x, y, endX - x, endY - y));
	pc.zoom("to");
}
 
开发者ID:aherbert,项目名称:GDSC-SMLM,代码行数:67,代码来源:OPTICS.java


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