tjrantal/BoneJ — pull request #5 by mdoube (2011-10-25 19:34:21+00:00)
Title: Add opener API to Read_Stratec_File

Hi Timo,

I dealt with our concerns regarding the show() issue. General style advice is only to show() in the run() method, and not to show in any other public methods, so I made a little public open() method.

Calling open() returns an ImagePlus which the caller can then do stuff with: processing, displaying, saving, whatever.

As part of that I changed all things that don't need to be public to be private.

This little plugin is an example call (you can "compile and run" in the plugin editor):

Michael

import ij.*;
import ij.process.*;
import ij.gui.*;
import java.awt.*;
import ij.plugin.*;
import ij.plugin.frame.*;

import org.doube.bonej.pqct.*;

public class My_Plugin implements PlugIn {

public void run(String arg) {
Read_Stratec_File rsf = new Read_Stratec_File();
ImagePlus imp = rsf.open("/home/mdoube/Desktop/I0024603.M03");
imp.show();
}

}