• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java TextPanel类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: writeHeader

import ij.text.TextPanel; //导入依赖的package包/类
void writeHeader(final TextPanel textPanel) {
	final String[] propertyNames = { "File Name", "File Path", "Patient's Name", "Patient ID",
			"Patient's Birth Date", "Acquisition Date", "Pixel Spacing", "Object Length" };
	String headings = "";
	for (int i = 0; i < propertyNames.length; ++i) {
		headings += propertyNames[i] + "\t";
	}
	textPanel.setColumnHeadings(headings);
}
 
开发者ID:bonej-org,项目名称:BoneJ2,代码行数:10,代码来源:Export_Header.java


示例2: ImageROIPainter

import ij.text.TextPanel; //导入依赖的package包/类
/**
 * @param textPanel
 *            The text panel to listen to for mouse events
 * @param title
 *            The title of the image to add the ROI to
 * @param coordProvider
 *            Provides coordinates from the lines selected in the text panel
 */
public ImageROIPainter(TextPanel textPanel, String title, CoordinateProvider coordProvider)
{
	// Check if the image is displayed
	this.title = title;
	this.textPanel = textPanel;
	this.coordProvider = coordProvider;
	textPanel.addMouseListener(this);
}
 
开发者ID:aherbert,项目名称:GDSC-SMLM,代码行数:17,代码来源:ImageROIPainter.java


示例3: clusterSelected

import ij.text.TextPanel; //导入依赖的package包/类
public void clusterSelected(ClusterSelectedEvent e)
{
	if (tw == null || e.getSource() == id)
		return;
	if (!inputSettings.getOpticsEventSettingsOrBuilder().getTableShowSelection())
		return;
	TextPanel textPanel = tw.getTextPanel();
	int startLine = -1, endLine = -1;
	int[] clusters = e.getClusters();
	if (clusters == null || clusters.length == 0)
	{
		textPanel.resetSelection();
	}
	else
	{
		// Find the clusters.
		// Assume that the panel is showing the current results.
		for (int i = 0; i < tableResults.size(); i++)
		{
			TableResult r = tableResults.getf(i);
			if (r.id == clusters[0])
			{
				// We can only handle selecting continuous lines so 
				// for now just select the first cluster.
				startLine = endLine = i;
				break;
			}
		}
	}
	if (startLine != -1)
	{
		textPanel.setSelection(startLine, endLine);
	}
}
 
开发者ID:aherbert,项目名称:GDSC-SMLM,代码行数:35,代码来源:OPTICS.java


示例4: createDialog

import ij.text.TextPanel; //导入依赖的package包/类
private GenericDialog createDialog()
	{
		// Get the list of windows containing tables
		TextWindow[] textWindows = getTableWindows();
		if (textWindows.length == 0)
		{
			IJ.error("Requires at least one Table window");
			return null;
		}
		String[] tableNames = new String[textWindows.length];
		for (int i = 0; i < textWindows.length; i++) {
			tableNames[i] = textWindows[i].getTitle();
//			IJ.log("Found table: " + tableNames[i]);
		}
		
		// Choose current table
		TextPanel tp = textWindows[0].getTextPanel();
		ResultsTable table = tp.getResultsTable();
		this.table = table;
		
		// Choose current heading
		String[] headings = table.getHeadings();
		String defaultHeading = headings[0];
		if (defaultHeading.equals("Label") && headings.length > 1)
		{
			defaultHeading = headings[1];
		}

		double[] extent = computeColumnExtent(table, defaultHeading);

		this.gd = new GenericDialog("Assign Measure to Label");
		gd.addChoice("Results Table:", tableNames, tableNames[0]);
		gd.addChoice("Column:", headings, defaultHeading);
		gd.addNumericField("Min Value", extent[0], this.nDigits, 10, null);
		gd.addNumericField("Max Value", extent[1], this.nDigits, 10, null);
		gd.addDialogListener(this);
		
		return gd;
	}
 
开发者ID:ijpb,项目名称:MorphoLibJ,代码行数:40,代码来源:LabelToValuePlugin.java


示例5: removeAfterLine

import ij.text.TextPanel; //导入依赖的package包/类
private void removeAfterLine(TextWindow window, int line)
{
	if (window != null && line > 0)
	{
		TextPanel tp = window.getTextPanel();
		int nLines = tp.getLineCount();
		if (line < nLines)
		{
			tp.setSelection(line, nLines);
			tp.clearSelection();
		}
	}
}
 
开发者ID:aherbert,项目名称:GDSC,代码行数:14,代码来源:SpotDistance.java


示例6: getTextPanel

import ij.text.TextPanel; //导入依赖的package包/类
/** Returns a reference to the "Results" window TextPanel.
	Opens the "Results" window if it is currently not open.
	Returns null if the "ImageJ" window is not open. */
public static TextPanel getTextPanel() {
	if (textPanel==null && ij!=null)
		showResults();
	return textPanel;
}
 
开发者ID:darciopacifico,项目名称:omr,代码行数:9,代码来源:IJJazzOMR.java


示例7: setTextPanel

import ij.text.TextPanel; //导入依赖的package包/类
/** TextWindow calls this method with a null argument when the "Results" window is closed. */
public static void setTextPanel(TextPanel tp) {
	textPanel = tp;
}
 
开发者ID:darciopacifico,项目名称:omr,代码行数:5,代码来源:IJJazzOMR.java


示例8: run

import ij.text.TextPanel; //导入依赖的package包/类
public void run(ImageProcessor ip) {
	int npts;
	double[] x, y;
	
	// Obtains the coordinates of the points from the Results window
	TextPanel resultsWindow = IJ.getTextPanel();
	npts = resultsWindow.getLineCount();
	if (npts <= 0) {
		IJ.log("ERROR: no point coordinates found.");
		IJ.log("INSTRUCTIONS: Use the crosshair tool to mark all desired points of ablation"
				+ "before executing Point and Shoot.\n This plugin will ablate "
				+ "all points listed in the Results window.\n Clear the window "
				+ "beforehand if necessary.");
		IJ.log("\nDONE\n");
		return;
	}
	x = new double[npts];
	y = new double[npts];
	for (int i = 0; i < npts; i++) {
		StringTokenizer line = new StringTokenizer(resultsWindow.getLine(i), "\t");
		line.nextToken();
		x[i] = Double.parseDouble(line.nextToken());
		y[i] = Double.parseDouble(line.nextToken());
	}

	// Displays a dialog box to allow the user to configure the experimental parameters
    double reprate = 10;
   	int npulses = 1;
	int zoom = 1;
	GenericDialog gd = new GenericDialog("Experimental Parameters");
	gd.addNumericField("Laser Repetition Rate (Hz): ", reprate, 0);
	gd.addNumericField("Number of Ablation Pulses: ", npulses, 0);
	gd.addNumericField("Digital Zoom of Image: ", zoom, 0);
	gd.addMessage("");
	gd.addMessage("Check targeting on image. Cancel plugin if incorrect.");
	gd.showDialog();
	if (gd.wasCanceled()) {
		IJ.error("Point_and_Shoot PlugIn canceled!");
		return;
	}
	reprate = gd.getNextNumber();
   	npulses = (int) gd.getNextNumber();
   	zoom = (int) gd.getNextNumber();
    double period = 1000 / reprate;	//period in ms
    int opentime = (int) ( period * (npulses-0.05) );

	// Initializes the microbeam
	Microbeam microbeam = new Microbeam(Microbeam.CONFIG_FILENAME);
	if (!microbeam.isSetupOK()) return;

	/** LASER INCISION **/
	// Iterate over each point, and make a point ablation
	IJ.wait(500);
	for (int i = 0; i < npts; i++) {
		if (!win.running) break;
		
		// move microbeam to position i
		microbeam.moveToPIXELS(x[i], y[i], ip, zoom);
		microbeam.openShutter();
		IJ.wait(opentime);
		microbeam.closeShutter();
		
		// draw point of ablation on display image
		ip.setColor(Color.white); ip.setLineWidth(3);		// set line width and color
		ip.drawDot((int) x[i], (int) y[i]);
		imp.updateAndDraw();
	}

	// Moves microbeam to home and turns it off
	microbeam.moveToMM(0.0, 0.0);
	microbeam.off();
	IJ.log("\nDONE\n");
}
 
开发者ID:rogerzou,项目名称:LaserMicrosurgery,代码行数:74,代码来源:Point_and_Shoot.java


示例9: run

import ij.text.TextPanel; //导入依赖的package包/类
public void run(ImageProcessor ip) {
	ip.snapshot();

	// Obtains the coordinates of the points from the Results window
	TextPanel resultsWindow = IJ.getTextPanel();
	try {
		numpoints = resultsWindow.getLineCount();
		if (numpoints <= 0) throw new IllegalArgumentException();
		x = new double[numpoints];
		y = new double[numpoints];
		for (int i = 0; i < numpoints; i++) {
			StringTokenizer line = new StringTokenizer(resultsWindow.getLine(i), "\t");
			line.nextToken();
			x[i] = Double.parseDouble(line.nextToken());
			y[i] = Double.parseDouble(line.nextToken());
		}
	} catch (RuntimeException e) {
		IJ.showMessage("Invalid point selection",
		"Use the crosshair tool to mark all desired points of ablation before executing Point and Shoot.\n" +
		"This plugin will ablate all points listed in the Results window.\n" +
		"Clear the window beforehand if necessary.");
		return;
	}

	// Displays a dialog box to allow the user to configure the experimental parameters
    double reprate = 10;
   	int npulses = 1;
	int zoom = 1;
	GenericDialog gd = new GenericDialog("Experimental Parameters");
	gd.addNumericField("Laser Repetition Rate (Hz): ", reprate, 0);
	gd.addNumericField("Number of Ablation Pulses: ", npulses, 0);
	gd.addNumericField("Digital Zoom of Image: ", zoom, 0);
	gd.addMessage("");
	gd.addMessage("Check targeting on image. Cancel plugin if incorrect.");
	gd.showDialog();
	if (gd.wasCanceled()) {
		IJ.error("PlugIn canceled!");
		ip.reset();
		imp.updateAndDraw();
		return;
	}
	reprate = gd.getNextNumber();
   	npulses = (int) gd.getNextNumber();
   	zoom = (int) gd.getNextNumber();
    double period = (1000/reprate);	//period in ms
    int opentime = (int) (period*(npulses-0.05 ));
	IJ.setColumnHeadings("");

	// Initializes the microbeam
	Microbeam microbeam = new Microbeam(Microbeam.CONFIG_FILENAME);
	if(!microbeam.isSetupOK()) return;

	// Moves to each point and exposes it for the specified number of pulses
	for(int j = 0; j < 3; j++) {
		IJ.beep();
		IJ.wait(500);
	}
	ip.setLineWidth(3);
	ip.setColor(Color.white);
	for (int i = 0; i < numpoints; i++) {
		microbeam.moveToPIXELS(x[i], y[i], ip, zoom);
		if (!win.running) break;
		microbeam.openShutter();
		IJ.wait(opentime);
		microbeam.closeShutter();
		ip.drawDot((int) x[i], (int) y[i]);
		imp.updateAndDraw();
	}

	// Resets the microbeam
	microbeam.moveToMM(0.0, 0.0);
	microbeam.off();
	IJ.write("\nDONE\n");
}
 
开发者ID:rogerzou,项目名称:LaserMicrosurgery,代码行数:75,代码来源:Point_and_Shoot.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ResultMapResolver类代码示例发布时间:2022-05-22
下一篇:
Java JavaPackage类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap