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
3fa095d3
Commit
3fa095d3
authored
Sep 05, 2014
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Saving subset of parameters
parent
2f19b216
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
336 additions
and
170 deletions
+336
-170
Aberration_Calibration.java
src/main/java/Aberration_Calibration.java
+166
-37
FocusingField.java
src/main/java/FocusingField.java
+170
-133
No files found.
src/main/java/Aberration_Calibration.java
View file @
3fa095d3
...
@@ -48,6 +48,8 @@ import java.util.regex.Pattern;
...
@@ -48,6 +48,8 @@ import java.util.regex.Pattern;
//import FocusingField.FocusingFieldMeasurement;
//import FocusingField.FocusingFieldMeasurement;
//import FocusingField.MeasuredSample;
//import FocusingField.MeasuredSample;
import Jama.Matrix; // Download here: http://math.nist.gov/javanumerics/jama/
import Jama.Matrix; // Download here: http://math.nist.gov/javanumerics/jama/
...
@@ -579,6 +581,7 @@ public static MatchSimulatedPattern.DistortionParameters DISTORTION =new MatchSi
...
@@ -579,6 +581,7 @@ public static MatchSimulatedPattern.DistortionParameters DISTORTION =new MatchSi
panelRun.setLayout(new GridLayout(1, 0, 5, 5));
panelRun.setLayout(new GridLayout(1, 0, 5, 5));
addButton("Process Calibration Files",panelRun);
addButton("Process Calibration Files",panelRun);
addButton("Save",panelRun);
addButton("Save",panelRun);
addButton("Save Selected",panelRun);
addButton("Restore",panelRun,color_restore);
addButton("Restore",panelRun,color_restore);
addButton("Restore no autoload",panelRun);
addButton("Restore no autoload",panelRun);
addButton("Restore SFE Latest",panelRun,color_restore);
addButton("Restore SFE Latest",panelRun,color_restore);
...
@@ -1046,11 +1049,18 @@ if (MORE_BUTTONS) {
...
@@ -1046,11 +1049,18 @@ if (MORE_BUTTONS) {
String fileName= selectKernelsDirectory(PROCESS_PARAMETERS.kernelsDirectory);
String fileName= selectKernelsDirectory(PROCESS_PARAMETERS.kernelsDirectory);
if (fileName!=null) PROCESS_PARAMETERS.kernelsDirectory=fileName;
if (fileName!=null) PROCESS_PARAMETERS.kernelsDirectory=fileName;
return;
return;
/* ======================================================================== */
/* ======================================================================== */
} else if (label.equals("Save")) {
} else if (label.equals("Save")) {
saveProperties(null,PROCESS_PARAMETERS.kernelsDirectory,PROCESS_PARAMETERS.useXML, PROPERTIES);
saveProperties(null,PROCESS_PARAMETERS.kernelsDirectory,PROCESS_PARAMETERS.useXML, PROPERTIES);
return;
return;
/* ======================================================================== */
} else if (label.equals("Save Selected")) {
Properties selectedProperties=new Properties();
selectedProperties.setProperty("selected", "true");
saveProperties(null,PROCESS_PARAMETERS.kernelsDirectory, PROCESS_PARAMETERS.useXML, selectedProperties);
return;
/* ======================================================================== */
/* ======================================================================== */
} else if (label.equals("Restore") || label.equals("Restore no autoload")) {
} else if (label.equals("Restore") || label.equals("Restore no autoload")) {
...
@@ -13010,6 +13020,7 @@ private double [][] jacobianByJacobian(double [][] jacobian, boolean [] mask) {
...
@@ -13010,6 +13020,7 @@ private double [][] jacobianByJacobian(double [][] jacobian, boolean [] mask) {
} else path+=patterns[0];
} else path+=patterns[0];
if (path==null) return;
if (path==null) return;
setAllProperties(properties);
setAllProperties(properties);
OutputStream os;
OutputStream os;
try {
try {
os = new FileOutputStream(path);
os = new FileOutputStream(path);
...
@@ -13050,6 +13061,7 @@ private double [][] jacobianByJacobian(double [][] jacobian, boolean [] mask) {
...
@@ -13050,6 +13061,7 @@ private double [][] jacobianByJacobian(double [][] jacobian, boolean [] mask) {
String directory,
String directory,
boolean useXML,
boolean useXML,
Properties properties){
Properties properties){
setAllProperties(properties); // NEW. Setting properties from current parameters so missing (in the file) parameters will not cause an error
String [] XMLPatterns= {".conf-xml",".xml"};
String [] XMLPatterns= {".conf-xml",".xml"};
String [] confPatterns={".conf"};
String [] confPatterns={".conf"};
String [] patterns=useXML?XMLPatterns:confPatterns;
String [] patterns=useXML?XMLPatterns:confPatterns;
...
@@ -13101,42 +13113,159 @@ private double [][] jacobianByJacobian(double [][] jacobian, boolean [] mask) {
...
@@ -13101,42 +13113,159 @@ private double [][] jacobianByJacobian(double [][] jacobian, boolean [] mask) {
}
}
/* ======================================================================== */
/* ======================================================================== */
public void setAllProperties(Properties properties){
public void setAllProperties(Properties properties){
properties
.
setProperty
(
"MASTER_DEBUG_LEVEL"
,
MASTER_DEBUG_LEVEL
+
""
);
boolean select= (properties.getProperty("selected")!=null);
properties
.
setProperty
(
"SHOW_AS_STACKS"
,
SHOW_AS_STACKS
+
""
);
// Show debug images as stacks (false - individual)
boolean select_MASTER_DEBUG_LEVEL=!select;
properties
.
setProperty
(
"FFT_SIZE"
,
FFT_SIZE
+
""
);
boolean select_SHOW_AS_STACKS=!select;
properties
.
setProperty
(
"MAP_FFT_SIZE"
,
MAP_FFT_SIZE
+
""
);
// used to find where grid covers the image
boolean select_FFT_SIZE=!select;
properties
.
setProperty
(
"GAUSS_WIDTH"
,
GAUSS_WIDTH
+
""
);
// 0.4 (0 - use Hamming window)
boolean select_MAP_FFT_SIZE=!select;
properties
.
setProperty
(
"FFT_OVERLAP"
,
FFT_OVERLAP
+
""
);
// createPSFMap()
boolean select_GAUSS_WIDTH=!select;
properties
.
setProperty
(
"PSF_SUBPIXEL"
,
PSF_SUBPIXEL
+
""
);
// sub-pixel decimation
boolean select_FFT_OVERLAP=!select;
properties
.
setProperty
(
"PSF_SAVE_FILE"
,
PSF_SAVE_FILE
+
""
);
// save PSF array to a multi-slice TIFF file
boolean select_PSF_SUBPIXEL=!select;
properties
.
setProperty
(
"THREADS_MAX"
,
THREADS_MAX
+
""
);
// 100, testing multi-threading, limit maximal number of threads
boolean select_PSF_SAVE_FILE=!select;
properties
.
setProperty
(
"UPDATE_STATUS"
,
UPDATE_STATUS
+
""
);
// update ImageJ status info
boolean select_THREADS_MAX=!select;
boolean select_UPDATE_STATUS=!select;
SIMUL
.
setProperties
(
"SIMUL."
,
properties
);
boolean select_SIMUL=!select;
INTERPOLATE
.
setProperties
(
"INTERPOLATE."
,
properties
);
boolean select_INTERPOLATE=!select;
INVERSE
.
setProperties
(
"INVERSE."
,
properties
);
boolean select_INVERSE=!select;
PSF_PARS
.
setProperties
(
"PSF_PARS."
,
properties
);
boolean select_PSF_PARS=!select;
OTF_FILTER
.
setProperties
(
"OTF_FILTER."
,
properties
);
boolean select_OTF_FILTER=!select;
PATTERN_DETECT
.
setProperties
(
"PATTERN_DETECT."
,
properties
);
boolean select_PATTERN_DETECT=!select;
COMPONENTS
.
setProperties
(
"COMPONENTS."
,
properties
);
boolean select_COMPONENTS=!select;
SHOW_RESULTS
.
setProperties
(
"SHOW_RESULTS."
,
properties
);
boolean select_SHOW_RESULTS=!select;
MULTIFILE_PSF
.
setProperties
(
"MULTIFILE_PSF."
,
properties
);
boolean select_MULTIFILE_PSF=!select;
PROCESS_PARAMETERS
.
setProperties
(
"PROCESS_PARAMETERS."
,
properties
);
boolean select_PROCESS_PARAMETERS=!select;
DISTORTION
.
setProperties
(
"DISTORTION."
,
properties
);
boolean select_DISTORTION=!select;
LASER_POINTERS
.
setProperties
(
"LASER."
,
properties
);
boolean select_LASER_POINTERS=!select;
FLATFIELD_PARAMETERS
.
setProperties
(
"FLATFIELD_PARAMETERS."
,
properties
);
boolean select_FLATFIELD_PARAMETERS=!select;
PATTERN_PARAMETERS
.
setProperties
(
"PATTERN_PARAMETERS."
,
properties
);
boolean select_PATTERN_PARAMETERS=!select;
LENS_DISTORTION_PARAMETERS
.
setProperties
(
"LENS_DISTORTION_PARAMETERS."
,
properties
);
boolean select_LENS_DISTORTION_PARAMETERS=!select;
EYESIS_CAMERA_PARAMETERS
.
setProperties
(
"EYESIS_CAMERA_PARAMETERS."
,
properties
);
boolean select_EYESIS_CAMERA_PARAMETERS=!select;
LASERS
.
setProperties
(
"LASERS."
,
properties
);
boolean select_LASERS=!select;
CAMERAS
.
setProperties
(
"CAMERAS."
,
properties
);
boolean select_CAMERAS=!select;
DISTORTION_PROCESS_CONFIGURATION
.
setProperties
(
"DISTORTION_PROCESS_CONFIGURATION."
,
properties
);
boolean select_DISTORTION_PROCESS_CONFIGURATION=!select;
REFINE_PARAMETERS
.
setProperties
(
"REFINE_PARAMETERS."
,
properties
);
boolean select_REFINE_PARAMETERS=!select;
FOCUS_MEASUREMENT_PARAMETERS
.
setProperties
(
"FOCUS_MEASUREMENT_PARAMETERS."
,
properties
);
boolean select_FOCUS_MEASUREMENT_PARAMETERS=!select;
MOTORS
.
focusingHistory
.
setProperties
(
"FOCUSING_HISTORY."
,
properties
);
boolean select_MOTORS_focusingHistory=!select;
GONIOMETER_PARAMETERS
.
setProperties
(
"GONIOMETER_PARAMETERS."
,
properties
);
boolean select_GONIOMETER_PARAMETERS=!select;
ABERRATIONS_PARAMETERS
.
setProperties
(
"ABERRATIONS_PARAMETERS."
,
properties
);
boolean select_ABERRATIONS_PARAMETERS=!select;
if
(
FOCUSING_FIELD
!=
null
)
FOCUSING_FIELD
.
setProperties
(
"FOCUSING_FIELD."
,
properties
);
boolean select_FOCUSING_FIELD=!select;
if (select) {
GenericDialog gd = new GenericDialog("Select parameters to save");
gd.addMessage("===== Individual parameters ======");
gd.addCheckbox("MASTER_DEBUG_LEVEL", select_MASTER_DEBUG_LEVEL);
gd.addCheckbox("SHOW_AS_STACKS", select_SHOW_AS_STACKS);
gd.addCheckbox("FFT_SIZE",select_FFT_SIZE);
gd.addCheckbox("MAP_FFT_SIZE",select_MAP_FFT_SIZE);
gd.addCheckbox("GAUSS_WIDTH",select_GAUSS_WIDTH);
gd.addCheckbox("FFT_OVERLAP",select_FFT_OVERLAP);
gd.addCheckbox("PSF_SUBPIXEL",select_PSF_SUBPIXEL);
gd.addCheckbox("PSF_SAVE_FILE",select_PSF_SAVE_FILE);
gd.addCheckbox("THREADS_MAX",select_THREADS_MAX);
gd.addCheckbox("UPDATE_STATUS",select_UPDATE_STATUS);
gd.addMessage("===== Parameter classes ======");
gd.addCheckbox("SIMUL",select_SIMUL);
gd.addCheckbox("INTERPOLATE",select_INTERPOLATE);
gd.addCheckbox("INVERSE",select_INVERSE);
gd.addCheckbox("PSF_PARS",select_PSF_PARS);
gd.addCheckbox("OTF_FILTER",select_OTF_FILTER);
gd.addCheckbox("PATTERN_DETECT",select_PATTERN_DETECT);
gd.addCheckbox("COMPONENTS",select_COMPONENTS);
gd.addCheckbox("SHOW_RESULTS",select_SHOW_RESULTS);
gd.addCheckbox("MULTIFILE_PSF",select_MULTIFILE_PSF);
gd.addCheckbox("PROCESS_PARAMETERS",select_PROCESS_PARAMETERS);
gd.addCheckbox("DISTORTION",select_DISTORTION);
gd.addCheckbox("LASER_POINTERS",select_LASER_POINTERS);
gd.addCheckbox("FLATFIELD_PARAMETERS",select_FLATFIELD_PARAMETERS);
gd.addCheckbox("PATTERN_PARAMETERS",select_PATTERN_PARAMETERS);
gd.addCheckbox("LENS_DISTORTION_PARAMETERS",select_LENS_DISTORTION_PARAMETERS);
gd.addCheckbox("EYESIS_CAMERA_PARAMETERS",select_EYESIS_CAMERA_PARAMETERS);
gd.addCheckbox("LASERS",select_LASERS);
gd.addCheckbox("CAMERAS",select_CAMERAS);
gd.addCheckbox("DISTORTION_PROCESS_CONFIGURATION",select_DISTORTION_PROCESS_CONFIGURATION);
gd.addCheckbox("REFINE_PARAMETERS",select_REFINE_PARAMETERS);
gd.addCheckbox("FOCUS_MEASUREMENT_PARAMETERS",select_FOCUS_MEASUREMENT_PARAMETERS);
gd.addCheckbox("MOTORS_focusingHistory",select_MOTORS_focusingHistory);
gd.addCheckbox("GONIOMETER_PARAMETERS",select_GONIOMETER_PARAMETERS);
gd.addCheckbox("ABERRATIONS_PARAMETERS",select_ABERRATIONS_PARAMETERS);
gd.addCheckbox("FOCUSING_FIELD",select_FOCUSING_FIELD);
WindowTools.addScrollBars(gd);
gd.showDialog();
if (gd.wasCanceled()) return;
select_MASTER_DEBUG_LEVEL=gd.getNextBoolean();
select_SHOW_AS_STACKS=gd.getNextBoolean();
select_FFT_SIZE=gd.getNextBoolean();
select_MAP_FFT_SIZE=gd.getNextBoolean();
select_GAUSS_WIDTH=gd.getNextBoolean();
select_FFT_OVERLAP=gd.getNextBoolean();
select_PSF_SUBPIXEL=gd.getNextBoolean();
select_PSF_SAVE_FILE=gd.getNextBoolean();
select_THREADS_MAX=gd.getNextBoolean();
select_UPDATE_STATUS=gd.getNextBoolean();
select_SIMUL=gd.getNextBoolean();
select_INTERPOLATE=gd.getNextBoolean();
select_INVERSE=gd.getNextBoolean();
select_PSF_PARS=gd.getNextBoolean();
select_OTF_FILTER=gd.getNextBoolean();
select_PATTERN_DETECT=gd.getNextBoolean();
select_COMPONENTS=gd.getNextBoolean();
select_SHOW_RESULTS=gd.getNextBoolean();
select_MULTIFILE_PSF=gd.getNextBoolean();
select_PROCESS_PARAMETERS=gd.getNextBoolean();
select_DISTORTION=gd.getNextBoolean();
select_LASER_POINTERS=gd.getNextBoolean();
select_FLATFIELD_PARAMETERS=gd.getNextBoolean();
select_PATTERN_PARAMETERS=gd.getNextBoolean();
select_LENS_DISTORTION_PARAMETERS=gd.getNextBoolean();
select_EYESIS_CAMERA_PARAMETERS=gd.getNextBoolean();
select_LASERS=gd.getNextBoolean();
select_CAMERAS=gd.getNextBoolean();
select_DISTORTION_PROCESS_CONFIGURATION=gd.getNextBoolean();
select_REFINE_PARAMETERS=gd.getNextBoolean();
select_FOCUS_MEASUREMENT_PARAMETERS=gd.getNextBoolean();
select_MOTORS_focusingHistory=gd.getNextBoolean();
select_GONIOMETER_PARAMETERS=gd.getNextBoolean();
select_ABERRATIONS_PARAMETERS=gd.getNextBoolean();
select_FOCUSING_FIELD=gd.getNextBoolean();
}
if (select_MASTER_DEBUG_LEVEL) properties.setProperty("MASTER_DEBUG_LEVEL", MASTER_DEBUG_LEVEL+"");
if (select_SHOW_AS_STACKS) properties.setProperty("SHOW_AS_STACKS", SHOW_AS_STACKS+"");// Show debug images as stacks (false - individual)
if (select_FFT_SIZE) properties.setProperty("FFT_SIZE", FFT_SIZE+"");
if (select_MAP_FFT_SIZE) properties.setProperty("MAP_FFT_SIZE", MAP_FFT_SIZE+"");// used to find where grid covers the image
if (select_GAUSS_WIDTH) properties.setProperty("GAUSS_WIDTH", GAUSS_WIDTH+""); // 0.4 (0 - use Hamming window)
if (select_FFT_OVERLAP) properties.setProperty("FFT_OVERLAP", FFT_OVERLAP+""); // createPSFMap()
if (select_PSF_SUBPIXEL) properties.setProperty("PSF_SUBPIXEL", PSF_SUBPIXEL+""); // sub-pixel decimation
if (select_PSF_SAVE_FILE) properties.setProperty("PSF_SAVE_FILE", PSF_SAVE_FILE+"");// save PSF array to a multi-slice TIFF file
if (select_THREADS_MAX) properties.setProperty("THREADS_MAX", THREADS_MAX+""); // 100, testing multi-threading, limit maximal number of threads
if (select_UPDATE_STATUS) properties.setProperty("UPDATE_STATUS", UPDATE_STATUS+""); // update ImageJ status info
if (select_SIMUL) SIMUL.setProperties( "SIMUL.", properties);
if (select_INTERPOLATE) INTERPOLATE.setProperties( "INTERPOLATE.", properties);
if (select_INVERSE) INVERSE.setProperties( "INVERSE.", properties);
if (select_PSF_PARS) PSF_PARS.setProperties( "PSF_PARS.", properties);
if (select_OTF_FILTER) OTF_FILTER.setProperties( "OTF_FILTER.", properties);
if (select_PATTERN_DETECT) PATTERN_DETECT.setProperties( "PATTERN_DETECT.", properties);
if (select_COMPONENTS) COMPONENTS.setProperties( "COMPONENTS.", properties);
if (select_SHOW_RESULTS) SHOW_RESULTS.setProperties( "SHOW_RESULTS.", properties);
if (select_MULTIFILE_PSF) MULTIFILE_PSF.setProperties( "MULTIFILE_PSF.", properties);
if (select_PROCESS_PARAMETERS) PROCESS_PARAMETERS.setProperties("PROCESS_PARAMETERS.", properties);
if (select_DISTORTION) DISTORTION.setProperties( "DISTORTION.", properties);
if (select_LASER_POINTERS) LASER_POINTERS.setProperties("LASER.", properties);
if (select_FLATFIELD_PARAMETERS) FLATFIELD_PARAMETERS.setProperties("FLATFIELD_PARAMETERS.", properties);
if (select_PATTERN_PARAMETERS) PATTERN_PARAMETERS.setProperties ("PATTERN_PARAMETERS.", properties);
if (select_LENS_DISTORTION_PARAMETERS) LENS_DISTORTION_PARAMETERS.setProperties("LENS_DISTORTION_PARAMETERS.", properties);
if (select_EYESIS_CAMERA_PARAMETERS) EYESIS_CAMERA_PARAMETERS.setProperties("EYESIS_CAMERA_PARAMETERS.", properties);
if (select_LASERS) LASERS.setProperties("LASERS.", properties);
if (select_CAMERAS) CAMERAS.setProperties("CAMERAS.", properties);
if (select_DISTORTION_PROCESS_CONFIGURATION) DISTORTION_PROCESS_CONFIGURATION.setProperties("DISTORTION_PROCESS_CONFIGURATION.", properties);
if (select_REFINE_PARAMETERS) REFINE_PARAMETERS.setProperties("REFINE_PARAMETERS.", properties);
if (select_FOCUS_MEASUREMENT_PARAMETERS) FOCUS_MEASUREMENT_PARAMETERS.setProperties("FOCUS_MEASUREMENT_PARAMETERS.", properties);
if (select_MOTORS_focusingHistory) MOTORS.focusingHistory.setProperties("FOCUSING_HISTORY.", properties);
if (select_GONIOMETER_PARAMETERS) GONIOMETER_PARAMETERS.setProperties("GONIOMETER_PARAMETERS.", properties);
if (select_ABERRATIONS_PARAMETERS) ABERRATIONS_PARAMETERS.setProperties("ABERRATIONS_PARAMETERS.", properties);
if ((select_FOCUSING_FIELD) && (FOCUSING_FIELD!=null)) FOCUSING_FIELD.setProperties("FOCUSING_FIELD.", properties);
if (select) properties.remove("selected");
}
}
/* ======================================================================== */
/* ======================================================================== */
public void getAllProperties(Properties properties){
public void getAllProperties(Properties properties){
...
...
src/main/java/FocusingField.java
View file @
3fa095d3
...
@@ -340,8 +340,20 @@ public class FocusingField {
...
@@ -340,8 +340,20 @@ public class FocusingField {
System
.
out
.
println
(
"fieldFitting is not initialized, nothing to save"
);
System
.
out
.
println
(
"fieldFitting is not initialized, nothing to save"
);
return
;
return
;
}
}
boolean
select
=
(
properties
.
getProperty
(
"selected"
)!=
null
);
fieldFitting
.
setProperties
(
prefix
+
"fieldFitting."
,
properties
);
boolean
select_fieldFitting
=!
select
;
boolean
select_FOCUSING_FIELD
=!
select
;
if
(
select
)
{
GenericDialog
gd
=
new
GenericDialog
(
"Select FocusingField parameters to save"
);
gd
.
addCheckbox
(
"FieldFitting parameter class"
,
select_fieldFitting
);
gd
.
addCheckbox
(
"FocusingField local parameters"
,
select_FOCUSING_FIELD
);
gd
.
showDialog
();
if
(
gd
.
wasCanceled
())
return
;
select_fieldFitting
=
gd
.
getNextBoolean
();
select_FOCUSING_FIELD
=
gd
.
getNextBoolean
();
}
if
(
select_fieldFitting
)
fieldFitting
.
setProperties
(
prefix
+
"fieldFitting."
,
properties
);
if
(
select_FOCUSING_FIELD
){
properties
.
setProperty
(
prefix
+
"pX0_distortions"
,
pX0_distortions
+
""
);
properties
.
setProperty
(
prefix
+
"pX0_distortions"
,
pX0_distortions
+
""
);
properties
.
setProperty
(
prefix
+
"pY0_distortions"
,
pY0_distortions
+
""
);
properties
.
setProperty
(
prefix
+
"pY0_distortions"
,
pY0_distortions
+
""
);
properties
.
setProperty
(
prefix
+
"currentPX0"
,
currentPX0
+
""
);
properties
.
setProperty
(
prefix
+
"currentPX0"
,
currentPX0
+
""
);
...
@@ -407,8 +419,8 @@ public class FocusingField {
...
@@ -407,8 +419,8 @@ public class FocusingField {
properties
.
setProperty
(
prefix
+
"rslt_mtf50_mode"
,
rslt_mtf50_mode
+
""
);
properties
.
setProperty
(
prefix
+
"rslt_mtf50_mode"
,
rslt_mtf50_mode
+
""
);
properties
.
setProperty
(
prefix
+
"rslt_solve"
,
rslt_solve
+
""
);
properties
.
setProperty
(
prefix
+
"rslt_solve"
,
rslt_solve
+
""
);
for
(
int
chn
=
0
;
chn
<
rslt_show_chn
.
length
;
chn
++)
properties
.
setProperty
(
prefix
+
"rslt_show_chn_"
+
chn
,
rslt_show_chn
[
chn
]+
""
);
for
(
int
chn
=
0
;
chn
<
rslt_show_chn
.
length
;
chn
++)
properties
.
setProperty
(
prefix
+
"rslt_show_chn_"
+
chn
,
rslt_show_chn
[
chn
]+
""
);
// always re-calculate here? - only in calibration mode or restore calibration mode? No, only in LMA in calibration mode
// always re-calculate here? - only in calibration mode or restore calibration mode? No, only in LMA in calibration mode
// zRanges=calcZRanges(dataWeightsToBoolean());
// zRanges=calcZRanges(dataWeightsToBoolean());
if
(
zRanges
!=
null
){
if
(
zRanges
!=
null
){
properties
.
setProperty
(
prefix
+
"zRanges_length"
,
zRanges
.
length
+
""
);
properties
.
setProperty
(
prefix
+
"zRanges_length"
,
zRanges
.
length
+
""
);
for
(
int
chn
=
0
;
chn
<
zRanges
.
length
;
chn
++)
if
(
zRanges
[
chn
]!=
null
)
{
for
(
int
chn
=
0
;
chn
<
zRanges
.
length
;
chn
++)
if
(
zRanges
[
chn
]!=
null
)
{
...
@@ -419,6 +431,7 @@ public class FocusingField {
...
@@ -419,6 +431,7 @@ public class FocusingField {
}
}
}
}
}
}
}
public
void
getProperties
(
String
prefix
,
Properties
properties
){
public
void
getProperties
(
String
prefix
,
Properties
properties
){
savedProperties
=
properties
;
savedProperties
=
properties
;
...
@@ -4574,13 +4587,36 @@ public boolean LevenbergMarquardt(
...
@@ -4574,13 +4587,36 @@ public boolean LevenbergMarquardt(
if
(
debugLevel
>
1
)
System
.
out
.
println
(
"Mechanical properties not yet initialized, will save properties later"
);
if
(
debugLevel
>
1
)
System
.
out
.
println
(
"Mechanical properties not yet initialized, will save properties later"
);
return
;
return
;
}
}
properties
.
setProperty
(
prefix
+
"numberOfLocations"
,
numberOfLocations
+
""
);
boolean
select
=
(
properties
.
getProperty
(
"selected"
)!=
null
);
properties
.
setProperty
(
prefix
+
"centerSelect_X"
,
centerSelect
[
0
]+
""
);
boolean
select_mechanicalFocusingModel
=!
select
;
properties
.
setProperty
(
prefix
+
"centerSelect_Y"
,
centerSelect
[
1
]+
""
);
boolean
select_curvatureModel
=!
select
;
mechanicalFocusingModel
.
setProperties
(
prefix
+
"mechanicalFocusingModel."
,
properties
);
boolean
select_fieldStrategies
=!
select
;
boolean
select_FieldFitting
=!
select
;
if
(
select
)
{
GenericDialog
gd
=
new
GenericDialog
(
"Select FieldFitting parameters to save"
);
gd
.
addCheckbox
(
"MechanicalFocusingModel parameter class"
,
select_mechanicalFocusingModel
);
gd
.
addCheckbox
(
"CurvatureModel parameter classes"
,
select_curvatureModel
);
gd
.
addCheckbox
(
"FieldStrategies parameter classes"
,
select_fieldStrategies
);
gd
.
addCheckbox
(
"FieldFitting local parameters"
,
select_FieldFitting
);
gd
.
showDialog
();
if
(
gd
.
wasCanceled
())
return
;
select_mechanicalFocusingModel
=
gd
.
getNextBoolean
();
select_curvatureModel
=
gd
.
getNextBoolean
();
select_fieldStrategies
=
gd
.
getNextBoolean
();
select_FieldFitting
=
gd
.
getNextBoolean
();
}
if
(
select_mechanicalFocusingModel
)
mechanicalFocusingModel
.
setProperties
(
prefix
+
"mechanicalFocusingModel."
,
properties
);
if
(
select_curvatureModel
)
{
for
(
int
i
=
0
;
i
<
curvatureModel
.
length
;
i
++){
for
(
int
i
=
0
;
i
<
curvatureModel
.
length
;
i
++){
if
(
curvatureModel
[
i
]!=
null
)
curvatureModel
[
i
].
setProperties
(
prefix
+
"curvatureModel_"
+
i
+
"."
,
properties
);
if
(
curvatureModel
[
i
]!=
null
)
curvatureModel
[
i
].
setProperties
(
prefix
+
"curvatureModel_"
+
i
+
"."
,
properties
);
}
}
}
if
(
select_FieldFitting
)
{
properties
.
setProperty
(
prefix
+
"numberOfLocations"
,
numberOfLocations
+
""
);
properties
.
setProperty
(
prefix
+
"centerSelect_X"
,
centerSelect
[
0
]+
""
);
properties
.
setProperty
(
prefix
+
"centerSelect_Y"
,
centerSelect
[
1
]+
""
);
if
(
channelSelect
!=
null
)
for
(
int
i
=
0
;
i
<
channelSelect
.
length
;
i
++){
if
(
channelSelect
!=
null
)
for
(
int
i
=
0
;
i
<
channelSelect
.
length
;
i
++){
properties
.
setProperty
(
prefix
+
"channelSelect_"
+
i
,
channelSelect
[
i
]+
""
);
properties
.
setProperty
(
prefix
+
"channelSelect_"
+
i
,
channelSelect
[
i
]+
""
);
}
}
...
@@ -4603,7 +4639,7 @@ public boolean LevenbergMarquardt(
...
@@ -4603,7 +4639,7 @@ public boolean LevenbergMarquardt(
properties
.
setProperty
(
prefix
+
"sampleCorrPullZero_"
+
chn
+
"_"
+
i
,
sampleCorrPullZero
[
chn
][
i
]+
""
);
properties
.
setProperty
(
prefix
+
"sampleCorrPullZero_"
+
chn
+
"_"
+
i
,
sampleCorrPullZero
[
chn
][
i
]+
""
);
}
}
// save correction parameters values
// save correction parameters values
// private double [][][] correctionParameters=new double[6][][]; // all
// private double [][][] correctionParameters=new double[6][][]; // all
if
(
correctionParameters
!=
null
){
if
(
correctionParameters
!=
null
){
for
(
int
chn
=
0
;
chn
<
correctionParameters
.
length
;
chn
++)
if
(
correctionParameters
[
chn
]!=
null
){
for
(
int
chn
=
0
;
chn
<
correctionParameters
.
length
;
chn
++)
if
(
correctionParameters
[
chn
]!=
null
){
for
(
int
np
=
0
;
np
<
correctionParameters
[
chn
].
length
;
np
++)
if
(
correctionParameters
[
chn
][
np
]!=
null
){
for
(
int
np
=
0
;
np
<
correctionParameters
[
chn
].
length
;
np
++)
if
(
correctionParameters
[
chn
][
np
]!=
null
){
...
@@ -4613,7 +4649,8 @@ public boolean LevenbergMarquardt(
...
@@ -4613,7 +4649,8 @@ public boolean LevenbergMarquardt(
}
}
}
}
}
}
fieldStrategies
.
setProperties
(
prefix
+
"fieldStrategies."
,
properties
);
}
if
(
select_fieldStrategies
)
fieldStrategies
.
setProperties
(
prefix
+
"fieldStrategies."
,
properties
);
}
}
public
void
getProperties
(
String
prefix
,
Properties
properties
){
public
void
getProperties
(
String
prefix
,
Properties
properties
){
if
(
properties
.
getProperty
(
prefix
+
"numberOfLocations"
)!=
null
)
if
(
properties
.
getProperty
(
prefix
+
"numberOfLocations"
)!=
null
)
...
...
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