File: LoadTestData.java

package info (click to toggle)
threeb 0.0~git20220106110332.a3144e0-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 22,292 kB
  • sloc: cpp: 5,188; java: 1,741; ansic: 1,336; sh: 568; makefile: 62; awk: 26
file content (55 lines) | stat: -rw-r--r-- 1,233 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import ij.*;
import ij.process.*;
import ij.gui.*;
import java.awt.*;
import ij.plugin.*;
import ij.plugin.frame.*;
import ij.plugin.filter.PlugInFilter;
import ij.*;
import ij.io.*;
import ij.plugin.*;
import ij.plugin.filter.*;

import java.awt.event.*;
import java.awt.geom.*;
import java.util.*;
import java.io.*;
import javax.swing.*;
import javax.swing.event.*;
import java.lang.InterruptedException;
import java.lang.System;
import java.lang.Math.*;
import java.net.*;


///Plugin class to load the standard test data from the JAR file.
///@ingroup gPlugin
public class LoadTestData implements PlugIn {

	public void run(String arg)
	{
		Opener o = new Opener();
		InputStream s = getClass().getClassLoader().getResourceAsStream("test_data.tif");
		ImagePlus im = o.openTiff(s, "test_data.tiff");


		try{
				s.close();
		}
		catch(IOException close_err){
			Toolkit.getDefaultToolkit().beep();
			ij.IJ.showStatus("Error reading image.");
			return;
		}

		im.show();
		im.updateAndDraw();


		System.out.println(getClass().getResource("").toString() + "\n");
		System.out.println(getClass().getResource("").getPath().toString() + "\n");
		System.out.println(getClass().getResource("").getFile().toString() + "\n");

	}

};