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
Hide 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;
//import FocusingField.FocusingFieldMeasurement;
//import FocusingField.MeasuredSample;
import
Jama.Matrix
;
// Download here: http://math.nist.gov/javanumerics/jama/
...
...
@@ -579,6 +581,7 @@ public static MatchSimulatedPattern.DistortionParameters DISTORTION =new MatchSi
panelRun
.
setLayout
(
new
GridLayout
(
1
,
0
,
5
,
5
));
addButton
(
"Process Calibration Files"
,
panelRun
);
addButton
(
"Save"
,
panelRun
);
addButton
(
"Save Selected"
,
panelRun
);
addButton
(
"Restore"
,
panelRun
,
color_restore
);
addButton
(
"Restore no autoload"
,
panelRun
);
addButton
(
"Restore SFE Latest"
,
panelRun
,
color_restore
);
...
...
@@ -1046,11 +1049,18 @@ if (MORE_BUTTONS) {
String
fileName
=
selectKernelsDirectory
(
PROCESS_PARAMETERS
.
kernelsDirectory
);
if
(
fileName
!=
null
)
PROCESS_PARAMETERS
.
kernelsDirectory
=
fileName
;
return
;
/* ======================================================================== */
/* ======================================================================== */
}
else
if
(
label
.
equals
(
"Save"
))
{
saveProperties
(
null
,
PROCESS_PARAMETERS
.
kernelsDirectory
,
PROCESS_PARAMETERS
.
useXML
,
PROPERTIES
);
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"
))
{
...
...
@@ -13010,6 +13020,7 @@ private double [][] jacobianByJacobian(double [][] jacobian, boolean [] mask) {
}
else
path
+=
patterns
[
0
];
if
(
path
==
null
)
return
;
setAllProperties
(
properties
);
OutputStream
os
;
try
{
os
=
new
FileOutputStream
(
path
);
...
...
@@ -13050,6 +13061,7 @@ private double [][] jacobianByJacobian(double [][] jacobian, boolean [] mask) {
String
directory
,
boolean
useXML
,
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
[]
confPatterns
={
".conf"
};
String
[]
patterns
=
useXML
?
XMLPatterns:
confPatterns
;
...
...
@@ -13101,42 +13113,159 @@ private double [][] jacobianByJacobian(double [][] jacobian, boolean [] mask) {
}
/* ======================================================================== */
public
void
setAllProperties
(
Properties
properties
){
properties
.
setProperty
(
"MASTER_DEBUG_LEVEL"
,
MASTER_DEBUG_LEVEL
+
""
);
properties
.
setProperty
(
"SHOW_AS_STACKS"
,
SHOW_AS_STACKS
+
""
);
// Show debug images as stacks (false - individual)
properties
.
setProperty
(
"FFT_SIZE"
,
FFT_SIZE
+
""
);
properties
.
setProperty
(
"MAP_FFT_SIZE"
,
MAP_FFT_SIZE
+
""
);
// used to find where grid covers the image
properties
.
setProperty
(
"GAUSS_WIDTH"
,
GAUSS_WIDTH
+
""
);
// 0.4 (0 - use Hamming window)
properties
.
setProperty
(
"FFT_OVERLAP"
,
FFT_OVERLAP
+
""
);
// createPSFMap()
properties
.
setProperty
(
"PSF_SUBPIXEL"
,
PSF_SUBPIXEL
+
""
);
// sub-pixel decimation
properties
.
setProperty
(
"PSF_SAVE_FILE"
,
PSF_SAVE_FILE
+
""
);
// save PSF array to a multi-slice TIFF file
properties
.
setProperty
(
"THREADS_MAX"
,
THREADS_MAX
+
""
);
// 100, testing multi-threading, limit maximal number of threads
properties
.
setProperty
(
"UPDATE_STATUS"
,
UPDATE_STATUS
+
""
);
// update ImageJ status info
SIMUL
.
setProperties
(
"SIMUL."
,
properties
);
INTERPOLATE
.
setProperties
(
"INTERPOLATE."
,
properties
);
INVERSE
.
setProperties
(
"INVERSE."
,
properties
);
PSF_PARS
.
setProperties
(
"PSF_PARS."
,
properties
);
OTF_FILTER
.
setProperties
(
"OTF_FILTER."
,
properties
);
PATTERN_DETECT
.
setProperties
(
"PATTERN_DETECT."
,
properties
);
COMPONENTS
.
setProperties
(
"COMPONENTS."
,
properties
);
SHOW_RESULTS
.
setProperties
(
"SHOW_RESULTS."
,
properties
);
MULTIFILE_PSF
.
setProperties
(
"MULTIFILE_PSF."
,
properties
);
PROCESS_PARAMETERS
.
setProperties
(
"PROCESS_PARAMETERS."
,
properties
);
DISTORTION
.
setProperties
(
"DISTORTION."
,
properties
);
LASER_POINTERS
.
setProperties
(
"LASER."
,
properties
);
FLATFIELD_PARAMETERS
.
setProperties
(
"FLATFIELD_PARAMETERS."
,
properties
);
PATTERN_PARAMETERS
.
setProperties
(
"PATTERN_PARAMETERS."
,
properties
);
LENS_DISTORTION_PARAMETERS
.
setProperties
(
"LENS_DISTORTION_PARAMETERS."
,
properties
);
EYESIS_CAMERA_PARAMETERS
.
setProperties
(
"EYESIS_CAMERA_PARAMETERS."
,
properties
);
LASERS
.
setProperties
(
"LASERS."
,
properties
);
CAMERAS
.
setProperties
(
"CAMERAS."
,
properties
);
DISTORTION_PROCESS_CONFIGURATION
.
setProperties
(
"DISTORTION_PROCESS_CONFIGURATION."
,
properties
);
REFINE_PARAMETERS
.
setProperties
(
"REFINE_PARAMETERS."
,
properties
);
FOCUS_MEASUREMENT_PARAMETERS
.
setProperties
(
"FOCUS_MEASUREMENT_PARAMETERS."
,
properties
);
MOTORS
.
focusingHistory
.
setProperties
(
"FOCUSING_HISTORY."
,
properties
);
GONIOMETER_PARAMETERS
.
setProperties
(
"GONIOMETER_PARAMETERS."
,
properties
);
ABERRATIONS_PARAMETERS
.
setProperties
(
"ABERRATIONS_PARAMETERS."
,
properties
);
if
(
FOCUSING_FIELD
!=
null
)
FOCUSING_FIELD
.
setProperties
(
"FOCUSING_FIELD."
,
properties
);
boolean
select
=
(
properties
.
getProperty
(
"selected"
)!=
null
);
boolean
select_MASTER_DEBUG_LEVEL
=!
select
;
boolean
select_SHOW_AS_STACKS
=!
select
;
boolean
select_FFT_SIZE
=!
select
;
boolean
select_MAP_FFT_SIZE
=!
select
;
boolean
select_GAUSS_WIDTH
=!
select
;
boolean
select_FFT_OVERLAP
=!
select
;
boolean
select_PSF_SUBPIXEL
=!
select
;
boolean
select_PSF_SAVE_FILE
=!
select
;
boolean
select_THREADS_MAX
=!
select
;
boolean
select_UPDATE_STATUS
=!
select
;
boolean
select_SIMUL
=!
select
;
boolean
select_INTERPOLATE
=!
select
;
boolean
select_INVERSE
=!
select
;
boolean
select_PSF_PARS
=!
select
;
boolean
select_OTF_FILTER
=!
select
;
boolean
select_PATTERN_DETECT
=!
select
;
boolean
select_COMPONENTS
=!
select
;
boolean
select_SHOW_RESULTS
=!
select
;
boolean
select_MULTIFILE_PSF
=!
select
;
boolean
select_PROCESS_PARAMETERS
=!
select
;
boolean
select_DISTORTION
=!
select
;
boolean
select_LASER_POINTERS
=!
select
;
boolean
select_FLATFIELD_PARAMETERS
=!
select
;
boolean
select_PATTERN_PARAMETERS
=!
select
;
boolean
select_LENS_DISTORTION_PARAMETERS
=!
select
;
boolean
select_EYESIS_CAMERA_PARAMETERS
=!
select
;
boolean
select_LASERS
=!
select
;
boolean
select_CAMERAS
=!
select
;
boolean
select_DISTORTION_PROCESS_CONFIGURATION
=!
select
;
boolean
select_REFINE_PARAMETERS
=!
select
;
boolean
select_FOCUS_MEASUREMENT_PARAMETERS
=!
select
;
boolean
select_MOTORS_focusingHistory
=!
select
;
boolean
select_GONIOMETER_PARAMETERS
=!
select
;
boolean
select_ABERRATIONS_PARAMETERS
=!
select
;
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
){
...
...
src/main/java/FocusingField.java
View file @
3fa095d3
...
...
@@ -333,92 +333,105 @@ public class FocusingField {
}
public
void
setProperties
(
String
prefix
,
Properties
properties
){
if
(
debugLevel
>
1
)
System
.
out
.
println
(
"FocusingField: setProperties()"
);
if
(
fieldFitting
==
null
)
{
System
.
out
.
println
(
"fieldFitting is not initialized, nothing to save"
);
return
;
}
fieldFitting
.
setProperties
(
prefix
+
"fieldFitting."
,
properties
);
properties
.
setProperty
(
prefix
+
"pX0_distortions"
,
pX0_distortions
+
""
);
properties
.
setProperty
(
prefix
+
"pY0_distortions"
,
pY0_distortions
+
""
);
properties
.
setProperty
(
prefix
+
"currentPX0"
,
currentPX0
+
""
);
properties
.
setProperty
(
prefix
+
"currentPY0"
,
currentPY0
+
""
);
properties
.
setProperty
(
prefix
+
"sagittalMaster"
,
sagittalMaster
+
""
);
properties
.
setProperty
(
prefix
+
"parallelOnly"
,
parallelOnly
+
""
);
properties
.
setProperty
(
prefix
+
"filterInput"
,
filterInput
+
""
);
properties
.
setProperty
(
prefix
+
"filterInputMotorDiff"
,
filterInputMotorDiff
+
""
);
properties
.
setProperty
(
prefix
+
"filterInputDiff"
,
filterInputDiff
+
""
);
properties
.
setProperty
(
prefix
+
"filterInputFirstLast"
,
filterInputFirstLast
+
""
);
properties
.
setProperty
(
prefix
+
"filterInputTooFar"
,
filterInputTooFar
+
""
);
properties
.
setProperty
(
prefix
+
"filterInputFarRatio"
,
filterInputFarRatio
+
""
);
properties
.
setProperty
(
prefix
+
"filterInputConcave"
,
filterInputConcave
+
""
);
properties
.
setProperty
(
prefix
+
"filterInputConcaveSigma"
,
filterInputConcaveSigma
+
""
);
properties
.
setProperty
(
prefix
+
"filterInputConcaveRemoveFew"
,
filterInputConcaveRemoveFew
+
""
);
properties
.
setProperty
(
prefix
+
"filterInputConcaveMinSeries"
,
filterInputConcaveMinSeries
+
""
);
properties
.
setProperty
(
prefix
+
"filterInputConcaveScale"
,
filterInputConcaveScale
+
""
);
properties
.
setProperty
(
prefix
+
"filterZ"
,
filterZ
+
""
);
properties
.
setProperty
(
prefix
+
"filterTiltedZ"
,
filterTiltedZ
+
""
);
properties
.
setProperty
(
prefix
+
"filterByValueScale"
,
filterByValueScale
+
""
);
properties
.
setProperty
(
prefix
+
"filterTiltedByValueScale"
,
filterTiltedByValueScale
+
""
);
properties
.
setProperty
(
prefix
+
"filterByScanValue"
,
filterByScanValue
+
""
);
properties
.
setProperty
(
prefix
+
"filterTiltedByScanValue"
,
filterTiltedByScanValue
+
""
);
properties
.
setProperty
(
prefix
+
"minLeftSamples"
,
minLeftSamples
+
""
);
properties
.
setProperty
(
prefix
+
"minCenterSamplesBest"
,
minCenterSamplesBest
+
""
);
properties
.
setProperty
(
prefix
+
"minCenterSamplesTotal"
,
minCenterSamplesTotal
+
""
);
properties
.
setProperty
(
prefix
+
"centerSamples"
,
centerSamples
+
""
);
properties
.
setProperty
(
prefix
+
"maxRMS"
,
maxRMS
+
""
);
properties
.
setProperty
(
prefix
+
"zMin"
,
zMin
+
""
);
properties
.
setProperty
(
prefix
+
"zMax"
,
zMax
+
""
);
properties
.
setProperty
(
prefix
+
"zStep"
,
zStep
+
""
);
properties
.
setProperty
(
prefix
+
"tMin"
,
tMin
+
""
);
properties
.
setProperty
(
prefix
+
"tMax"
,
tMax
+
""
);
properties
.
setProperty
(
prefix
+
"tStep"
,
tStep
+
""
);
properties
.
setProperty
(
prefix
+
"targetRelFocalShift"
,
targetRelFocalShift
+
""
);
for
(
int
chn
=
0
;
chn
<
minMeas
.
length
;
chn
++)
properties
.
setProperty
(
prefix
+
"minMeas_"
+
chn
,
minMeas
[
chn
]+
""
);
for
(
int
chn
=
0
;
chn
<
maxMeas
.
length
;
chn
++)
properties
.
setProperty
(
prefix
+
"maxMeas_"
+
chn
,
maxMeas
[
chn
]+
""
);
for
(
int
chn
=
0
;
chn
<
thresholdMax
.
length
;
chn
++)
properties
.
setProperty
(
prefix
+
"thresholdMax_"
+
chn
,
thresholdMax
[
chn
]+
""
);
properties
.
setProperty
(
prefix
+
"useMinMeas"
,
useMinMeas
+
""
);
properties
.
setProperty
(
prefix
+
"useMaxMeas"
,
useMaxMeas
+
""
);
properties
.
setProperty
(
prefix
+
"useThresholdMax"
,
useThresholdMax
+
""
);
properties
.
setProperty
(
prefix
+
"weightMode"
,
weightMode
+
""
);
properties
.
setProperty
(
prefix
+
"weightRadius"
,
weightRadius
+
""
);
properties
.
setProperty
(
prefix
+
"k_red"
,
k_red
+
""
);
properties
.
setProperty
(
prefix
+
"k_blue"
,
k_blue
+
""
);
properties
.
setProperty
(
prefix
+
"qb_scan_below"
,
qb_scan_below
+
""
);
properties
.
setProperty
(
prefix
+
"qb_scan_above"
,
qb_scan_above
+
""
);
properties
.
setProperty
(
prefix
+
"qb_scan_step"
,
qb_scan_step
+
""
);
properties
.
setProperty
(
prefix
+
"qb_use_corrected"
,
qb_use_corrected
+
""
);
properties
.
setProperty
(
prefix
+
"qb_invert"
,
qb_invert
+
""
);
properties
.
setProperty
(
prefix
+
"z_relative"
,
z_relative
+
""
);
properties
.
setProperty
(
prefix
+
"rslt_show_z_axial"
,
rslt_show_z_axial
+
""
);
properties
.
setProperty
(
prefix
+
"rslt_show_z_smooth"
,
rslt_show_z_smooth
+
""
);
properties
.
setProperty
(
prefix
+
"rslt_show_z_individual"
,
rslt_show_z_individual
+
""
);
properties
.
setProperty
(
prefix
+
"rslt_show_f_axial"
,
rslt_show_f_axial
+
""
);
properties
.
setProperty
(
prefix
+
"rslt_show_f_smooth"
,
rslt_show_f_smooth
+
""
);
properties
.
setProperty
(
prefix
+
"rslt_show_f_individual"
,
rslt_show_f_individual
+
""
);
properties
.
setProperty
(
prefix
+
"rslt_show_smooth_sigma"
,
rslt_show_smooth_sigma
+
""
);
properties
.
setProperty
(
prefix
+
"rslt_scan_below"
,
rslt_scan_below
+
""
);
properties
.
setProperty
(
prefix
+
"rslt_scan_above"
,
rslt_scan_above
+
""
);
properties
.
setProperty
(
prefix
+
"rslt_scan_step"
,
rslt_scan_step
+
""
);
properties
.
setProperty
(
prefix
+
"rslt_mtf50_mode"
,
rslt_mtf50_mode
+
""
);
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
]+
""
);
// always re-calculate here? - only in calibration mode or restore calibration mode? No, only in LMA in calibration mode
// zRanges=calcZRanges(dataWeightsToBoolean());
if
(
zRanges
!=
null
){
properties
.
setProperty
(
prefix
+
"zRanges_length"
,
zRanges
.
length
+
""
);
for
(
int
chn
=
0
;
chn
<
zRanges
.
length
;
chn
++)
if
(
zRanges
[
chn
]!=
null
)
{
properties
.
setProperty
(
prefix
+
"zRanges_"
+
chn
+
"_length"
,
zRanges
[
chn
].
length
+
""
);
for
(
int
sample
=
0
;
sample
<
zRanges
[
chn
].
length
;
sample
++)
if
(
zRanges
[
chn
][
sample
]!=
null
)
{
properties
.
setProperty
(
prefix
+
"zRanges_"
+
chn
+
"_"
+
sample
,
zRanges
[
chn
][
sample
][
0
]+
","
+
zRanges
[
chn
][
sample
][
1
]+
","
+
zRanges
[
chn
][
sample
][
2
]);
}
}
}
}
public
void
setProperties
(
String
prefix
,
Properties
properties
){
if
(
debugLevel
>
1
)
System
.
out
.
println
(
"FocusingField: setProperties()"
);
if
(
fieldFitting
==
null
)
{
System
.
out
.
println
(
"fieldFitting is not initialized, nothing to save"
);
return
;
}
boolean
select
=
(
properties
.
getProperty
(
"selected"
)!=
null
);
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
+
"pY0_distortions"
,
pY0_distortions
+
""
);
properties
.
setProperty
(
prefix
+
"currentPX0"
,
currentPX0
+
""
);
properties
.
setProperty
(
prefix
+
"currentPY0"
,
currentPY0
+
""
);
properties
.
setProperty
(
prefix
+
"sagittalMaster"
,
sagittalMaster
+
""
);
properties
.
setProperty
(
prefix
+
"parallelOnly"
,
parallelOnly
+
""
);
properties
.
setProperty
(
prefix
+
"filterInput"
,
filterInput
+
""
);
properties
.
setProperty
(
prefix
+
"filterInputMotorDiff"
,
filterInputMotorDiff
+
""
);
properties
.
setProperty
(
prefix
+
"filterInputDiff"
,
filterInputDiff
+
""
);
properties
.
setProperty
(
prefix
+
"filterInputFirstLast"
,
filterInputFirstLast
+
""
);
properties
.
setProperty
(
prefix
+
"filterInputTooFar"
,
filterInputTooFar
+
""
);
properties
.
setProperty
(
prefix
+
"filterInputFarRatio"
,
filterInputFarRatio
+
""
);
properties
.
setProperty
(
prefix
+
"filterInputConcave"
,
filterInputConcave
+
""
);
properties
.
setProperty
(
prefix
+
"filterInputConcaveSigma"
,
filterInputConcaveSigma
+
""
);
properties
.
setProperty
(
prefix
+
"filterInputConcaveRemoveFew"
,
filterInputConcaveRemoveFew
+
""
);
properties
.
setProperty
(
prefix
+
"filterInputConcaveMinSeries"
,
filterInputConcaveMinSeries
+
""
);
properties
.
setProperty
(
prefix
+
"filterInputConcaveScale"
,
filterInputConcaveScale
+
""
);
properties
.
setProperty
(
prefix
+
"filterZ"
,
filterZ
+
""
);
properties
.
setProperty
(
prefix
+
"filterTiltedZ"
,
filterTiltedZ
+
""
);
properties
.
setProperty
(
prefix
+
"filterByValueScale"
,
filterByValueScale
+
""
);
properties
.
setProperty
(
prefix
+
"filterTiltedByValueScale"
,
filterTiltedByValueScale
+
""
);
properties
.
setProperty
(
prefix
+
"filterByScanValue"
,
filterByScanValue
+
""
);
properties
.
setProperty
(
prefix
+
"filterTiltedByScanValue"
,
filterTiltedByScanValue
+
""
);
properties
.
setProperty
(
prefix
+
"minLeftSamples"
,
minLeftSamples
+
""
);
properties
.
setProperty
(
prefix
+
"minCenterSamplesBest"
,
minCenterSamplesBest
+
""
);
properties
.
setProperty
(
prefix
+
"minCenterSamplesTotal"
,
minCenterSamplesTotal
+
""
);
properties
.
setProperty
(
prefix
+
"centerSamples"
,
centerSamples
+
""
);
properties
.
setProperty
(
prefix
+
"maxRMS"
,
maxRMS
+
""
);
properties
.
setProperty
(
prefix
+
"zMin"
,
zMin
+
""
);
properties
.
setProperty
(
prefix
+
"zMax"
,
zMax
+
""
);
properties
.
setProperty
(
prefix
+
"zStep"
,
zStep
+
""
);
properties
.
setProperty
(
prefix
+
"tMin"
,
tMin
+
""
);
properties
.
setProperty
(
prefix
+
"tMax"
,
tMax
+
""
);
properties
.
setProperty
(
prefix
+
"tStep"
,
tStep
+
""
);
properties
.
setProperty
(
prefix
+
"targetRelFocalShift"
,
targetRelFocalShift
+
""
);
for
(
int
chn
=
0
;
chn
<
minMeas
.
length
;
chn
++)
properties
.
setProperty
(
prefix
+
"minMeas_"
+
chn
,
minMeas
[
chn
]+
""
);
for
(
int
chn
=
0
;
chn
<
maxMeas
.
length
;
chn
++)
properties
.
setProperty
(
prefix
+
"maxMeas_"
+
chn
,
maxMeas
[
chn
]+
""
);
for
(
int
chn
=
0
;
chn
<
thresholdMax
.
length
;
chn
++)
properties
.
setProperty
(
prefix
+
"thresholdMax_"
+
chn
,
thresholdMax
[
chn
]+
""
);
properties
.
setProperty
(
prefix
+
"useMinMeas"
,
useMinMeas
+
""
);
properties
.
setProperty
(
prefix
+
"useMaxMeas"
,
useMaxMeas
+
""
);
properties
.
setProperty
(
prefix
+
"useThresholdMax"
,
useThresholdMax
+
""
);
properties
.
setProperty
(
prefix
+
"weightMode"
,
weightMode
+
""
);
properties
.
setProperty
(
prefix
+
"weightRadius"
,
weightRadius
+
""
);
properties
.
setProperty
(
prefix
+
"k_red"
,
k_red
+
""
);
properties
.
setProperty
(
prefix
+
"k_blue"
,
k_blue
+
""
);
properties
.
setProperty
(
prefix
+
"qb_scan_below"
,
qb_scan_below
+
""
);
properties
.
setProperty
(
prefix
+
"qb_scan_above"
,
qb_scan_above
+
""
);
properties
.
setProperty
(
prefix
+
"qb_scan_step"
,
qb_scan_step
+
""
);
properties
.
setProperty
(
prefix
+
"qb_use_corrected"
,
qb_use_corrected
+
""
);
properties
.
setProperty
(
prefix
+
"qb_invert"
,
qb_invert
+
""
);
properties
.
setProperty
(
prefix
+
"z_relative"
,
z_relative
+
""
);
properties
.
setProperty
(
prefix
+
"rslt_show_z_axial"
,
rslt_show_z_axial
+
""
);
properties
.
setProperty
(
prefix
+
"rslt_show_z_smooth"
,
rslt_show_z_smooth
+
""
);
properties
.
setProperty
(
prefix
+
"rslt_show_z_individual"
,
rslt_show_z_individual
+
""
);
properties
.
setProperty
(
prefix
+
"rslt_show_f_axial"
,
rslt_show_f_axial
+
""
);
properties
.
setProperty
(
prefix
+
"rslt_show_f_smooth"
,
rslt_show_f_smooth
+
""
);
properties
.
setProperty
(
prefix
+
"rslt_show_f_individual"
,
rslt_show_f_individual
+
""
);
properties
.
setProperty
(
prefix
+
"rslt_show_smooth_sigma"
,
rslt_show_smooth_sigma
+
""
);
properties
.
setProperty
(
prefix
+
"rslt_scan_below"
,
rslt_scan_below
+
""
);
properties
.
setProperty
(
prefix
+
"rslt_scan_above"
,
rslt_scan_above
+
""
);
properties
.
setProperty
(
prefix
+
"rslt_scan_step"
,
rslt_scan_step
+
""
);
properties
.
setProperty
(
prefix
+
"rslt_mtf50_mode"
,
rslt_mtf50_mode
+
""
);
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
]+
""
);
// always re-calculate here? - only in calibration mode or restore calibration mode? No, only in LMA in calibration mode
// zRanges=calcZRanges(dataWeightsToBoolean());
if
(
zRanges
!=
null
){
properties
.
setProperty
(
prefix
+
"zRanges_length"
,
zRanges
.
length
+
""
);
for
(
int
chn
=
0
;
chn
<
zRanges
.
length
;
chn
++)
if
(
zRanges
[
chn
]!=
null
)
{
properties
.
setProperty
(
prefix
+
"zRanges_"
+
chn
+
"_length"
,
zRanges
[
chn
].
length
+
""
);
for
(
int
sample
=
0
;
sample
<
zRanges
[
chn
].
length
;
sample
++)
if
(
zRanges
[
chn
][
sample
]!=
null
)
{
properties
.
setProperty
(
prefix
+
"zRanges_"
+
chn
+
"_"
+
sample
,
zRanges
[
chn
][
sample
][
0
]+
","
+
zRanges
[
chn
][
sample
][
1
]+
","
+
zRanges
[
chn
][
sample
][
2
]);
}
}
}
}
}
public
void
getProperties
(
String
prefix
,
Properties
properties
){
savedProperties
=
properties
;
...
...
@@ -4569,52 +4582,76 @@ public boolean LevenbergMarquardt(
"Green, sagittal"
,
"Green, tangential"
,
"Blue, sagittal"
,
"Blue, tangential"
};
public
void
setProperties
(
String
prefix
,
Properties
properties
){
if
(
mechanicalFocusingModel
==
null
){
if
(
debugLevel
>
1
)
System
.
out
.
println
(
"Mechanical properties not yet initialized, will save properties later"
);
return
;
}
properties
.
setProperty
(
prefix
+
"numberOfLocations"
,
numberOfLocations
+
""
);
properties
.
setProperty
(
prefix
+
"centerSelect_X"
,
centerSelect
[
0
]+
""
);
properties
.
setProperty
(
prefix
+
"centerSelect_Y"
,
centerSelect
[
1
]+
""
);
mechanicalFocusingModel
.
setProperties
(
prefix
+
"mechanicalFocusingModel."
,
properties
);
for
(
int
i
=
0
;
i
<
curvatureModel
.
length
;
i
++){
if
(
curvatureModel
[
i
]!=
null
)
curvatureModel
[
i
].
setProperties
(
prefix
+
"curvatureModel_"
+
i
+
"."
,
properties
);
}
if
(
channelSelect
!=
null
)
for
(
int
i
=
0
;
i
<
channelSelect
.
length
;
i
++){
properties
.
setProperty
(
prefix
+
"channelSelect_"
+
i
,
channelSelect
[
i
]+
""
);
}
if
(
mechanicalSelect
!=
null
)
for
(
int
i
=
0
;
i
<
mechanicalSelect
.
length
;
i
++){
properties
.
setProperty
(
prefix
+
"mechanicalSelect_"
+
i
,
mechanicalSelect
[
i
]+
""
);
}
for
(
int
chn
=
0
;
chn
<
curvatureSelect
.
length
;
chn
++)
if
(
curvatureSelect
[
chn
]!=
null
)
for
(
int
i
=
0
;
i
<
curvatureSelect
[
chn
].
length
;
i
++){
properties
.
setProperty
(
prefix
+
"curvatureSelect_"
+
chn
+
"_"
+
i
,
curvatureSelect
[
chn
][
i
]+
""
);
}
for
(
int
chn
=
0
;
chn
<
sampleCorrSelect
.
length
;
chn
++)
if
(
sampleCorrSelect
[
chn
]!=
null
)
for
(
int
i
=
0
;
i
<
sampleCorrSelect
[
chn
].
length
;
i
++){
properties
.
setProperty
(
prefix
+
"sampleCorrSelect_"
+
chn
+
"_"
+
i
,
sampleCorrSelect
[
chn
][
i
]+
""
);
}
for
(
int
chn
=
0
;
chn
<
sampleCorrCost
.
length
;
chn
++)
if
(
sampleCorrCost
[
chn
]!=
null
)
for
(
int
i
=
0
;
i
<
sampleCorrCost
[
chn
].
length
;
i
++){
properties
.
setProperty
(
prefix
+
"sampleCorrCost_"
+
chn
+
"_"
+
i
,
sampleCorrCost
[
chn
][
i
]+
""
);
}
for
(
int
chn
=
0
;
chn
<
sampleCorrSigma
.
length
;
chn
++)
if
(
sampleCorrSigma
[
chn
]!=
null
)
for
(
int
i
=
0
;
i
<
sampleCorrSigma
[
chn
].
length
;
i
++){
properties
.
setProperty
(
prefix
+
"sampleCorrSigma_"
+
chn
+
"_"
+
i
,
sampleCorrSigma
[
chn
][
i
]+
""
);
}
for
(
int
chn
=
0
;
chn
<
sampleCorrPullZero
.
length
;
chn
++)
if
(
sampleCorrPullZero
[
chn
]!=
null
)
for
(
int
i
=
0
;
i
<
sampleCorrPullZero
[
chn
].
length
;
i
++){
properties
.
setProperty
(
prefix
+
"sampleCorrPullZero_"
+
chn
+
"_"
+
i
,
sampleCorrPullZero
[
chn
][
i
]+
""
);
}
// save correction parameters values
// private double [][][] correctionParameters=new double[6][][]; // all
if
(
correctionParameters
!=
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
i
=
0
;
i
<
correctionParameters
[
chn
][
np
].
length
;
i
++){
properties
.
setProperty
(
prefix
+
"correctionParameters_"
+
chn
+
"_"
+
np
+
"_"
+
i
,
correctionParameters
[
chn
][
np
][
i
]+
""
);
}
}
}
}
fieldStrategies
.
setProperties
(
prefix
+
"fieldStrategies."
,
properties
);
}
public
void
setProperties
(
String
prefix
,
Properties
properties
){
if
(
mechanicalFocusingModel
==
null
){
if
(
debugLevel
>
1
)
System
.
out
.
println
(
"Mechanical properties not yet initialized, will save properties later"
);
return
;
}
boolean
select
=
(
properties
.
getProperty
(
"selected"
)!=
null
);
boolean
select_mechanicalFocusingModel
=!
select
;
boolean
select_curvatureModel
=!
select
;
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
++){
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
++){
properties
.
setProperty
(
prefix
+
"channelSelect_"
+
i
,
channelSelect
[
i
]+
""
);
}
if
(
mechanicalSelect
!=
null
)
for
(
int
i
=
0
;
i
<
mechanicalSelect
.
length
;
i
++){
properties
.
setProperty
(
prefix
+
"mechanicalSelect_"
+
i
,
mechanicalSelect
[
i
]+
""
);
}
for
(
int
chn
=
0
;
chn
<
curvatureSelect
.
length
;
chn
++)
if
(
curvatureSelect
[
chn
]!=
null
)
for
(
int
i
=
0
;
i
<
curvatureSelect
[
chn
].
length
;
i
++){
properties
.
setProperty
(
prefix
+
"curvatureSelect_"
+
chn
+
"_"
+
i
,
curvatureSelect
[
chn
][
i
]+
""
);
}
for
(
int
chn
=
0
;
chn
<
sampleCorrSelect
.
length
;
chn
++)
if
(
sampleCorrSelect
[
chn
]!=
null
)
for
(
int
i
=
0
;
i
<
sampleCorrSelect
[
chn
].
length
;
i
++){
properties
.
setProperty
(
prefix
+
"sampleCorrSelect_"
+
chn
+
"_"
+
i
,
sampleCorrSelect
[
chn
][
i
]+
""
);
}
for
(
int
chn
=
0
;
chn
<
sampleCorrCost
.
length
;
chn
++)
if
(
sampleCorrCost
[
chn
]!=
null
)
for
(
int
i
=
0
;
i
<
sampleCorrCost
[
chn
].
length
;
i
++){
properties
.
setProperty
(
prefix
+
"sampleCorrCost_"
+
chn
+
"_"
+
i
,
sampleCorrCost
[
chn
][
i
]+
""
);
}
for
(
int
chn
=
0
;
chn
<
sampleCorrSigma
.
length
;
chn
++)
if
(
sampleCorrSigma
[
chn
]!=
null
)
for
(
int
i
=
0
;
i
<
sampleCorrSigma
[
chn
].
length
;
i
++){
properties
.
setProperty
(
prefix
+
"sampleCorrSigma_"
+
chn
+
"_"
+
i
,
sampleCorrSigma
[
chn
][
i
]+
""
);
}
for
(
int
chn
=
0
;
chn
<
sampleCorrPullZero
.
length
;
chn
++)
if
(
sampleCorrPullZero
[
chn
]!=
null
)
for
(
int
i
=
0
;
i
<
sampleCorrPullZero
[
chn
].
length
;
i
++){
properties
.
setProperty
(
prefix
+
"sampleCorrPullZero_"
+
chn
+
"_"
+
i
,
sampleCorrPullZero
[
chn
][
i
]+
""
);
}
// save correction parameters values
// private double [][][] correctionParameters=new double[6][][]; // all
if
(
correctionParameters
!=
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
i
=
0
;
i
<
correctionParameters
[
chn
][
np
].
length
;
i
++){
properties
.
setProperty
(
prefix
+
"correctionParameters_"
+
chn
+
"_"
+
np
+
"_"
+
i
,
correctionParameters
[
chn
][
np
][
i
]+
""
);
}
}
}
}
}
if
(
select_fieldStrategies
)
fieldStrategies
.
setProperties
(
prefix
+
"fieldStrategies."
,
properties
);
}
public
void
getProperties
(
String
prefix
,
Properties
properties
){
if
(
properties
.
getProperty
(
prefix
+
"numberOfLocations"
)!=
null
)
numberOfLocations
=
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"numberOfLocations"
));
...
...
@@ -7124,8 +7161,8 @@ f_corr: d_fcorr/d_zcorr=0, other: a, reff, kx -> ar[1], ar[2], ar[3], ar[4]
}
gd
.
enableYesNoCancel
(
"Apply"
,
"Keep"
);
// default OK (on enter) - "Apply"
WindowTools
.
addScrollBars
(
gd
);
gd
.
showDialog
();
WindowTools
.
addScrollBars
(
gd
);
gd
.
showDialog
();
if
(
gd
.
wasCanceled
())
return
null
;
if
(
gd
.
wasOKed
())
{
// selected non-default "Apply"
if
(
detailed
){
...
...
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