ThreeB 1.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

LoadTestData.java
Go to the documentation of this file.

    00001 import ij.*;
    00002 import ij.process.*;
    00003 import ij.gui.*;
    00004 import java.awt.*;
    00005 import ij.plugin.*;
    00006 import ij.plugin.frame.*;
    00007 import ij.plugin.filter.PlugInFilter;
    00008 import ij.*;
    00009 import ij.io.*;
    00010 import ij.plugin.*;
    00011 import ij.plugin.filter.*;
    00012
    00013 import java.awt.event.*;
    00014 import java.awt.geom.*;
    00015 import java.util.*;
    00016 import java.io.*;
    00017 import javax.swing.*;
    00018 import javax.swing.event.*;
    00019 import java.lang.InterruptedException;
    00020 import java.lang.System;
    00021 import java.lang.Math.*;
    00022 import java.net.*;
    00023
    00024
    00025 ///Plugin class to load the standard test data from the JAR file.
    00026 ///@ingroup gPlugin
    00027 public class LoadTestData implements PlugIn {
    00028
    00029     public void run(String arg)
    00030     {
    00031         Opener o = new Opener();
    00032         InputStream s = getClass().getClassLoader().getResourceAsStream("test_data.tif");
    00033         ImagePlus im = o.openTiff(s, "test_data.tiff");
    00034
    00035
    00036         try{
    00037                 s.close();
    00038         }
    00039         catch(IOException close_err){
    00040             Toolkit.getDefaultToolkit().beep();
    00041             ij.IJ.showStatus("Error reading image.");
    00042             return;
    00043         }
    00044
    00045         im.show();
    00046         im.updateAndDraw();
    00047
    00048
    00049         System.out.println(getClass().getResource("").toString() + "\n");
    00050         System.out.println(getClass().getResource("").getPath().toString() + "\n");
    00051         System.out.println(getClass().getResource("").getFile().toString() + "\n");
    00052
    00053     }
    00054
    00055 };