Commit 4665aba0 authored by Andrey Filippov's avatar Andrey Filippov

Added main() method to plugins, made debugging of optical plugins

possible
parent aa66e577
......@@ -13,11 +13,15 @@
</parent>
<groupId>com.elphel</groupId>
<artifactId>imagej-elphel</artifactId>
<artifactId>imagej-elphel</artifactId>
<!-- <artifactId>Aberration_Calibration</artifactId> -->
<version>1.0.0</version>
<name>plugins/ImageJ_Elphel.jar</name>
<description>A Maven project implementing imagej-elphel plugin</description>
<name>plugins/ImageJ_Elphel.jar</name>
<!-- <name>plugins/Aberration_Calibration.jar</name> -->
<description>A Maven project implementing imagej-elphel plugin</description>
<dependencies>
<dependency>
......@@ -94,7 +98,8 @@
</execution>
</executions>
<configuration>
<mainClass>Aberration_Calibration</mainClass>
<!-- <mainClass>Aberration_Calibration</mainClass> -->
<mainClass>Eyesis_Correction</mainClass>
</configuration>
</plugin>
......
......@@ -18797,6 +18797,25 @@ use the result to create a rejectiobn mask - if the energy was high, (multiplica
}
/**
* Main method for debugging.
*
* For debugging, it is convenient to have a method that starts ImageJ, loads an
* image and calls the plugin, e.g. after setting breakpoints.
* Grabbed from https://github.com/imagej/minimal-ij1-plugin
* @param args unused
*/
public static void main(String[] args) {
// set the plugins.dir property to make the plugin appear in the Plugins menu
Class<?> clazz = Aberration_Calibration.class;
String url = clazz.getResource("/" + clazz.getName().replace('.', '/') + ".class").toString();
String pluginsDir = url.substring(5, url.length() - clazz.getName().length() - 6);
System.setProperty("plugins.dir", pluginsDir);
// start ImageJ
new ImageJ();
// run the plugin
IJ.runPlugIn(clazz.getName(), "");
}
}
......@@ -33,6 +33,7 @@ import ij.io.FileSaver;
import ij.io.OpenDialog;
import ij.io.Opener;
import ij.plugin.frame.*;
import java.awt.*;
import java.awt.event.*;
import java.io.File;
......@@ -46,6 +47,7 @@ import java.io.OutputStream;
//import java.io.FilenameFilter;
import java.util.Properties;
import java.util.concurrent.atomic.AtomicInteger;
import javax.swing.JFileChooser;
import javax.swing.filechooser.FileFilter;
......@@ -4723,7 +4725,25 @@ G= Y +Pr*(- 2*Kr*(1-Kr))/Kg + Pb*(-2*Kb*(1-Kb))/Kg
}
/* ======================================================================== */
/**
* Main method for debugging.
*
* For debugging, it is convenient to have a method that starts ImageJ, loads an
* image and calls the plugin, e.g. after setting breakpoints.
* Grabbed from https://github.com/imagej/minimal-ij1-plugin
* @param args unused
*/
public static void main(String[] args) {
// set the plugins.dir property to make the plugin appear in the Plugins menu
Class<?> clazz = Aberration_Calibration.class;
String url = clazz.getResource("/" + clazz.getName().replace('.', '/') + ".class").toString();
String pluginsDir = url.substring(5, url.length() - clazz.getName().length() - 6);
System.setProperty("plugins.dir", pluginsDir);
// start ImageJ
new ImageJ();
// run the plugin
IJ.runPlugIn(clazz.getName(), "");
}
}
......@@ -29,13 +29,13 @@
import ij.*;
import ij.io.*;
import ij.plugin.filter.GaussianBlur;
import ij.process.*;
import ij.gui.*;
import java.awt.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import ij.plugin.frame.*;
import java.util.List;
......@@ -14309,6 +14309,25 @@ public void fullPhase(double [][][] aphase) {
}
// return aphase;
}
/**
* Main method for debugging.
*
* For debugging, it is convenient to have a method that starts ImageJ, loads an
* image and calls the plugin, e.g. after setting breakpoints.
* Grabbed from https://github.com/imagej/minimal-ij1-plugin
* @param args unused
*/
public static void main(String[] args) {
// set the plugins.dir property to make the plugin appear in the Plugins menu
Class<?> clazz = Aberration_Calibration.class;
String url = clazz.getResource("/" + clazz.getName().replace('.', '/') + ".class").toString();
String pluginsDir = url.substring(5, url.length() - clazz.getName().length() - 6);
System.setProperty("plugins.dir", pluginsDir);
// start ImageJ
new ImageJ();
// run the plugin
IJ.runPlugIn(clazz.getName(), "");
}
// -------------------------------------
}
......@@ -29,9 +29,10 @@
import ij.*;
import ij.process.*;
import ij.gui.*;
import java.awt.*;
import java.awt.*;
import java.awt.event.*;
import ij.plugin.frame.*;
import java.util.Random;
......@@ -1800,6 +1801,26 @@ public void showCrosstalkKernelsFHT() {
fht_kg.getPowerSpectrum ();
fht_kb.getPowerSpectrum ();
}
/**
* Main method for debugging.
*
* For debugging, it is convenient to have a method that starts ImageJ, loads an
* image and calls the plugin, e.g. after setting breakpoints.
* Grabbed from https://github.com/imagej/minimal-ij1-plugin
* @param args unused
*/
public static void main(String[] args) {
// set the plugins.dir property to make the plugin appear in the Plugins menu
Class<?> clazz = Aberration_Calibration.class;
String url = clazz.getResource("/" + clazz.getName().replace('.', '/') + ".class").toString();
String pluginsDir = url.substring(5, url.length() - clazz.getName().length() - 6);
System.setProperty("plugins.dir", pluginsDir);
// start ImageJ
new ImageJ();
// run the plugin
IJ.runPlugIn(clazz.getName(), "");
}
}
/**
.
......
......@@ -5,10 +5,7 @@ import java.awt.Point;
import java.awt.Rectangle;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
import java.util.ArrayList;
import java.util.BitSet;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
......@@ -26,15 +23,15 @@ public class DenseCorrespondence {
private int tilesX;
private int tilesY;
public String title;
private float [][] pixels=null;
// private float [][] pixels=null;
private float [] centerPixels=null; // disparity arrays combined for the center virtual image
private float [][] syntheticPixels=null; // disparity arrays for individual images restored from the centerPixels
// private float [][] syntheticPixels=null; // disparity arrays for individual images restored from the centerPixels
private BitSet innerMask=null; // will be provided to zMap instances to quickly find that there are no inner (sans padding) pixels
private int [] borderMask=null; // will be provided to zMap +1:top+2:bottom+8:left+16:right (to prevent roll over when iterating around
private double centerPixelsFatZero=0.0;
// private double centerPixelsFatZero=0.0;
// private int [][] imagePairs=null;
private int [][] imagePairIndices=null;
private double [] doubleTileWindow=null;
// private double [] doubleTileWindow=null;
private CyclopeanTile [][] cyclopeanMap=null;
private Rectangle zMapWOI=null; // full: 0,0,tilesX,tilesY
public Photometric photometric=null;
......
......@@ -1343,8 +1343,7 @@ public class EyesisAberrations {
}
showDoubleFloatArrays sdfa_instance=new showDoubleFloatArrays();
if (fileList==null) return false;
ImagePlus impShow=new ImagePlus("CombinedKernels"); // just to show in the same window?
long startTime=System.nanoTime();
......
......@@ -30,7 +30,6 @@ import ij.IJ;
import ij.ImagePlus;
import ij.ImageStack;
import ij.Prefs;
import ij.gui.GenericDialog;
import ij.io.FileInfo;
import ij.io.FileSaver;
import ij.process.ColorProcessor;
......@@ -135,12 +134,6 @@ public class EyesisCorrections {
false); // do not show
} else {
imp=new ImagePlus(paths[nFile]);
if (imp==null){
String msg="Failed to open source image file "+paths[nFile];
System.out.println("Error "+msg);
IJ.showMessage("Error",msg);
break;
}
// (new JP46_Reader_camera(false)).decodeProperiesFromInfo(imp_src); // decode existent properties from info
JP4_INSTANCE.decodeProperiesFromInfo(imp); // decode existent properties from info
}
......@@ -344,11 +337,6 @@ public class EyesisCorrections {
(!this.smoothKernelPaths[chn].equals((String) this.imageNoiseGains[chn].getProperty("smoothKernelPath")))){
ImagePlus imp_kernel_sharp=new ImagePlus(this.sharpKernelPaths[chn]);
if (imp_kernel_sharp==null) {
System.out.println("Failed to open (sharp) kernel stack "+this.sharpKernelPaths[chn]);
this.sharpKernelPaths[chn]=null;
continue;
}
if (imp_kernel_sharp.getStackSize()<3) {
System.out.println("Need a 3-layer stack with kernels");
this.sharpKernelPaths[chn]=null;
......@@ -358,11 +346,6 @@ public class EyesisCorrections {
ImageStack kernel_smooth_stack=null;
if (nonlinParameters.useDiffNoiseGains) {
ImagePlus imp_kernel_smooth=new ImagePlus(this.smoothKernelPaths[chn]);
if (imp_kernel_smooth==null) {
System.out.println("Failed to open (smooth) kernel stack "+this.smoothKernelPaths[chn]);
this.smoothKernelPaths[chn]=null;
continue;
}
if (imp_kernel_smooth.getStackSize()<3) {
System.out.println("Need a 3-layer stack with kernels");
this.smoothKernelPaths[chn]=null;
......@@ -941,10 +924,7 @@ public class EyesisCorrections {
}
// Read deconvolution kernels
ImagePlus imp_sharp_kernels=new ImagePlus(this.sharpKernelPaths[channel]);
if (imp_sharp_kernels==null) {
System.out.println("Failed to open (sharp) kernel stack "+this.sharpKernelPaths[channel]);
return null;
} else if (imp_sharp_kernels.getStackSize()<3) {
if (imp_sharp_kernels.getStackSize()<3) {
System.out.println("Need a 3-layer stack with kernels - file "+this.sharpKernelPaths[channel]);
return null;
}
......@@ -974,10 +954,7 @@ public class EyesisCorrections {
return null;
}
ImagePlus imp_smooth_kernels=new ImagePlus(this.smoothKernelPaths[channel]);
if (imp_smooth_kernels==null) {
System.out.println("Failed to open (smooth) kernel stack "+this.smoothKernelPaths[channel]);
return null;
} else if (imp_smooth_kernels.getStackSize()<3) {
if (imp_smooth_kernels.getStackSize()<3) {
System.out.println("Need a 3-layer stack with kernels - file "+this.smoothKernelPaths[channel]);
return null;
}
......@@ -1078,10 +1055,7 @@ public class EyesisCorrections {
return null;
}
ImagePlus imp_smooth_kernels=new ImagePlus(this.smoothKernelPaths[channel]);
if (imp_smooth_kernels==null) {
System.out.println("Failed to open (smooth) kernel stack "+this.smoothKernelPaths[channel]);
return null;
} else if (imp_smooth_kernels.getStackSize()<3) {
if (imp_smooth_kernels.getStackSize()<3) {
System.out.println("Need a 3-layer stack with kernels - file "+this.smoothKernelPaths[channel]);
return null;
}
......
......@@ -1263,7 +1263,7 @@ private Panel panel1,panel2,panel3,panel4,panel5,panel5a, panel6,panel7,panelPos
"-PC"+((""+POST_PROCESSING.disparityCorrelationParameters.corrPhaseFraction).replace('.','_')),
titles1);
double [][] corr_average=new double [numLayers][length];
// double [][] corr_average=new double [numLayers][length];
for (int numLayer=0;numLayer<numLayers;numLayer++){
for (int index=0;index<length;index++){
......@@ -2988,10 +2988,6 @@ private Panel panel1,panel2,panel3,panel4,panel5,panel5a, panel6,panel7,panelPos
IJ.showMessage("Error","Failed to open configuration file: "+path);
return;
}
if (os==null) {
IJ.showMessage("Error","Failed to open configuration file for writing: "+path);
return;
}
if (useXML) {
try {
properties.storeToXML(os,
......@@ -3277,10 +3273,6 @@ private Panel panel1,panel2,panel3,panel4,panel5,panel5a, panel6,panel7,panelPos
continue;
}
imp_kernels=new ImagePlus(kernelPath);
if (imp_kernels==null) {
System.out.println("Failed to open kernel stack "+kernelPath);
continue;
}
if (imp_kernels.getStackSize()<3) {
System.out.println("Need a 3-layer stack with kernels");
continue;
......@@ -3296,10 +3288,6 @@ private Panel panel1,panel2,panel3,panel4,panel5,panel5a, panel6,panel7,panelPos
continue;
}
imp_kernels2=new ImagePlus(kernelPath);
if (imp_kernels2==null) {
System.out.println("Failed to open gaussian stack "+kernelPath);
continue;
}
if (imp_kernels.getStackSize()<3) {
System.out.println("Need a 3-layer stack with gaussian kernels");
continue;
......@@ -3446,15 +3434,6 @@ private Panel panel1,panel2,panel3,panel4,panel5,panel5a, panel6,panel7,panelPos
}
}
imp_kernels=new ImagePlus(kernelPath);
if (imp_kernels==null) {
System.out.println("Failed to open kernel stack "+kernelPath);
if(!saveResult) {
result[nFile][nChn][nSubChn]=null; // erase results to save memory
runtime.gc();
if (DEBUG_LEVEL>1) System.out.println("--- Free memory="+runtime.freeMemory()+" (of "+runtime.totalMemory()+")");
}
continue;
}
if (imp_kernels.getStackSize()<3) {
System.out.println("Need a 3-layer stack with kernels");
if(!saveResult) {
......@@ -3487,15 +3466,6 @@ private Panel panel1,panel2,panel3,panel4,panel5,panel5a, panel6,panel7,panelPos
continue;
}
imp_kernels=new ImagePlus(kernelPath);
if (imp_kernels==null) {
System.out.println("Failed to open gaussian stack "+kernelPath);
if(!saveResult) {
result[nFile][nChn][nSubChn]=null; // erase results to save memory
runtime.gc();
if (DEBUG_LEVEL>1) System.out.println("--- Free memory="+runtime.freeMemory()+" (of "+runtime.totalMemory()+")");
}
continue;
}
if (imp_kernels.getStackSize()<3) {
System.out.println("Need a 3-layer stack with gaussian kernels");
if(!saveResult) result[nFile][nChn][nSubChn]=null; // erase results to save memory
......@@ -3592,15 +3562,6 @@ private Panel panel1,panel2,panel3,panel4,panel5,panel5a, panel6,panel7,panelPos
continue;
}
imp_kernels=new ImagePlus(kernelPath);
if (imp_kernels==null) {
System.out.println("Failed to open gaussian stack "+kernelPath);
if(!saveResult) {
result[nFile][nChn][nSubChn]=null; // erase results to save memory
runtime.gc();
if (DEBUG_LEVEL>1) System.out.println("--- Free memory="+runtime.freeMemory()+" (of "+runtime.totalMemory()+")");
}
continue;
}
if (imp_kernels.getStackSize()<3) {
System.out.println("Need a 3-layer stack with gaussian kernels");
if(!saveResult) {
......@@ -5702,8 +5663,25 @@ G= Y +Pr*(- 2*Kr*(1-Kr))/Kg + Pb*(-2*Kb*(1-Kb))/Kg
return (1.0+a)*Math.pow(x,gamma)-a;
// return x;
}
/* ======================================================================== */
/* ======================================================================== */
/**
* Main method for debugging.
*
* For debugging, it is convenient to have a method that starts ImageJ, loads an
* image and calls the plugin, e.g. after setting breakpoints.
* Grabbed from https://github.com/imagej/minimal-ij1-plugin
* @param args unused
*/
public static void main(String[] args) {
// set the plugins.dir property to make the plugin appear in the Plugins menu
Class<?> clazz = Aberration_Calibration.class;
String url = clazz.getResource("/" + clazz.getName().replace('.', '/') + ".class").toString();
String pluginsDir = url.substring(5, url.length() - clazz.getName().length() - 6);
System.setProperty("plugins.dir", pluginsDir);
// start ImageJ
new ImageJ();
// run the plugin
IJ.runPlugIn(clazz.getName(), "");
}
}
......@@ -46,7 +46,6 @@ import javax.xml.parsers.ParserConfigurationException;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
......@@ -1312,7 +1311,25 @@ Exception in thread "Thread-3564" java.lang.ArrayIndexOutOfBoundsException: 8970
return true;
}
/**
* Main method for debugging.
*
* For debugging, it is convenient to have a method that starts ImageJ, loads an
* image and calls the plugin, e.g. after setting breakpoints.
* Grabbed from https://github.com/imagej/minimal-ij1-plugin
* @param args unused
*/
public static void main(String[] args) {
// set the plugins.dir property to make the plugin appear in the Plugins menu
Class<?> clazz = Aberration_Calibration.class;
String url = clazz.getResource("/" + clazz.getName().replace('.', '/') + ".class").toString();
String pluginsDir = url.substring(5, url.length() - clazz.getName().length() - 6);
System.setProperty("plugins.dir", pluginsDir);
// start ImageJ
new ImageJ();
// run the plugin
IJ.runPlugIn(clazz.getName(), "");
}
}
......
......@@ -30,13 +30,9 @@ import ij.process.*;
import ij.gui.*;
import java.awt.*;
import java.awt.event.*;
import ij.plugin.frame.*;
//import java.util.Random;
//import java.util.Arrays;
import ij.plugin.frame.*;
import ij.text.*;
......@@ -1757,6 +1753,24 @@ Next is restoration of the original shifts and scales applied before accumulatin
}
/**
* Main method for debugging.
*
* For debugging, it is convenient to have a method that starts ImageJ, loads an
* image and calls the plugin, e.g. after setting breakpoints.
* Grabbed from https://github.com/imagej/minimal-ij1-plugin
* @param args unused
*/
public static void main(String[] args) {
// set the plugins.dir property to make the plugin appear in the Plugins menu
Class<?> clazz = Aberration_Calibration.class;
String url = clazz.getResource("/" + clazz.getName().replace('.', '/') + ".class").toString();
String pluginsDir = url.substring(5, url.length() - clazz.getName().length() - 6);
System.setProperty("plugins.dir", pluginsDir);
// start ImageJ
new ImageJ();
// run the plugin
IJ.runPlugIn(clazz.getName(), "");
}
}
\ No newline at end of file
......@@ -1043,11 +1043,6 @@ public class PixelMapping {
(new JP46_Reader_camera(false)).decodeProperiesFromInfo(impMap);
InterSensor interSensor=new InterSensor(impMap,debugLevel);
this.lastUsedInterSensor=interSensor;
if (interSensor==null){
String msg="Failed to create inter-sensor map from "+path;
IJ.showMessage("Error",msg);
throw new IllegalArgumentException (msg);
}
double [][] aYCbCr=convertToDouble?(new double [8][]):null;
for (int iChn=0;iChn<2;iChn++){
int channel=interSensor.channel[iChn];
......@@ -1135,11 +1130,6 @@ public class PixelMapping {
(new JP46_Reader_camera(false)).decodeProperiesFromInfo(impMap);
InterSensor interSensor=new InterSensor(impMap,debugLevel);
this.lastUsedInterSensor=interSensor;
if (interSensor==null){
String msg="Failed to create inter-sensor map from "+path;
IJ.showMessage("Error",msg);
throw new IllegalArgumentException (msg);
}
for (int iChn=0;iChn<interSensor.channel.length;iChn++){
int channel=interSensor.channel[iChn];
if (this.sensors[channel]==null){
......@@ -9803,7 +9793,7 @@ public class PixelMapping {
double sigma){
if (sigma<=0) return;
double min=this.valueLimits[chn][0];
// double min=this.valueLimits[chn][0];
double step=(this.valueLimits[chn][1]-this.valueLimits[chn][0])/(this.subdivAverage-1);
(new DoubleGaussianBlur()).blurDouble(
......
......@@ -106,12 +106,6 @@ public class PostProcessing {
this.channels[iFile]=postProcessingParameters.getChannelFromSourceTiff(path);
if (debugLevel>0) System.out.println(iFile+": processing "+path+", channel="+this.channels[iFile]);
ImagePlus imp_src=new ImagePlus(path);
if (imp_src==null){
String msg="Failed to open source image file "+path;
System.out.println("Error "+msg);
IJ.showMessage("Error",msg);
return;
}
aYCbCr=argb24ToAYCbCr(imp_src);
for (int i=0;i<aYCbCr.length;i++){
interSensor.overlapImages[4*this.channels[iFile]+i]=aYCbCr[i];
......
......@@ -29,13 +29,13 @@
import ij.*;
import ij.io.*;
import ij.plugin.filter.GaussianBlur;
import ij.process.*;
import ij.gui.*;
import java.awt.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import ij.plugin.frame.*;
import java.util.List;
......@@ -14343,6 +14343,25 @@ public void fullPhase(double [][][] aphase) {
aphase[hsize][size-i][1]=-aphase[hsize][i][1];
}
// return aphase;
}
/**
* Main method for debugging.
*
* For debugging, it is convenient to have a method that starts ImageJ, loads an
* image and calls the plugin, e.g. after setting breakpoints.
* Grabbed from https://github.com/imagej/minimal-ij1-plugin
* @param args unused
*/
public static void main(String[] args) {
// set the plugins.dir property to make the plugin appear in the Plugins menu
Class<?> clazz = Aberration_Calibration.class;
String url = clazz.getResource("/" + clazz.getName().replace('.', '/') + ".class").toString();
String pluginsDir = url.substring(5, url.length() - clazz.getName().length() - 6);
System.setProperty("plugins.dir", pluginsDir);
// start ImageJ
new ImageJ();
// run the plugin
IJ.runPlugIn(clazz.getName(), "");
}
// -------------------------------------
......
......@@ -31,24 +31,24 @@ import ij.process.*;
import ij.gui.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import ij.plugin.frame.*;
import ij.plugin.frame.*;
import ij.text.*;
// read XML file from motor driver
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.DocumentBuilder;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
//import java.io.File;
import java.net.*;
import org.xml.sax.SAXException;
import javax.xml.parsers.ParserConfigurationException;
import java.lang.Integer;
......@@ -2292,11 +2292,6 @@ double [][][][]calcMaxScanTargetOrientColor(double[][][][][] scanData, int wnd,
double [][][][]rslt= new double[scanData[0].length][scanData[0][0].length][2][3];
double [] arrayToMax=new double [scanData.length]; // number of samples
int scan,t,n,orient;
if (scanData==null) {
IJ.showMessage("ERROR in calcMaxScanTargetOrientColor","scanData==null");
return null;
}
for (scan=0; scan<rslt.length; scan++) for (t=0; t<rslt[0].length;t++) for (orient=0;orient<2;orient++) {
for (n=0;n<scanData.length;n++) arrayToMax[n]=scanData[n][0][t][orient][1]; // red
rslt[scan][t][orient][0]=findMaxInWndArray(arrayToMax, wnd, calibMaxSlopes);
......@@ -4079,6 +4074,25 @@ double calcGoalDiff(double[][]resolutions, // resolutions for one target [v.h][G
}
return motorPositions;
}
/**
* Main method for debugging.
*
* For debugging, it is convenient to have a method that starts ImageJ, loads an
* image and calls the plugin, e.g. after setting breakpoints.
* Grabbed from https://github.com/imagej/minimal-ij1-plugin
* @param args unused
*/
public static void main(String[] args) {
// set the plugins.dir property to make the plugin appear in the Plugins menu
Class<?> clazz = Aberration_Calibration.class;
String url = clazz.getResource("/" + clazz.getName().replace('.', '/') + ".class").toString();
String pluginsDir = url.substring(5, url.length() - clazz.getName().length() - 6);
System.setProperty("plugins.dir", pluginsDir);
// start ImageJ
new ImageJ();
// run the plugin
IJ.runPlugIn(clazz.getName(), "");
}
}
......@@ -29,15 +29,16 @@
import ij.*;
import ij.process.*;
import ij.gui.*;
import java.awt.*;
import java.awt.*;
import java.awt.event.*;
import ij.plugin.frame.*;
import java.util.List;
import java.util.ArrayList;
import ij.text.*;
import ij.text.*;
import java.lang.Integer;
......@@ -1046,12 +1047,24 @@ private float[] FFTHalf2FHT (double [][][] fft) {
}
return fht_pixels;
}
/**
* Main method for debugging.
*
* For debugging, it is convenient to have a method that starts ImageJ, loads an
* image and calls the plugin, e.g. after setting breakpoints.
* Grabbed from https://github.com/imagej/minimal-ij1-plugin
* @param args unused
*/
public static void main(String[] args) {
// set the plugins.dir property to make the plugin appear in the Plugins menu
Class<?> clazz = Aberration_Calibration.class;
String url = clazz.getResource("/" + clazz.getName().replace('.', '/') + ".class").toString();
String pluginsDir = url.substring(5, url.length() - clazz.getName().length() - 6);
System.setProperty("plugins.dir", pluginsDir);
// start ImageJ
new ImageJ();
// run the plugin
IJ.runPlugIn(clazz.getName(), "");
}
}
......@@ -8,7 +8,7 @@
#
# If something like ("<arg>") is appended to the class name, the setup() method
# will get that as arg parameter; otherwise arg is simply the empty string.
Process, "Process Pixels", Process_Pixels
Process, "Aberration Calibration", Aberration_Calibration
#Plugins, "Aberration Calibration", Aberration_Calibration
#Process, "Aberration Correction", Aberration_Correction
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment