Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
imagej-elphel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Elphel
imagej-elphel
Commits
2a50a77c
Commit
2a50a77c
authored
Jul 21, 2025
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AWT->Swing
parent
0123f06e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
485 additions
and
62 deletions
+485
-62
Eyesis_Correction.java
.../java/com/elphel/imagej/correction/Eyesis_Correction.java
+485
-62
No files found.
src/main/java/com/elphel/imagej/correction/Eyesis_Correction.java
View file @
2a50a77c
...
...
@@ -82,8 +82,11 @@ import javax.imageio.metadata.IIOMetadataFormatImpl;
import
javax.imageio.metadata.IIOMetadataNode
;
//import javax.imageio.plugins.tiff.ExifGPSTagSet;
import
javax.imageio.plugins.tiff.TIFFDirectory
;
import
javax.swing.JButton
;
//import javax.imageio.plugins.tiff.TIFFTagSet;
import
javax.swing.JFileChooser
;
import
javax.swing.JFrame
;
import
javax.swing.JPanel
;
import
javax.swing.filechooser.FileFilter
;
import
org.json.JSONException
;
...
...
@@ -171,19 +174,10 @@ public class Eyesis_Correction implements PlugIn, ActionListener {
*
*/
private
Boolean
headless
=
GraphicsEnvironment
.
getLocalGraphicsEnvironment
().
isHeadlessInstance
();
private
PlugInFrame
plugInFrame
;
String
prefsPath
;
// private static final long serialVersionUID = -1507307664341265263L;
private
Panel
panel1
,
panel2
,
panel3
,
panel4
,
panel5
,
panel5a
,
panel6
,
panel7
,
panelPostProcessing1
,
panelPostProcessing2
,
panelPostProcessing3
,
panelDct1
,
panelClt1
,
panelClt2
,
panelClt3
,
panelClt4
,
panelClt5
,
panelClt5aux
,
panelClt_GPU
,
panelLWIR
,
panelLWIR16
,
panelLWIRWorld
,
panelOrange
;
JP46_Reader_camera
JP4_INSTANCE
=
null
;
// private deBayerScissors debayer_instance;
private
DoubleFHT
FHT_INSTANCE
;
static
Frame
instance
;
private
DoubleFHT
FHT_INSTANCE
=
new
DoubleFHT
();
static
Properties
PROPERTIES
=
new
Properties
();
public
static
int
DEBUG_LEVEL
=
1
;
public
static
int
MASTER_DEBUG_LEVEL
=
1
;
...
...
@@ -485,6 +479,20 @@ public class Eyesis_Correction implements PlugIn, ActionListener {
public
ImagePlus
CORRELATE_IMP
=
null
;
public
TensorflowInferModel
TENSORFLOW_INFER_MODEL
=
null
;
public
boolean
use_swing
=
true
;
// false;
private
PlugInFrame
plugInFrame
;
private
JFrame
plugInJFrame
;
// static Frame instance;
private
Panel
panel1
,
panel2
,
panel3
,
panel4
,
panel5
,
panel5a
,
panel6
,
panel7
,
panelPostProcessing1
,
panelPostProcessing2
,
panelPostProcessing3
,
panelDct1
,
panelClt1
,
panelClt2
,
panelClt3
,
panelClt4
,
panelClt5
,
panelClt5aux
,
panelClt_GPU
,
panelLWIR
,
panelLWIR16
,
panelLWIRWorld
,
panelOrange
;
private
JPanel
jpanel1
,
jpanel2
,
jpanel3
,
jpanel4
,
jpanel5
,
jpanel5a
,
jpanel6
,
jpanel7
,
jpanelPostProcessing1
,
jpanelPostProcessing2
,
jpanelPostProcessing3
,
jpanelDct1
,
jpanelClt1
,
jpanelClt2
,
jpanelClt3
,
jpanelClt4
,
jpanelClt5
,
jpanelClt5aux
,
jpanelClt_GPU
,
jpanelLWIR
,
jpanelLWIR16
,
jpanelLWIRWorld
,
jpanelOrange
;
// EyesisTopFrame eyesisTopFrame = new EyesisTopFrame();
// System.out.println("Launched EyesisTopFrame");
@Override
public
void
run
(
String
arg
)
{
String
options
=
Macro
.
getOptions
();
...
...
@@ -496,10 +504,18 @@ public class Eyesis_Correction implements PlugIn, ActionListener {
}
if
(
IJ
.
versionLessThan
(
"1.43q"
))
return
;
/*
if (instance != null) {
instance.toFront();
return;
}
*/
/*
if (plugInFrame != null) {
plugInFrame.toFront();
return;
}
*/
try
{
loadPrefs
();
}
catch
(
IOException
e1
)
{
...
...
@@ -510,11 +526,423 @@ public class Eyesis_Correction implements PlugIn, ActionListener {
if
(
options
!=
null
||
headless
)
{
processFiles
();
}
else
{
initGui
();
if
(
use_swing
)
{
initGuiSwing
();
}
else
{
initGuiAWT
();
}
}
}
public
void
initGui
()
{
public
void
initGuiSwing
()
{
/// EyesisTopFrame eyesisTopFrame = new EyesisTopFrame();
Color
color_configure
=
new
Color
(
200
,
200
,
160
);
Color
color_configure_aux
=
new
Color
(
190
,
190
,
180
);
Color
color_process
=
new
Color
(
180
,
180
,
240
);
Color
color_process_aux
=
new
Color
(
175
,
175
,
250
);
Color
color_conf_process
=
new
Color
(
180
,
240
,
240
);
Color
color_conf_process_aux
=
new
Color
(
175
,
235
,
250
);
Color
color_restore
=
new
Color
(
160
,
240
,
160
);
Color
color_stop
=
new
Color
(
255
,
160
,
160
);
Color
color_report
=
new
Color
(
180
,
220
,
180
);
plugInJFrame
=
new
JFrame
(
"Eyesis_Correction"
)
{
private
static
final
long
serialVersionUID
=
-
4138832568507690332L
;
@Override
public
void
processWindowEvent
(
WindowEvent
e
)
{
super
.
processWindowEvent
(
e
);
if
(
e
.
getID
()
==
WindowEvent
.
WINDOW_CLOSING
)
{
plugInJFrame
=
null
;
// instance = null;
}
}
};
// Font font = plugInJFrame.getFont();
// instance = plugInJFrame;
plugInJFrame
.
addKeyListener
(
IJ
.
getInstance
());
// int menuRows=4 + (ADVANCED_MODE?4:0) + (MODE_3D?3:0) + (DCT_MODE?6:0) + (GPU_MODE?1:0) +(LWIR_MODE?2:0);
int
menuRows
=
4
+
(
ADVANCED_MODE
?
4
:
0
)
+
(
MODE_3D
?
3
:
0
)
+
(
DCT_MODE
?
7
:
0
)
+
(
GPU_MODE
?
1
:
0
)
+
(
LWIR_MODE
?
4
:
0
);
plugInJFrame
.
setLayout
(
new
GridLayout
(
menuRows
,
1
));
jpanel6
=
new
JPanel
();
jpanel6
.
setLayout
(
new
GridLayout
(
1
,
0
,
5
,
5
));
addJButton
(
"Save"
,
jpanel6
,
color_process
);
// , "Save configuration");
addJButton
(
"Save Clean"
,
jpanel6
,
color_process
);
// , "Save clean configuration");
addJButton
(
"Restore"
,
jpanel6
,
color_restore
);
// , "Restore configuration");
addJButton
(
"Stop"
,
jpanel6
,
color_stop
);
addJButton
(
"Abort"
,
jpanel6
,
color_stop
);
plugInJFrame
.
add
(
jpanel6
);
jpanel5
=
new
JPanel
();
jpanel5
.
setLayout
(
new
GridLayout
(
1
,
0
,
5
,
5
));
addJButton
(
"Configure spilt"
,
jpanel5
,
color_configure
);
addJButton
(
"Configure demosaic"
,
jpanel5
,
color_configure
);
plugInJFrame
.
add
(
jpanel5
);
jpanel5a
=
new
JPanel
();
jpanel5a
.
setLayout
(
new
GridLayout
(
1
,
0
,
5
,
5
));
addJButton
(
"Configure convolution"
,
jpanel5a
,
color_configure
);
addJButton
(
"Configure denoise"
,
jpanel5a
,
color_configure
);
addJButton
(
"Configure color"
,
jpanel5a
,
color_configure
);
addJButton
(
"Configure AUX color"
,
jpanel5a
,
color_configure_aux
);
// addJButton("Channel gains", jpanel5a, color_configure);
addJButton
(
"Configure RGB"
,
jpanel5a
,
color_configure
);
plugInJFrame
.
add
(
jpanel5a
);
// Debug/development options
if
(
ADVANCED_MODE
)
{
jpanel1
=
new
JPanel
();
jpanel1
.
setLayout
(
new
GridLayout
(
1
,
0
,
5
,
5
));
// rows, columns, vgap, hgap
addJButton
(
"Split Image"
,
jpanel1
,
null
);
addJButton
(
"Debayer Image"
,
jpanel1
,
null
);
plugInJFrame
.
add
(
jpanel1
);
jpanel2
=
new
JPanel
();
jpanel2
.
setLayout
(
new
GridLayout
(
1
,
0
,
5
,
5
));
addJButton
(
"Select kernel stack"
,
jpanel2
,
null
);
addJButton
(
"Convolve with stack"
,
jpanel2
,
null
);
plugInJFrame
.
add
(
jpanel2
);
jpanel3
=
new
JPanel
();
jpanel3
.
setLayout
(
new
GridLayout
(
1
,
0
,
5
,
5
));
addJButton
(
"Select lo-res"
,
jpanel3
,
null
);
addJButton
(
"Combine pair"
,
jpanel3
,
null
);
addJButton
(
"Colors"
,
jpanel3
,
null
);
addJButton
(
"RGB"
,
jpanel3
,
null
);
plugInJFrame
.
add
(
jpanel3
);
jpanel4
=
new
JPanel
();
jpanel4
.
setLayout
(
new
GridLayout
(
1
,
0
,
5
,
5
));
addJButton
(
"Test"
,
jpanel4
,
null
);
addJButton
(
"Test Debayer"
,
jpanel4
,
null
);
plugInJFrame
.
add
(
jpanel4
);
}
jpanel7
=
new
JPanel
();
jpanel7
.
setLayout
(
new
GridLayout
(
1
,
0
,
5
,
5
));
addJButton
(
"Configure correction"
,
jpanel7
,
color_configure
);
addJButton
(
"Channel gains/colors"
,
jpanel7
,
color_configure
);
addJButton
(
"Configure warping"
,
jpanel7
,
color_conf_process
);
addJButton
(
"Select source files"
,
jpanel7
,
color_configure
);
addJButton
(
"Select source sets"
,
jpanel7
,
color_configure
);
addJButton
(
"Process files"
,
jpanel7
,
color_process
);
if
(
ADVANCED_MODE
)
{
addJButton
(
"Tiff Writer"
,
jpanel7
,
null
);
addJButton
(
"Tiff Properties"
,
jpanel7
,
null
);
addJButton
(
"Add TIFF resolution"
,
jpanel7
,
null
);
}
plugInJFrame
.
add
(
jpanel7
);
if
(
MODE_3D
)
{
jpanelPostProcessing1
=
new
JPanel
();
jpanelPostProcessing1
.
setLayout
(
new
GridLayout
(
1
,
0
,
5
,
5
));
addJButton
(
"Configure PP"
,
jpanelPostProcessing1
,
color_configure
);
addJButton
(
"Source PP"
,
jpanelPostProcessing1
,
color_configure
);
addJButton
(
"ConvertPP"
,
jpanelPostProcessing1
,
color_process
);
addJButton
(
"Linear Features"
,
jpanelPostProcessing1
,
null
);
addJButton
(
"Intercam correlations"
,
jpanelPostProcessing1
,
null
);
plugInJFrame
.
add
(
jpanelPostProcessing1
,
null
);
jpanelPostProcessing2
=
new
JPanel
();
jpanelPostProcessing2
.
setLayout
(
new
GridLayout
(
1
,
0
,
5
,
5
));
addJButton
(
"Tile correlations"
,
jpanelPostProcessing2
,
null
);
addJButton
(
"Load correlations"
,
jpanelPostProcessing2
,
null
);
addJButton
(
"Section correlations"
,
jpanelPostProcessing2
,
null
);
addJButton
(
"Setup Z-map"
,
jpanelPostProcessing2
,
null
);
addJButton
(
"Fill FG gaps"
,
jpanelPostProcessing2
,
null
);
addJButton
(
"Filter Z-map"
,
jpanelPostProcessing2
,
null
);
addJButton
(
"Occluding FG"
,
jpanelPostProcessing2
,
null
);
plugInJFrame
.
add
(
jpanelPostProcessing2
,
null
);
jpanelPostProcessing3
=
new
JPanel
();
jpanelPostProcessing3
.
setLayout
(
new
GridLayout
(
1
,
0
,
5
,
5
));
addJButton
(
"Refine Disparities"
,
jpanelPostProcessing3
,
null
);
addJButton
(
"Init Photometry"
,
jpanelPostProcessing3
,
null
);
addJButton
(
"Plane Likely"
,
jpanelPostProcessing3
,
null
);
plugInJFrame
.
add
(
jpanelPostProcessing3
,
null
);
}
if
(
DCT_MODE
)
{
jpanelDct1
=
new
JPanel
();
jpanelDct1
.
setLayout
(
new
GridLayout
(
1
,
0
,
5
,
5
));
// rows, columns, vgap, hgap
addJButton
(
"DCT test 1"
,
jpanelDct1
,
color_process
);
addJButton
(
"select MDCT image"
,
jpanelDct1
,
color_configure
);
addJButton
(
"MDCT scale"
,
jpanelDct1
,
color_process
);
addJButton
(
"MDCT stack"
,
jpanelDct1
,
color_process
);
addJButton
(
"DCT test 3"
,
jpanelDct1
,
color_process
);
addJButton
(
"DCT test 4"
,
jpanelDct1
,
color_process
);
addJButton
(
"Test Kernel Factorization"
,
jpanelDct1
,
color_process
);
addJButton
(
"Min Kernel Factorization"
,
jpanelDct1
,
color_process
);
addJButton
(
"Select kernels image"
,
jpanelDct1
,
color_configure
);
addJButton
(
"Create DCT kernels"
,
jpanelDct1
,
color_process
);
addJButton
(
"Read DCT kernels"
,
jpanelDct1
,
color_process
);
addJButton
(
"Reset DCT kernels"
,
jpanelDct1
,
color_stop
);
addJButton
(
"Setup DCT parameters"
,
jpanelDct1
,
color_configure
);
addJButton
(
"DCT process files"
,
jpanelDct1
,
color_process
);
plugInJFrame
.
add
(
jpanelDct1
);
}
if
(
DCT_MODE
)
{
jpanelClt1
=
new
JPanel
();
jpanelClt1
.
setLayout
(
new
GridLayout
(
1
,
0
,
5
,
5
));
// rows, columns, vgap, hgap
addJButton
(
"Select CLT image"
,
jpanelClt1
,
color_configure
);
addJButton
(
"CLT stack"
,
jpanelClt1
,
color_process
);
addJButton
(
"Select second CLT image"
,
jpanelClt1
,
color_configure
);
addJButton
(
"CLT correlate"
,
jpanelClt1
,
color_process
);
addJButton
(
"Reset Geometry"
,
jpanelClt1
,
color_stop
);
addJButton
(
"Reset AUX Geometry"
,
jpanelClt1
,
color_stop
);
addJButton
(
"Create CLT kernels"
,
jpanelClt1
,
color_process
);
addJButton
(
"Create AUX CLT kernels"
,
jpanelClt1
,
color_process
);
addJButton
(
"Read CLT kernels"
,
jpanelClt1
,
color_process_aux
);
addJButton
(
"Reset CLT kernels"
,
jpanelClt1
,
color_stop
);
addJButton
(
"CLT process files"
,
jpanelClt1
,
color_process
);
addJButton
(
"CLT process sets"
,
jpanelClt1
,
color_process
);
plugInJFrame
.
add
(
jpanelClt1
);
}
if
(
DCT_MODE
)
{
jpanelClt2
=
new
JPanel
();
jpanelClt2
.
setLayout
(
new
GridLayout
(
1
,
0
,
5
,
5
));
// rows, columns, vgap, hgap
addJButton
(
"Setup CLT parameters"
,
jpanelClt2
,
color_configure
);
addJButton
(
"CLT 4 images"
,
jpanelClt2
,
color_conf_process
);
addJButton
(
"CLT disparity scan"
,
jpanelClt2
,
color_conf_process
);
addJButton
(
"CLT reset fine corr"
,
jpanelClt2
,
color_stop
);
addJButton
(
"CLT reset extrinsic corr"
,
jpanelClt2
,
color_stop
);
addJButton
(
"ERS reset"
,
jpanelClt2
,
color_stop
);
addJButton
(
"CLT show geometry"
,
jpanelClt2
,
color_configure
);
addJButton
(
"CLT show fine corr"
,
jpanelClt2
,
color_report
);
addJButton
(
"CLT apply fine corr"
,
jpanelClt2
,
color_process
);
addJButton
(
"CLT test fine corr"
,
jpanelClt2
,
color_process
);
addJButton
(
"CLT process fine corr"
,
jpanelClt2
,
color_conf_process
);
addJButton
(
"CLT infinity corr"
,
jpanelClt2
,
color_conf_process
);
addJButton
(
"CLT ext infinity corr"
,
jpanelClt2
,
color_conf_process
);
addJButton
(
"CLT reset 3D"
,
jpanelClt2
,
color_stop
);
addJButton
(
"MAIN extrinsics"
,
jpanelClt2
,
color_process
);
addJButton
(
"CLT Poly corr"
,
jpanelClt2
,
color_process
);
addJButton
(
"DRY RUN"
,
jpanelClt2
,
color_configure
);
addJButton
(
"CLT 3D"
,
jpanelClt2
,
color_process
);
addJButton
(
"CLT planes"
,
jpanelClt2
,
color_conf_process
);
addJButton
(
"CLT ASSIGN"
,
jpanelClt2
,
color_process
);
addJButton
(
"CLT OUT 3D"
,
jpanelClt2
,
color_process
);
plugInJFrame
.
add
(
jpanelClt2
);
}
if
(
DCT_MODE
)
{
jpanelClt3
=
new
JPanel
();
jpanelClt3
.
setLayout
(
new
GridLayout
(
1
,
0
,
5
,
5
));
// rows, columns, vgap, hgap
addJButton
(
"Setup CLT"
,
jpanelClt3
,
color_configure
);
addJButton
(
"Infinity offset"
,
jpanelClt3
,
color_configure
);
addJButton
(
"Setup CLT Batch parameters"
,
jpanelClt3
,
color_configure
);
addJButton
(
"CLT batch process"
,
jpanelClt3
,
color_process
);
addJButton
(
"CM Test"
,
jpanelClt3
,
color_stop
);
addJButton
(
"Show scan"
,
jpanelClt3
,
color_report
);
addJButton
(
"Show all scans"
,
jpanelClt3
,
color_report
);
addJButton
(
"Periodic"
,
jpanelClt3
,
color_configure
);
plugInJFrame
.
add
(
jpanelClt3
);
}
if
(
DCT_MODE
)
{
jpanelClt4
=
new
JPanel
();
jpanelClt4
.
setLayout
(
new
GridLayout
(
1
,
0
,
5
,
5
));
// rows, columns, vgap, hgap
addJButton
(
"Import Aux"
,
jpanelClt4
,
color_restore
);
addJButton
(
"Setup CLT Batch parameters"
,
jpanelClt4
,
color_configure
);
addJButton
(
"CLT rig edit"
,
jpanelClt4
,
color_configure
);
addJButton
(
"Rig offset"
,
jpanelClt4
,
color_configure
);
addJButton
(
"Save offset"
,
jpanelClt4
,
color_process
);
addJButton
(
"SHOW extrinsics"
,
jpanelClt4
,
color_report
);
addJButton
(
"RIG DSI"
,
jpanelClt4
,
color_conf_process
);
addJButton
(
"MAIN extrinsics"
,
jpanelClt4
,
color_process
);
addJButton
(
"AUX extrinsics"
,
jpanelClt4
,
color_process
);
addJButton
(
"RIG extrinsics"
,
jpanelClt4
,
color_conf_process
);
addJButton
(
"SAVE extrinsics"
,
jpanelClt4
,
color_process
);
// , "Save configuration");
addJButton
(
"Rig8 images"
,
jpanelClt4
,
color_conf_process
);
addJButton
(
"Reset GT"
,
jpanelClt4
,
color_stop
);
addJButton
(
"Ground truth"
,
jpanelClt4
,
color_conf_process
);
addJButton
(
"Show biscan"
,
jpanelClt4
,
color_report
);
addJButton
(
"Poles GT"
,
jpanelClt4
,
color_process
);
addJButton
(
"ML export"
,
jpanelClt4
,
color_conf_process
);
addJButton
(
"JP4 copy"
,
jpanelClt4
,
color_conf_process
);
addJButton
(
"DSI show"
,
jpanelClt4
,
color_report
);
addJButton
(
"Rig batch"
,
jpanelClt4
,
color_process
);
plugInJFrame
.
add
(
jpanelClt4
);
}
if
(
DCT_MODE
)
{
jpanelClt5
=
new
JPanel
();
jpanelClt5
.
setLayout
(
new
GridLayout
(
1
,
0
,
5
,
5
));
// rows, columns, vgap, hgap
addJButton
(
"LIST extrinsics"
,
jpanelClt5
,
color_report
);
addJButton
(
"DSI histogram"
,
jpanelClt5
,
color_report
);
addJButton
(
"ML recalc"
,
jpanelClt5
,
color_process
);
addJButton
(
"Inter Test"
,
jpanelClt5
,
color_stop
);
addJButton
(
"Inter Pairs"
,
jpanelClt5
,
color_process
);
addJButton
(
"Inter LMA"
,
jpanelClt5
,
color_stop
);
addJButton
(
"Inter Series"
,
jpanelClt5
,
color_process
);
addJButton
(
"Inter Accumulate"
,
jpanelClt5
,
color_process
);
addJButton
(
"Inter Noise"
,
jpanelClt5
,
color_process
);
addJButton
(
"Inter Debug Noise"
,
jpanelClt5
,
color_report
);
addJButton
(
"Noise Stats"
,
jpanelClt5
,
color_process
);
addJButton
(
"Test 1D"
,
jpanelClt5
,
color_process
);
addJButton
(
"Colorize Depth"
,
jpanelClt5
,
color_process
);
addJButton
(
"Main LY series"
,
jpanelClt5
,
color_process
);
plugInJFrame
.
add
(
jpanelClt5
);
}
if
(
DCT_MODE
)
{
jpanelClt5aux
=
new
JPanel
();
jpanelClt5aux
.
setLayout
(
new
GridLayout
(
1
,
0
,
5
,
5
));
// rows, columns, vgap, hgap
addJButton
(
"LIST extrinsics"
,
jpanelClt5aux
,
color_report
);
addJButton
(
"Aux Build Series"
,
jpanelClt5aux
,
color_stop
);
addJButton
(
"Aux Inter Test"
,
jpanelClt5aux
,
color_stop
);
addJButton
(
"Aux Inter Pairs"
,
jpanelClt5aux
,
color_process
);
addJButton
(
"Aux Inter LMA"
,
jpanelClt5aux
,
color_stop
);
addJButton
(
"Aux Inter Series"
,
jpanelClt5aux
,
color_process
);
addJButton
(
"Aux Inter Accumulate"
,
jpanelClt5aux
,
color_process
);
addJButton
(
"Inter Noise Aux"
,
jpanelClt5aux
,
color_process
);
addJButton
(
"Batch Noise Aux"
,
jpanelClt5aux
,
color_report
);
addJButton
(
"Noise Stats Aux"
,
jpanelClt5aux
,
color_process
);
addJButton
(
"Colorize Depth"
,
jpanelClt5aux
,
color_process
);
addJButton
(
"Inter Intra ML"
,
jpanelClt5aux
,
color_report
);
addJButton
(
"Aux LY series"
,
jpanelClt5aux
,
color_process
);
plugInJFrame
.
add
(
jpanelClt5aux
);
}
if
(
GPU_MODE
)
{
jpanelClt_GPU
=
new
JPanel
();
jpanelClt_GPU
.
setLayout
(
new
GridLayout
(
1
,
0
,
5
,
5
));
// rows, columns, vgap, hgap
addJButton
(
"JCUDA TEST"
,
jpanelClt_GPU
,
null
);
addJButton
(
"TF TEST"
,
jpanelClt_GPU
,
null
);
addJButton
(
"GPU simulate"
,
jpanelClt_GPU
,
color_conf_process
);
addJButton
(
"GPU RUN"
,
jpanelClt_GPU
,
color_conf_process
);
// addJButton("ShowGPU", jpanelClt_GPU, color_conf_process);
addJButton
(
"LWIR_TEST"
,
jpanelClt_GPU
,
color_conf_process
);
addJButton
(
"LWIR_ACQUIRE"
,
jpanelClt_GPU
,
color_conf_process
);
addJButton
(
"ERS reset"
,
jpanelClt2
,
color_stop
);
addJButton
(
"IMU main"
,
jpanelClt_GPU
,
color_conf_process
);
addJButton
(
"ERS main"
,
jpanelClt_GPU
,
color_process
);
addJButton
(
"IMU aux"
,
jpanelClt_GPU
,
color_conf_process_aux
);
addJButton
(
"ERS aux"
,
jpanelClt_GPU
,
color_process_aux
);
addJButton
(
"Rotations_test"
,
jpanelClt_GPU
,
color_stop
);
addJButton
(
"GPU simulate"
,
jpanelClt_GPU
,
color_conf_process
);
plugInJFrame
.
add
(
jpanelClt_GPU
);
}
if
(
LWIR_MODE
)
{
jpanelLWIR
=
new
JPanel
();
jpanelLWIR
.
setLayout
(
new
GridLayout
(
1
,
0
,
5
,
5
));
// rows, columns, vgap, hgap
addJButton
(
"Setup CLT Batch parameters"
,
jpanelLWIR
,
color_configure
);
addJButton
(
"Reset Geometry"
,
jpanelLWIR
,
color_stop
);
addJButton
(
"Reset AUX Geometry"
,
jpanelLWIR
,
color_stop
);
addJButton
(
"Create CLT kernels"
,
jpanelLWIR
,
color_process
);
addJButton
(
"Create AUX CLT kernels"
,
jpanelLWIR
,
color_process_aux
);
addJButton
(
"Select source sets"
,
jpanelLWIR
,
color_configure
);
addJButton
(
"Configure color"
,
jpanelLWIR
,
color_configure
);
addJButton
(
"CORR TEST"
,
jpanelLWIR
,
color_conf_process
);
addJButton
(
"CLT 4 images"
,
jpanelLWIR
,
color_conf_process
);
addJButton
(
"CLT 3D"
,
jpanelLWIR
,
color_process
);
addJButton
(
"CLT planes"
,
jpanelLWIR
,
color_conf_process
);
addJButton
(
"CLT ASSIGN"
,
jpanelLWIR
,
color_process
);
addJButton
(
"CLT OUT 3D"
,
jpanelLWIR
,
color_process
);
addJButton
(
"Configure AUX color"
,
jpanelLWIR
,
color_configure_aux
);
addJButton
(
"AUX 4 images"
,
jpanelLWIR
,
color_conf_process_aux
);
addJButton
(
"AUX 3D"
,
jpanelLWIR
,
color_process
);
addJButton
(
"AUX planes"
,
jpanelLWIR
,
color_conf_process_aux
);
addJButton
(
"AUX ASSIGN"
,
jpanelLWIR
,
color_process_aux
);
addJButton
(
"AUX OUT 3D"
,
jpanelLWIR
,
color_process_aux
);
addJButton
(
"Main img AUX"
,
jpanelLWIR
,
color_process_aux
);
addJButton
(
"Main to AUX"
,
jpanelLWIR
,
color_process_aux
);
addJButton
(
"LWIR batch"
,
jpanelClt4
,
color_process
);
// addJButton("LWIR_TEST", jpanelLWIR, color_conf_process);
// addJButton("LWIR_ACQUIRE", jpanelLWIR, color_conf_process);
plugInJFrame
.
add
(
jpanelLWIR
);
jpanelLWIR16
=
new
JPanel
();
jpanelLWIR16
.
setLayout
(
new
GridLayout
(
1
,
0
,
5
,
5
));
// rows, columns, vgap, hgap
addJButton
(
"SHOW extrinsics"
,
jpanelLWIR16
,
color_report
);
addJButton
(
"Reset Geometry"
,
jpanelLWIR16
,
color_stop
);
addJButton
(
"Reset AUX Geometry"
,
jpanelLWIR16
,
color_stop
);
addJButton
(
"Generate Sym Vectors"
,
jpanelLWIR16
,
color_configure
);
addJButton
(
"Image Properties"
,
jpanelLWIR16
,
color_conf_process
);
addJButton
(
"Illustrations Configure"
,
jpanelLWIR16
,
color_conf_process
);
addJButton
(
"Footage Organize"
,
jpanelLWIR16
,
color_conf_process
);
addJButton
(
"Super batch"
,
jpanelLWIR16
,
color_process
);
addJButton
(
"Remove source paths"
,
jpanelLWIR16
,
color_stop
);
plugInJFrame
.
add
(
jpanelLWIR16
);
jpanelLWIRWorld
=
new
JPanel
();
jpanelLWIRWorld
.
setLayout
(
new
GridLayout
(
1
,
0
,
5
,
5
));
// rows, columns, vgap, hgap
addJButton
(
"Aux Build Series"
,
jpanelLWIRWorld
,
color_stop
);
addJButton
(
"Build World"
,
jpanelLWIRWorld
,
color_process
);
addJButton
(
"Test IMX5"
,
jpanelLWIRWorld
,
color_process
);
addJButton
(
"Show mice"
,
jpanelLWIRWorld
,
color_process
);
addJButton
(
"Set pair"
,
jpanelLWIRWorld
,
color_process
);
addJButton
(
"Warp pair"
,
jpanelLWIRWorld
,
color_process
);
addJButton
(
"Read Tiff"
,
jpanelLWIRWorld
,
color_process
);
addJButton
(
"Test video"
,
jpanelLWIRWorld
,
color_process
);
addJButton
(
"Ortho"
,
jpanelLWIRWorld
,
color_process
);
addJButton
(
"Ortho Pairs"
,
jpanelLWIRWorld
,
color_process
);
addJButton
(
"Manual pair"
,
jpanelLWIRWorld
,
color_process
);
addJButton
(
"Extract Objects"
,
jpanelLWIRWorld
,
color_process
);
addJButton
(
"Mismatched resolutions"
,
jpanelLWIRWorld
,
color_process
);
addJButton
(
"Generate DATI"
,
jpanelLWIRWorld
,
color_process
);
addJButton
(
"Create mine"
,
jpanelLWIRWorld
,
color_process
);
addJButton
(
"Pattern correlate"
,
jpanelLWIRWorld
,
color_process
);
addJButton
(
"Properties compare"
,
jpanelLWIRWorld
,
color_process
);
plugInJFrame
.
add
(
jpanelLWIRWorld
);
jpanelOrange
=
new
JPanel
();
jpanelOrange
.
setLayout
(
new
GridLayout
(
1
,
0
,
5
,
5
));
// rows, columns, vgap, hgap
addJButton
(
"Test Orange"
,
jpanelOrange
,
color_process
);
addJButton
(
"Process Merged"
,
jpanelOrange
,
color_process
);
addJButton
(
"Vegetation LMA"
,
jpanelOrange
,
color_process
);
addJButton
(
"Combine LMA Segments"
,
jpanelOrange
,
color_process
);
addJButton
(
"Render synthetic"
,
jpanelOrange
,
color_process
);
addJButton
(
"Generate LWIR target"
,
jpanelOrange
,
color_process
);
// addJButton("Test LDLT Cholesky", jpanelOrange, color_process);
addJButton
(
"Test LLT Cholesky"
,
jpanelOrange
,
color_process
);
addJButton
(
"UAS log"
,
jpanelOrange
,
color_process
);
addJButton
(
"DJI SRT"
,
jpanelOrange
,
color_process
);
addJButton
(
"SRT to KML"
,
jpanelOrange
,
color_process
);
//
plugInJFrame
.
add
(
jpanelOrange
);
}
plugInJFrame
.
pack
();
// Adjusts the window size to fit components
//"LWIR batch"
GUI
.
center
(
plugInJFrame
);
plugInJFrame
.
setVisible
(
true
);
// FHT_INSTANCE = new DoubleFHT();
// main loop
while
(
true
)
{
synchronized
(
this
.
SYNC_COMMAND
)
{
try
{
this
.
SYNC_COMMAND
.
wait
();
}
catch
(
InterruptedException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
this
.
SYNC_COMMAND
.
isRunning
=
true
;
}
if
(
this
.
SYNC_COMMAND
.
stopRequested
.
get
()
==
0
)
{
try
{
runMenuCommand
(
this
.
SYNC_COMMAND
.
buttonLabel
);
}
catch
(
Exception
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
System
.
out
.
println
(
stack2string
(
e
));
IJ
.
showMessage
(
"Exception"
,
stack2string
(
e
));
}
}
this
.
SYNC_COMMAND
.
isRunning
=
false
;
this
.
SYNC_COMMAND
.
stopRequested
.
set
(
0
);
}
}
public
void
initGuiAWT
()
{
/// EyesisTopFrame eyesisTopFrame = new EyesisTopFrame();
Color
color_configure
=
new
Color
(
200
,
200
,
160
);
Color
color_configure_aux
=
new
Color
(
190
,
190
,
180
);
Color
color_process
=
new
Color
(
180
,
180
,
240
);
...
...
@@ -531,12 +959,12 @@ public class Eyesis_Correction implements PlugIn, ActionListener {
public
void
processWindowEvent
(
WindowEvent
e
)
{
super
.
processWindowEvent
(
e
);
if
(
e
.
getID
()
==
WindowEvent
.
WINDOW_CLOSING
)
{
instance
=
null
;
plugInFrame
=
null
;
//
instance = null;
}
}
};
Font
font
=
plugInFrame
.
getFont
();
instance
=
plugInFrame
;
//
Font font = plugInFrame.getFont();
//
instance = plugInFrame;
plugInFrame
.
addKeyListener
(
IJ
.
getInstance
());
// int menuRows=4 + (ADVANCED_MODE?4:0) + (MODE_3D?3:0) + (DCT_MODE?6:0) + (GPU_MODE?1:0) +(LWIR_MODE?2:0);
int
menuRows
=
4
+
(
ADVANCED_MODE
?
4
:
0
)
+
(
MODE_3D
?
3
:
0
)
+
(
DCT_MODE
?
7
:
0
)
+
(
GPU_MODE
?
1
:
0
)
...
...
@@ -572,28 +1000,28 @@ public class Eyesis_Correction implements PlugIn, ActionListener {
if
(
ADVANCED_MODE
)
{
panel1
=
new
Panel
();
panel1
.
setLayout
(
new
GridLayout
(
1
,
0
,
5
,
5
));
// rows, columns, vgap, hgap
addButton
(
"Split Image"
,
panel1
);
addButton
(
"Debayer Image"
,
panel1
);
addButton
(
"Split Image"
,
panel1
,
null
);
addButton
(
"Debayer Image"
,
panel1
,
null
);
plugInFrame
.
add
(
panel1
);
panel2
=
new
Panel
();
panel2
.
setLayout
(
new
GridLayout
(
1
,
0
,
5
,
5
));
addButton
(
"Select kernel stack"
,
panel2
);
addButton
(
"Convolve with stack"
,
panel2
);
addButton
(
"Select kernel stack"
,
panel2
,
null
);
addButton
(
"Convolve with stack"
,
panel2
,
null
);
plugInFrame
.
add
(
panel2
);
panel3
=
new
Panel
();
panel3
.
setLayout
(
new
GridLayout
(
1
,
0
,
5
,
5
));
addButton
(
"Select lo-res"
,
panel3
);
addButton
(
"Combine pair"
,
panel3
);
addButton
(
"Colors"
,
panel3
);
addButton
(
"RGB"
,
panel3
);
addButton
(
"Select lo-res"
,
panel3
,
null
);
addButton
(
"Combine pair"
,
panel3
,
null
);
addButton
(
"Colors"
,
panel3
,
null
);
addButton
(
"RGB"
,
panel3
,
null
);
plugInFrame
.
add
(
panel3
);
panel4
=
new
Panel
();
panel4
.
setLayout
(
new
GridLayout
(
1
,
0
,
5
,
5
));
addButton
(
"Test"
,
panel4
);
addButton
(
"Test Debayer"
,
panel4
);
addButton
(
"Test"
,
panel4
,
null
);
addButton
(
"Test Debayer"
,
panel4
,
null
);
plugInFrame
.
add
(
panel4
);
}
panel7
=
new
Panel
();
...
...
@@ -605,9 +1033,9 @@ public class Eyesis_Correction implements PlugIn, ActionListener {
addButton
(
"Select source sets"
,
panel7
,
color_configure
);
addButton
(
"Process files"
,
panel7
,
color_process
);
if
(
ADVANCED_MODE
)
{
addButton
(
"Tiff Writer"
,
panel7
);
addButton
(
"Tiff Properties"
,
panel7
);
addButton
(
"Add TIFF resolution"
,
panel7
);
addButton
(
"Tiff Writer"
,
panel7
,
null
);
addButton
(
"Tiff Properties"
,
panel7
,
null
);
addButton
(
"Add TIFF resolution"
,
panel7
,
null
);
}
plugInFrame
.
add
(
panel7
);
...
...
@@ -617,27 +1045,27 @@ public class Eyesis_Correction implements PlugIn, ActionListener {
addButton
(
"Configure PP"
,
panelPostProcessing1
,
color_configure
);
addButton
(
"Source PP"
,
panelPostProcessing1
,
color_configure
);
addButton
(
"ConvertPP"
,
panelPostProcessing1
,
color_process
);
addButton
(
"Linear Features"
,
panelPostProcessing1
);
addButton
(
"Intercam correlations"
,
panelPostProcessing1
);
plugInFrame
.
add
(
panelPostProcessing1
);
addButton
(
"Linear Features"
,
panelPostProcessing1
,
null
);
addButton
(
"Intercam correlations"
,
panelPostProcessing1
,
null
);
plugInFrame
.
add
(
panelPostProcessing1
,
null
);
panelPostProcessing2
=
new
Panel
();
panelPostProcessing2
.
setLayout
(
new
GridLayout
(
1
,
0
,
5
,
5
));
addButton
(
"Tile correlations"
,
panelPostProcessing2
);
addButton
(
"Load correlations"
,
panelPostProcessing2
);
addButton
(
"Section correlations"
,
panelPostProcessing2
);
addButton
(
"Setup Z-map"
,
panelPostProcessing2
);
addButton
(
"Fill FG gaps"
,
panelPostProcessing2
);
addButton
(
"Filter Z-map"
,
panelPostProcessing2
);
addButton
(
"Occluding FG"
,
panelPostProcessing2
);
plugInFrame
.
add
(
panelPostProcessing2
);
addButton
(
"Tile correlations"
,
panelPostProcessing2
,
null
);
addButton
(
"Load correlations"
,
panelPostProcessing2
,
null
);
addButton
(
"Section correlations"
,
panelPostProcessing2
,
null
);
addButton
(
"Setup Z-map"
,
panelPostProcessing2
,
null
);
addButton
(
"Fill FG gaps"
,
panelPostProcessing2
,
null
);
addButton
(
"Filter Z-map"
,
panelPostProcessing2
,
null
);
addButton
(
"Occluding FG"
,
panelPostProcessing2
,
null
);
plugInFrame
.
add
(
panelPostProcessing2
,
null
);
panelPostProcessing3
=
new
Panel
();
panelPostProcessing3
.
setLayout
(
new
GridLayout
(
1
,
0
,
5
,
5
));
addButton
(
"Refine Disparities"
,
panelPostProcessing3
);
addButton
(
"Init Photometry"
,
panelPostProcessing3
);
addButton
(
"Plane Likely"
,
panelPostProcessing3
);
plugInFrame
.
add
(
panelPostProcessing3
);
addButton
(
"Refine Disparities"
,
panelPostProcessing3
,
null
);
addButton
(
"Init Photometry"
,
panelPostProcessing3
,
null
);
addButton
(
"Plane Likely"
,
panelPostProcessing3
,
null
);
plugInFrame
.
add
(
panelPostProcessing3
,
null
);
}
if
(
DCT_MODE
)
{
panelDct1
=
new
Panel
();
...
...
@@ -788,8 +1216,8 @@ public class Eyesis_Correction implements PlugIn, ActionListener {
if
(
GPU_MODE
)
{
panelClt_GPU
=
new
Panel
();
panelClt_GPU
.
setLayout
(
new
GridLayout
(
1
,
0
,
5
,
5
));
// rows, columns, vgap, hgap
addButton
(
"JCUDA TEST"
,
panelClt_GPU
);
addButton
(
"TF TEST"
,
panelClt_GPU
);
addButton
(
"JCUDA TEST"
,
panelClt_GPU
,
null
);
addButton
(
"TF TEST"
,
panelClt_GPU
,
null
);
addButton
(
"GPU simulate"
,
panelClt_GPU
,
color_conf_process
);
addButton
(
"GPU RUN"
,
panelClt_GPU
,
color_conf_process
);
// addButton("ShowGPU", panelClt_GPU, color_conf_process);
...
...
@@ -885,11 +1313,11 @@ public class Eyesis_Correction implements PlugIn, ActionListener {
//
plugInFrame
.
add
(
panelOrange
);
}
plugInFrame
.
pack
();
plugInFrame
.
pack
();
// Adjusts the window size to fit components
//"LWIR batch"
GUI
.
center
(
plugInFrame
);
plugInFrame
.
setVisible
(
true
);
FHT_INSTANCE
=
new
DoubleFHT
();
//
FHT_INSTANCE = new DoubleFHT();
// main loop
while
(
true
)
{
synchronized
(
this
.
SYNC_COMMAND
)
{
...
...
@@ -1039,32 +1467,27 @@ public class Eyesis_Correction implements PlugIn, ActionListener {
}
void
addButton
(
String
label
,
Panel
panel
,
Color
color
,
String
toolTip
)
{
Button
b
=
new
Button
(
label
);
b
.
setBackground
(
color
);
b
.
addActionListener
(
this
);
b
.
addKeyListener
(
IJ
.
getInstance
());
b
.
addMouseListener
(
new
AwtToolTip
(
toolTip
,
b
));
panel
.
add
(
b
);
}
void
addButton
(
String
label
,
Panel
panel
,
Color
color
)
{
Button
b
=
new
Button
(
label
);
b
.
setBackground
(
color
);
if
(
color
!=
null
)
{
b
.
setBackground
(
color
);
}
b
.
addActionListener
(
this
);
b
.
addKeyListener
(
IJ
.
getInstance
());
// b.addMouseListener(new AwtToolTip(label, b));
panel
.
add
(
b
);
}
void
addButton
(
String
label
,
Panel
panel
)
{
Button
b
=
new
Button
(
label
);
void
addJButton
(
String
label
,
JPanel
panel
,
Color
color
)
{
JButton
b
=
new
JButton
(
label
);
if
(
color
!=
null
)
{
b
.
setBackground
(
color
);
}
b
.
addActionListener
(
this
);
b
.
addKeyListener
(
IJ
.
getInstance
());
// b.addMouseListener(new AwtToolTip(label, b));
panel
.
add
(
b
);
}
@Override
public
void
actionPerformed
(
ActionEvent
e
)
{
String
label
=
e
.
getActionCommand
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment