/* This plugin implements the DUAL-ENERGY (DE) algorithm. It assumes that two images, namely a LOW ENERGY (LE) image and a HIGH ENERGY (HE) image, are loaded before starting the DE analysis. For details on the dual-energy technique see "A. Taibi et al, Phys. Med. Biol. 48, 1945-1956, 2003" and references therein. Acknowledgment: The DE_ plugin is based on the NORMALIZE_ plugin, written by Jeffrey Kuhn. It also makes use of the Panel_Window plugin, written by Wayne Rasband. The help of Francesco Sisini (francescosisini@yahoo.it) is also kindly acknowledged. Angelo Taibi University of Ferrara Italy taibi@fe.infn.it Ferrara, June 2003 */ import java.awt.*; import java.lang.*; import java.awt.event.*; import java.awt.image.*; import ij.*; import ij.gui.*; import ij.plugin.filter.*; import ij.process.*; import ij.measure.*; import ij.plugin.*; import ij.process.FloatProcessor; public class DE_ implements PlugInFilter { /** If "none" is selected, then that image is not used in the calculation */ private static final String strNONE = "-- none --"; /** Name of LE image */ private static String strLEName = null; /** Name of HE image */ private static String strHEName = null; /** Mean grey level from the low-energy radiograph of an object of known thickness and composition */ private static double di0l = 100.0; /** Mean grey level from the high-energy radiograph of an object of known thickness and composition */ private static double di0h = 100.0; /** Linear attenuation coefficient at low energy of the basis material A */ private static double dmual = 0.741; /** Linear attenuation coefficient at high energy of the basis material A */ private static double dmuah = 0.388; /** Linear attenuation coefficient at low energy of the basis material B */ private static double dmubl = 0.423; /** Linear attenuation coefficient at high energy of the basis material B */ private static double dmubh = 0.262; /** Thickness of the known material to calculate incident x-ray intensity (in cm) */ private static double dt = 5.0; /** Projection angle in degrees */ private static double dangle = 45.0; /** Coefficient R for the calculation of the projection matrix */ private static double dR = 1.0; /** ImageJ ID of LE image */ private int iLEID; /** ImageJ ID of HE image */ private int iHEID; /** The image window to work on */ private ImagePlus impImage; /** Report what kind of images this plugin can handle to ImageJ */ public int setup(String arg, ImagePlus imp) { impImage = imp; return DOES_ALL+NO_CHANGES; } /** Request the user to specify the LE and HE images */ public boolean getArguments() { int[] aiWinList = WindowManager.getIDList(); if (aiWinList==null) { IJ.error("No windows are open."); return false; } String[] astrWinTitles = new String[aiWinList.length + 1]; astrWinTitles[0] = strNONE; for (int i=0; i