Commit 75d7b5e2 authored by Andrey Filippov's avatar Andrey Filippov

more controls

parent e12ae0b2
......@@ -510,7 +510,8 @@ public class EyesisCorrectionParameters {
return true;
}
public boolean showCLTDialog(String title) {
public boolean showCLTDialog(String title,
CLTParameters clt_parameters) {
GenericDialog gd = new GenericDialog(title);
gd.addCheckbox ("Save current settings with results", this.saveSettings); // 1
......@@ -551,8 +552,13 @@ public class EyesisCorrectionParameters {
gd.addCheckbox ("Assign tiles to surfaces", this.clt_batch_assign); // 26
gd.addCheckbox ("Generate 3d output: x3d and/or obj+mtl", this.clt_batch_gen3d); // 27
gd.addCheckbox ("Generate debug images if a single set is selected", this.clt_batch_dbg1); // 28
if (clt_parameters != null) {
gd.addMessage ("============ selected CLT parameters ============");
gd.addNumericField("Maximal disparity to try", clt_parameters.grow_disp_max, 6);
gd.addCheckbox ("Equalize green channel gain of the individual cnannels (bug fix for exposure)", clt_parameters.gain_equalize);
gd.addNumericField("Inverse distance to infinity (misalignment correction)", clt_parameters.z_correction, 6);
}
WindowTools.addScrollBars(gd);
gd.showDialog();
if (gd.wasCanceled()) return false;
......@@ -584,6 +590,11 @@ public class EyesisCorrectionParameters {
this.clt_batch_assign= gd.getNextBoolean(); // 26
this.clt_batch_gen3d= gd.getNextBoolean(); // 27
this.clt_batch_dbg1= gd.getNextBoolean(); // 28
if (clt_parameters != null) {
clt_parameters.grow_disp_max = gd.getNextNumber();
clt_parameters.gain_equalize = gd.getNextBoolean();
clt_parameters.z_correction = gd.getNextNumber();
}
return true;
}
......@@ -3947,7 +3958,7 @@ public class EyesisCorrectionParameters {
gd.addNumericField("Do not try to correct vignetting smaller than this fraction of max", this.vignetting_range, 3);
gd.addNumericField("Kernel step in pixels (has 1 kernel margin on each side)", this.kernel_step, 0);
gd.addNumericField("Nominal (rectilinear) disparity between side of square cameras (pix)", this.disparity, 3);
gd.addNumericField("Inverse distance to infinity (misalignment cortrection)", this.z_correction, 6);
gd.addNumericField("Inverse distance to infinity (misalignment correction)", this.z_correction, 6);
gd.addCheckbox ("Perform correlation", this.correlate);
gd.addNumericField("Bitmask of pairs to combine in the composite (top, bottom, left,righth)", this.corr_mask, 0);
gd.addCheckbox ("Combine correlation with mirrored around disparity direction", this.corr_sym);
......
......@@ -2374,6 +2374,23 @@ public class EyesisCorrections {
boolean png,
boolean show,
int jpegQuality){// <0 - keep current, 0 - force Tiff, >0 use for JPEG
saveAndShow(
imp,
path,
png,
show,
jpegQuality,// <0 - keep current, 0 - force Tiff, >0 use for JPEG
this.debugLevel);
}
void saveAndShow(
ImagePlus imp,
String path,
boolean png,
boolean show,
int jpegQuality,// <0 - keep current, 0 - force Tiff, >0 use for JPEG
int debugLevel){
if (path!=null) {
path+=Prefs.getFileSeparator()+imp.getTitle();
boolean hasAlphaHighByte = false;
......@@ -2389,14 +2406,14 @@ public class EyesisCorrections {
if (hasAlphaHighByte){
if (png){
if (this.debugLevel > 0) System.out.println("Saving RGBA result to "+path+".png");
if (debugLevel > 0) System.out.println("Saving RGBA result to "+path+".png");
(new EyesisTiff()).savePNG_ARGB32(
imp,
path+".png"
);
} else {
if (this.debugLevel > 0) System.out.println("Saving RGBA result to "+path+".tiff");
if (debugLevel > 0) System.out.println("Saving RGBA result to "+path+".tiff");
try {
(new EyesisTiff()).saveTiffARGB32(
imp,
......@@ -2415,12 +2432,12 @@ public class EyesisCorrections {
}
} else if (((imp.getStackSize()==1)) && (jpegQuality!=0) && ((imp.getFileInfo().fileType== FileInfo.RGB) || (jpegQuality>0))) {
if (this.debugLevel>0) System.out.println("Saving result to "+path+".jpeg");
if (debugLevel>0) System.out.println("Saving result to "+path+".jpeg");
FileSaver fs=new FileSaver(imp);
if (jpegQuality>0) FileSaver.setJpegQuality(jpegQuality);
fs.saveAsJpeg(path+".jpeg");
} else {
if (this.debugLevel>0) System.out.println("Saving result to "+path+".tiff");
if (debugLevel>0) System.out.println("Saving result to "+path+".tiff");
FileSaver fs=new FileSaver(imp);
// Save as RGBA if it is RGBA
int bytesPerPixel = imp.getBytesPerPixel();
......@@ -2468,7 +2485,7 @@ public class EyesisCorrections {
if (path!=null) {
path+=Prefs.getFileSeparator()+compositeImage.getTitle();
if (this.debugLevel>0) System.out.println("Saving result to "+path+".tiff");
if (debugLevel>0) System.out.println("Saving result to "+path+".tiff");
FileSaver fs=new FileSaver(compositeImage);
if (compositeImage.getStackSize()>1) fs.saveAsTiffStack(path+".tiff");
else fs.saveAsTiff(path+".tiff");
......
......@@ -3671,7 +3671,7 @@ private Panel panel1,
/* ======================================================================== */
} else if (label.equals("Setup CLT Batch parameters")) {
DEBUG_LEVEL=MASTER_DEBUG_LEVEL;
CORRECTION_PARAMETERS.showCLTDialog("CLT Batch parameters");
CORRECTION_PARAMETERS.showCLTDialog("CLT Batch parameters",CLT_PARAMETERS);
return;
/* ======================================================================== */
......
......@@ -4020,7 +4020,8 @@ public class QuadCLT {
x3d_path,
correctionsParameters.png && !clt_parameters.black_back,
!batch_mode && clt_parameters.show_textures,
correctionsParameters.JPEG_quality); // jpegQuality); // jpegQuality){// <0 - keep current, 0 - force Tiff, >0 use for JPEG
correctionsParameters.JPEG_quality, // jpegQuality); // jpegQuality){// <0 - keep current, 0 - force Tiff, >0 use for JPEG
(debugLevel > 0) ? debugLevel : 1); // int debugLevel (print what it saves)
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment