Commit 01fd355c authored by Andrey Filippov's avatar Andrey Filippov

next snapshot

parent a5181629
......@@ -65,6 +65,7 @@
</testResource>
</testResources>
<plugins>
<!--
<plugin>
<groupId>com.elphel</groupId>
<artifactId>imagej-elphel</artifactId>
......@@ -76,10 +77,46 @@
</execution>
</executions>
<configuration>
<mainClass>Process_Pixels</mainClass>
<mainClass>Aberration_Calibration</mainClass>
</configuration>
</plugin>
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>3.2</version>
<configuration>
<!-- see http://jira.codehaus.org/browse/MNG-5346 -->
<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
</configuration>
<executions>
<execution>
<id>mojo-descriptor</id>
<goals>
<goal>descriptor</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>Aberration_Calibration</mainClass>
</configuration>
</plugin>
</plugins>
</build>
<developers>
......@@ -104,13 +141,18 @@
<id>imagej.public</id>
<url>http://maven.imagej.net/content/groups/public</url>
</repository>
<repository>
<id>elphel.imagej-elphel</id>
<url>https://github.com/Elphel/imagej-elphel</url>
</repository>
</repositories>
<scm>
<connection>scm:git:git://github.com/Elphel/imagej-elphel</connection>
<developerConnection>sscm:git:https://github.com/Elphel/imagej-elphel</developerConnection>
<tag>HEAD</tag>
<url>https://github.com/Elphel/imagej-elpheln</url>
<url>https://github.com/Elphel/imagej-elphel</url>
</scm>
<dependencyManagement>
......@@ -123,4 +165,5 @@
</dependency>
</dependencies>
</dependencyManagement>
<packaging>maven-plugin</packaging>
</project>
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -27,7 +27,7 @@ public class CalibrationFileManagement {
}
*/
/** ======================================================================== */
/* ======================================================================== */
public static String selectDirectory(boolean save, String title, String button, FileFilter filter, String defaultPath) {
return selectDirectoryOrFile(false, save,true, title, button, filter,defaultPath); // always open dialog
}
......@@ -56,7 +56,7 @@ public class CalibrationFileManagement {
public static String [] selectFiles(boolean save, String title, String button, FileFilter filter, String [] defaultPaths) {
return selectDirectoriesOrFiles(save,false, title, button, filter, defaultPaths );
}
/** ======================================================================== */
/* ======================================================================== */
public static String [] selectDirectoriesOrFiles(boolean save,
boolean directory,
String title,
......@@ -204,7 +204,7 @@ public class CalibrationFileManagement {
}
}
/** ======================================================================== */
/* ======================================================================== */
static class MultipleExtensionsFileFilter extends FileFilter implements FilenameFilter {
protected String [] patterns; // case insensitive
protected String description="JP4 files";
......
......@@ -1762,7 +1762,7 @@ public class CalibrationHardwareInterface {
}
/** Create a Thread[] array as large as the number of processors available.
/* Create a Thread[] array as large as the number of processors available.
* From Stephan Preibisch's Multithreading.java class. See:
* http://repo.or.cz/w/trakem2.git?a=blob;f=mpi/fruitfly/general/MultiThreading.java;hb=HEAD
*/
......@@ -1771,7 +1771,7 @@ public class CalibrationHardwareInterface {
if (n_cpus>maxCPUs)n_cpus=maxCPUs;
return new Thread[n_cpus];
}
/** Start all given threads and wait on each of them until all are done.
/* Start all given threads and wait on each of them until all are done.
* From Stephan Preibisch's Multithreading.java class. See:
* http://repo.or.cz/w/trakem2.git?a=blob;f=mpi/fruitfly/general/MultiThreading.java;hb=HEAD
*/
......
......@@ -77,7 +77,7 @@ public class CorrectionColorProc {
int length=fpixels_r.length;
int width= stack.getWidth();
int height=stack.getHeight();
/** Scale colors, gamma-convert */
/* Scale colors, gamma-convert */
int i;
double gain_red= thisBalanceRed* thisGain/scale;
double gain_blue=thisBalanceBlue*thisGain/scale;
......@@ -136,13 +136,13 @@ public class CorrectionColorProc {
}
}
/** Convert to YPbPr */
/* Convert to YPbPr */
double Y,Pb,Pr;
// double Kg=1.0-colorProcParameters.kr-colorProcParameters.kb;
double Sb=0.5/(1.0-colorProcParameters.kb)*colorProcParameters.saturationBlue;
double Sr=0.5/(1.0-colorProcParameters.kr)*colorProcParameters.saturationRed;
double Yr,Yg,Yb,Wr,Wg,Wb,S;
/** coefficients to find Y from Pb, Pr and a color (R,G or B)
/* coefficients to find Y from Pb, Pr and a color (R,G or B)
Yr = R- Pr*KPrR
Yb = B- Pb*KPbB
Yg = G+ Pr*KPrG + Pb*KPbG
......@@ -178,7 +178,7 @@ public class CorrectionColorProc {
fpixels_pr[i] = (float) (Sr*(fpixels_r[i]-Y));
fpixels_y0[i]=(float) Y;
}
/** calculate Y from weighted colors, weights derived from how good each color component predicts signal in each subpixel of Bayer pattern */
/* calculate Y from weighted colors, weights derived from how good each color component predicts signal in each subpixel of Bayer pattern */
if (useWeights) {
fpixels_y= new float [length];
for (i=0;i<length;i++) {
......@@ -203,7 +203,7 @@ public class CorrectionColorProc {
}
}
}
/** Low-pass filter Pb and Pr */
/* Low-pass filter Pb and Pr */
DoubleGaussianBlur gb=new DoubleGaussianBlur();
double [] dpixels_pr=new double[fpixels_pr.length];
double [] dpixels_pb=new double[fpixels_pb.length];
......@@ -310,7 +310,7 @@ public class CorrectionColorProc {
int length=fpixels_r.length;
int width= stack.getWidth();
int height=stack.getHeight();
/** Scale colors, gamma-convert */
/* Scale colors, gamma-convert */
int i;
double gain_red= thisBalanceRed* thisGain/scale;
double gain_blue=thisBalanceBlue*thisGain/scale;
......@@ -325,13 +325,13 @@ public class CorrectionColorProc {
fpixels_b[i]=(float) linGamma(colorProcParameters.gamma, gamma_a, gamma_linK, colorProcParameters.minLin, fpixels_b[i]*gain_blue);
}
/** Convert to YPbPr */
/* Convert to YPbPr */
double Y,Pb,Pr;
double Kg=1.0-colorProcParameters.kr-colorProcParameters.kb;
double Sb=0.5/(1.0-colorProcParameters.kb)*colorProcParameters.saturationBlue;
double Sr=0.5/(1.0-colorProcParameters.kr)*colorProcParameters.saturationRed;
double Yr,Yg,Yb,Wr,Wg,Wb,S;
/** coefficients to find Y from Pb, Pr and a color (R,G or B)
/* coefficients to find Y from Pb, Pr and a color (R,G or B)
Yr = R- Pr*KPrR
Yb = B- Pb*KPbB
Yg = G+ Pr*KPrG + Pb*KPbG
......@@ -367,7 +367,7 @@ public class CorrectionColorProc {
fpixels_pr[i] = (float) (Sr*(fpixels_r[i]-Y));
fpixels_y0[i]=(float) Y;
}
/** calculate Y from weighted colors, weights derived from how good each color component predicts signal in each subpixel of Bayer pattern */
/* calculate Y from weighted colors, weights derived from how good each color component predicts signal in each subpixel of Bayer pattern */
if (useWeights) {
fpixels_y= new float [length];
for (i=0;i<length;i++) {
......@@ -392,7 +392,7 @@ public class CorrectionColorProc {
}
}
}
/** Low-pass filter Pb and Pr */
/* Low-pass filter Pb and Pr */
DoubleGaussianBlur gb=new DoubleGaussianBlur();
double [] dpixels_pr=new double[fpixels_pr.length];
double [] dpixels_pb=new double[fpixels_pb.length];
......@@ -470,7 +470,7 @@ public class CorrectionColorProc {
}
/** ======================================================================== */
/* ======================================================================== */
public double linGamma(double gamma, double a, double k, double x0, double x) {
if (x<0) return 0.0;
......
......@@ -47,8 +47,8 @@ public class CorrectionDenoise {
void setDebug(int debugLevel){this.debugLevel=debugLevel;}
// uses global OUT_PIXELS to accumulate results
/** ======================================================================== */
/** Combine two 3-slice image stacks generated from the same source image - one high-res/high noise, other low-res/low noise
/* ======================================================================== */
/* Combine two 3-slice image stacks generated from the same source image - one high-res/high noise, other low-res/low noise
* @param nonlinParameters TODO*/
public ImageStack combineLoHiStacks(ImageStack stack_convolved, // ImageStack with the image, convolved with the reversed PSF (sharp but with high noise)
ImageStack stack_gaussian, // ImageStack with the image, convolved with the Gaussian (just lateral compensated) (blurred, but low noise)
......@@ -71,7 +71,7 @@ public class CorrectionDenoise {
filtMin*=nonlinParameters.thresholdCorr[channel];
filtMax*=nonlinParameters.thresholdCorr[channel];
}
/** find number of the green channel - should be called "green", if none - use last */
/* find number of the green channel - should be called "green", if none - use last */
int greenChn=2;
for (i=0;i<3;i++) if (stack_convolved.getSliceLabel(i+1).equals("green")){
greenChn=i;
......@@ -179,7 +179,7 @@ public class CorrectionDenoise {
// final double [][] noiseMask, // 2-d array of kernelsNoiseGain (divide mask by it)
// final int noiseStep, // linear pixels per noiseMask pixels (32)
/** divide mask by noiseMask, if defined */
/* divide mask by noiseMask, if defined */
if (noiseMask!=null) {
if (debugLevel>1) System.out.println ( "diffGreens.length="+diffGreens.length+" imgWidth="+imgWidth+" noiseMask.length="+noiseMask.length+" noiseMask[0].length="+noiseMask[0].length);
......@@ -217,7 +217,7 @@ public class CorrectionDenoise {
this.denoiseMask=diffGreens;
this.denoiseMaskWidth=imgWidth;
/** Combine 2 stacks and a mask */
/* Combine 2 stacks and a mask */
return combineStacksWithMask (stack_gaussian,
stack_convolved,
diffGreens);
......@@ -302,7 +302,7 @@ public class CorrectionDenoise {
tile=fht_instance.multiply(tile,filter,false);
fht_instance.inverseTransform(tile);
fht_instance.swapQuadrants(tile);
/** accumulate result */
/* accumulate result */
/*This is synchronized method. It is possible to make threads to write to non-overlapping regions of the OUT_PIXELS, but as the accumulation
* takes just small fraction of several FHTs, it should be OK - reasonable number of threads will spread and not "stay in line"
*/
......@@ -323,7 +323,7 @@ public class CorrectionDenoise {
/** ======================================================================== */
/* ======================================================================== */
public double [] ringFilter(double [] dmask, // mask to be filtered
int width, // mask width
double minMaxValue, // min value for the local maximum to be processed (absolute, not relative)
......@@ -383,13 +383,13 @@ public class CorrectionDenoise {
}
return result;
}
/** ======================================================================== */
/* ======================================================================== */
/** ======================================================================== */
/* ======================================================================== */
/** Combine 2 stacks and a mask */
/* Combine 2 stacks and a mask */
public ImageStack combineStacksWithMask (ImageStack stack_bg,
ImageStack stack_fg,
// float [] mask ) {
......@@ -409,7 +409,7 @@ public class CorrectionDenoise {
}
return stack;
}
/** ======================================================================== */
/* ======================================================================== */
public double [] getSlidingMask(int size) {
double [] mask = new double [size*size];
double [] maskLine=new double [size];
......@@ -422,7 +422,7 @@ public class CorrectionDenoise {
}
/** ======================================================================== */
/* ======================================================================== */
/* Filters mask that selects between hi-res/high-noise deconvolved image and lo-res/lo-noise image convolved with Gaussian
* by rejecting frequencies that correspond to multiples of JPEG blocks (here with the current settings it is 32 pixels - twice 16x16 macroblock
*/
......@@ -512,7 +512,7 @@ public class CorrectionDenoise {
return pixels;
}
/** ======================================================================== */
/* ======================================================================== */
/**extract and multiply by window function (same size as kernel itself) */
void extractSquareTile(float [] pixels, // source pixel array,
double [] tile, // will be filled, should have correct size before call
......@@ -537,7 +537,7 @@ public class CorrectionDenoise {
}
}
}
/** ======================================================================== */
/* ======================================================================== */
void extractSquareTile(double [] pixels, // source pixel array,
double [] tile, // will be filled, should have correct size before call
double [] window, // window (same size as the kernel)
......@@ -564,7 +564,7 @@ public class CorrectionDenoise {
/** accumulate square tile to the pixel array (tile may extend beyond the array, will be cropped) */
/* accumulate square tile to the pixel array (tile may extend beyond the array, will be cropped) */
synchronized void accumulateSquareTile(
float [] pixels, // float pixels array to accumulate tile
double [] tile, // data to accumulate to the pixels array
......@@ -612,8 +612,8 @@ public class CorrectionDenoise {
}
}
/** ======================================================================== */
/** Create a Thread[] array as large as the number of processors available.
/* ======================================================================== */
/* Create a Thread[] array as large as the number of processors available.
* From Stephan Preibisch's Multithreading.java class. See:
* http://repo.or.cz/w/trakem2.git?a=blob;f=mpi/fruitfly/general/MultiThreading.java;hb=HEAD
*/
......@@ -622,7 +622,7 @@ public class CorrectionDenoise {
if (n_cpus>maxCPUs)n_cpus=maxCPUs;
return new Thread[n_cpus];
}
/** Start all given threads and wait on each of them until all are done.
/* Start all given threads and wait on each of them until all are done.
* From Stephan Preibisch's Multithreading.java class. See:
* http://repo.or.cz/w/trakem2.git?a=blob;f=mpi/fruitfly/general/MultiThreading.java;hb=HEAD
*/
......
This diff is collapsed.
......@@ -76,7 +76,7 @@ public class DebayerScissors {
final int tilesY=imgHeight/step-1; // vertical number of overlapping tiles in the source image (should be expanded from the registerd one by "step" in each direction)
final int nChn=imageStack.getSize();
int i,chn; //tileX,tileY;
/** find number of the green channel - should be called "green", if none - use last */
/* find number of the green channel - should be called "green", if none - use last */
i=nChn-1;
for (chn=0;chn<nChn;chn++) if (imageStack.getSliceLabel(chn+1).equals("green")){
i=chn;
......@@ -134,7 +134,7 @@ public class DebayerScissors {
tileY*step); // top corner Y
}
/** Scale green channel x0.5 as there are twice more pixels there as in red or blue. Or move it somewhere else and multiply to original range ? */
/* Scale green channel x0.5 as there are twice more pixels there as in red or blue. Or move it somewhere else and multiply to original range ? */
for (i=0;i<tile[greenChn].length;i++) tile[greenChn][i]*=0.5;
if ((tileY==yTileDebug) && (tileX==xTileDebug)) {
if (SDFA_instance==null) SDFA_instance= new showDoubleFloatArrays();
......@@ -165,7 +165,7 @@ public class DebayerScissors {
tile[chn]=fht_instance.multiply(tile[chn],both_masks[(chn==greenChn)?0:1],false);
fht_instance.inverseTransform(tile[chn]);
fht_instance.swapQuadrants(tile[chn]);
/** accumulate result */
/* accumulate result */
/*This is synchronized method. It is possible to make threads to write to non-overlapping regions of the outPixles, but as the accumulation
* takes just small fraction of severtal FHTs, it should be OK - reasonable number of threads will spread and not "stay in line"
*/
......@@ -184,7 +184,7 @@ public class DebayerScissors {
}
startAndJoin(threads);
// this.debugLevel=wasDebugLevel;
/** prepare result stack to return */
/* prepare result stack to return */
ImageStack outStack=new ImageStack(imgWidth,imgHeight);
for (chn=0;chn<nChn;chn++) {
outStack.addSlice(imageStack.getSliceLabel(chn+1), outPixles[chn]);
......@@ -197,7 +197,7 @@ public class DebayerScissors {
return outStack;
}
/** ======================================================================== */
/* ======================================================================== */
/**extract and multiply by window function (same size as kernel itself) */
void extractSquareTile(float [] pixels, // source pixel array,
double [] tile, // will be filled, should have correct size before call
......@@ -222,7 +222,7 @@ public class DebayerScissors {
}
}
}
/** ======================================================================== */
/* ======================================================================== */
void extractSquareTile(double [] pixels, // source pixel array,
double [] tile, // will be filled, should have correct size before call
double [] window, // window (same size as the kernel)
......@@ -248,8 +248,8 @@ public class DebayerScissors {
}
/** ======================================================================== */
/** accumulate square tile to the pixel array (tile may extend beyond the array, will be cropped) */
/* ======================================================================== */
/* accumulate square tile to the pixel array (tile may extend beyond the array, will be cropped) */
synchronized void accumulateSquareTile(
float [] pixels, // float pixels array to accumulate tile
double [] tile, // data to accumulate to the pixels array
......@@ -297,7 +297,7 @@ public class DebayerScissors {
}
}
/** ======================================================================== */
/* ======================================================================== */
public double [] getSlidingMask(int size) {
double [] mask = new double [size*size];
double [] maskLine=new double [size];
......@@ -308,13 +308,13 @@ public class DebayerScissors {
for (i=0;i<size;i++) for (j=0;j<size;j++) mask[index++]=maskLine[i]*maskLine[j];
return mask;
}
/** ======================================================================== */
/* ======================================================================== */
/** ======================================================================== */
/** Create a Thread[] array as large as the number of processors available.
/* ======================================================================== */
/* Create a Thread[] array as large as the number of processors available.
* From Stephan Preibisch's Multithreading.java class. See:
* http://repo.or.cz/w/trakem2.git?a=blob;f=mpi/fruitfly/general/MultiThreading.java;hb=HEAD
*/
......@@ -323,7 +323,7 @@ public class DebayerScissors {
if (n_cpus>maxCPUs)n_cpus=maxCPUs;
return new Thread[n_cpus];
}
/** Start all given threads and wait on each of them until all are done.
/* Start all given threads and wait on each of them until all are done.
* From Stephan Preibisch's Multithreading.java class. See:
* http://repo.or.cz/w/trakem2.git?a=blob;f=mpi/fruitfly/general/MultiThreading.java;hb=HEAD
*/
......
......@@ -1873,7 +1873,7 @@ public class DenseCorrespondence {
titles);
}
} // end of private class Photometric
/** Create a Thread[] array as large as the number of processors available.
/* Create a Thread[] array as large as the number of processors available.
* From Stephan Preibisch's Multithreading.java class. See:
* http://repo.or.cz/w/trakem2.git?a=blob;f=mpi/fruitfly/general/MultiThreading.java;hb=HEAD
*/
......@@ -1882,7 +1882,7 @@ public class DenseCorrespondence {
if (n_cpus>maxCPUs)n_cpus=maxCPUs;
return new Thread[n_cpus];
}
/** Start all given threads and wait on each of them until all are done.
/* Start all given threads and wait on each of them until all are done.
* From Stephan Preibisch's Multithreading.java class. See:
* http://repo.or.cz/w/trakem2.git?a=blob;f=mpi/fruitfly/general/MultiThreading.java;hb=HEAD
*/
......
......@@ -45,7 +45,6 @@ import java.util.concurrent.atomic.AtomicInteger;
import javax.swing.SwingUtilities;
//import Jama.LUDecomposition;
import Jama.LUDecomposition;
import Jama.Matrix;
//import src.java.org.apache.commons.configuration.*;
......@@ -10700,7 +10699,7 @@ Which parameters affect which matrices
// Next line is not needed anymore (will harm as will set orientationEstimated for all unselected sets)
// if (!allImages) fittingStrategy.distortionCalibrationData.updateSetOrientation(selectedImages); // only for selected images (not all enabled), OK
}
/** Create a Thread[] array as large as the number of processors available.
/* Create a Thread[] array as large as the number of processors available.
* From Stephan Preibisch's Multithreading.java class. See:
* http://repo.or.cz/w/trakem2.git?a=blob;f=mpi/fruitfly/general/MultiThreading.java;hb=HEAD
*/
......@@ -10709,7 +10708,7 @@ Which parameters affect which matrices
if (n_cpus>maxCPUs)n_cpus=maxCPUs;
return new Thread[n_cpus];
}
/** Start all given threads and wait on each of them until all are done.
/* Start all given threads and wait on each of them until all are done.
* From Stephan Preibisch's Multithreading.java class. See:
* http://repo.or.cz/w/trakem2.git?a=blob;f=mpi/fruitfly/general/MultiThreading.java;hb=HEAD
*/
......@@ -106,20 +106,20 @@ public class DoubleFHT {
}
/** Performs a forward transform, converting this image into the frequency domain.
/* Performs a forward transform, converting this image into the frequency domain.
The image contained in data must be square and its width must be a power of 2. */
public boolean transform(double [] data) {
return transform(data, false);
}
/** Performs an inverse transform, converting this image into the space domain.
/* Performs an inverse transform, converting this image into the space domain.
The image contained in data must be square and its width must be a power of 2. */
public boolean inverseTransform(double [] data) {
return transform(data, true);
}
/** Returns an inverse transform of this image, which is assumed to be in the frequency domain. */
/* Returns an inverse transform of this image, which is assumed to be in the frequency domain. */
public boolean transform(double [] data, boolean inverse) {
//IJ.log("transform: "+maxN+" "+inverse);
updateMaxN(data);
......@@ -703,7 +703,7 @@ public class DoubleFHT {
bitrev[i] = bitRevX(i, nLog2);
}
/** Performs a 2D FHT (Fast Hartley Transform). */
/* Performs a 2D FHT (Fast Hartley Transform). */
public void rc2DFHT(double[] x, boolean inverse, int maxN) {
//IJ.write("FFT: rc2DFHT (row-column Fast Hartley Transform)");
for (int row=0; row<maxN; row++)
......@@ -742,7 +742,7 @@ public class DoubleFHT {
IJ.showProgress(percent);
}
/** Performs an optimized 1D FHT. */
/* Performs an optimized 1D FHT. */
public void dfht3 (double[] x, int base, boolean inverse, int maxN) {
int i, stage, gpNum, gpSize, numGps, Nlog2;
int bfNum, numBfs;
......@@ -2058,8 +2058,8 @@ public class DoubleFHT {
}
/** nothing to prevent division by small values */
/** Returns the image resulting from the point by point Hartley division
/* nothing to prevent division by small values */
/* Returns the image resulting from the point by point Hartley division
of this image by the specified image. Both images are assumed to be in
the frequency domain. Division in the frequency domain is equivalent
to deconvolution in the space domain. */
......@@ -2102,7 +2102,7 @@ public class DoubleFHT {
swapQuadrants(amp);
return amp;
}
/** Amplitude of one row from 2D Hartley Transform. */
/* Amplitude of one row from 2D Hartley Transform. */
void amplitude(int row, int size, double[] fht, double[] amplitude) {
int base = row*size;
int l;
......@@ -2112,7 +2112,7 @@ public class DoubleFHT {
}
}
/** Squared amplitude of one row from 2D Hartley Transform. */
/* Squared amplitude of one row from 2D Hartley Transform. */
void amplitude2(int row, int size, double[] fht, double[] amplitude) {
int base = row*size;
int l;
......@@ -2122,7 +2122,7 @@ public class DoubleFHT {
}
}
// Other FHT-related methods moved here
/** converts FHT results (frequency space) to complex numbers of [fftsize/2+1][fftsize] */
/* converts FHT results (frequency space) to complex numbers of [fftsize/2+1][fftsize] */
public double[][][] FHT2FFTHalf (FHT fht, int fftsize) {
float[] fht_pixels=(float[])fht.getPixels();
double[][][] fftHalf=new double[(fftsize>>1)+1][fftsize][2];
......@@ -2156,7 +2156,7 @@ public class DoubleFHT {
return fftHalf;
}
/** converts FFT arrays of complex numbers of [fftsize/2+1][fftsize] to FHT arrays */
/* converts FFT arrays of complex numbers of [fftsize/2+1][fftsize] to FHT arrays */
public float[] floatFFTHalf2FHT (double [][][] fft, int fftsize) {
float[] fht_pixels=new float [fftsize*fftsize];
int row1,row2,col1,col2;
......@@ -2202,7 +2202,7 @@ public class DoubleFHT {
/** Amplitude/phase related methods */
/* Amplitude/phase related methods */
public double [] interpolateFHT (double [] fht0, // first FHT array
double [] fht1, // second FHT array
double ratio){ // array of interpolation points - 0.0 - fht0, 1.0 - fht1
......@@ -2214,7 +2214,7 @@ public class DoubleFHT {
return results[0];
}
/** returns array of interpolated FHTs between fht0 and fht1, endpoints if present (0.0, 1.0) are referenced, not cloned */
/* returns array of interpolated FHTs between fht0 and fht1, endpoints if present (0.0, 1.0) are referenced, not cloned */
public double [][] interpolateFHT (
double [] fht0, // first FHT array
double [] fht1, // second FHT array
......@@ -2232,14 +2232,14 @@ public class DoubleFHT {
int size=(int) Math.sqrt(fht0.length);
int hsize=size/2;
double [][][] aphase= new double[hsize+1][size][2];
double [][][] amp01= new double[hsize+1][size][2]; /** squared amplitudes of fht0 and fht1 */
double [][] phase= new double[hsize+1][size]; /** +/-pi phase of the first array */
double [][][] amp01= new double[hsize+1][size][2]; /* squared amplitudes of fht0 and fht1 */
double [][] phase= new double[hsize+1][size]; /* +/-pi phase of the first array */
double[][][]fft0= FHT2FFTHalf (fht0, size);
double[][][]fft1= FHT2FFTHalf (fht1, size);
double[][][]fft_div= FHT2FFTHalf (fht_div, size);
int i,j,k;
double a,c,p;
/** use mul for amplitudes, div - for phases */
/* use mul for amplitudes, div - for phases */
for (i=0;i<=hsize;i++) for (j=0;j<size;j++) {
amp01[i][j][0]= fft0[i][j][0]*fft0[i][j][0]+fft0[i][j][1]*fft0[i][j][1];
amp01[i][j][1]= fft1[i][j][0]*fft1[i][j][0]+fft1[i][j][1]*fft1[i][j][1];
......@@ -2251,18 +2251,18 @@ public class DoubleFHT {
else aphase[i][j][1]=0.0;
}
aphase[0][0][1]=0.0;
/** calculate full phases */
/* calculate full phases */
fullPhase(aphase);
double [][]result=new double[points.length][];
for (k=0;k<result.length;k++) {
if (points[k]==0.0) result[k]=cloneTrivial?fht0.clone():fht0;
else if (points[k]==1.0) result[k]=cloneTrivial?fht1.clone():fht1;
else { /** interpolate */
else { /* interpolate */
c=points[k];
for (i=0;i<=hsize;i++) for (j=0;j<size;j++) {
if ((amp01[i][j][0]==0.0) || (amp01[i][j][1]==0.0)) a=0.0;
/** Extrapolation is defined here only in the direction of decreasing of the spectral amplitudes (outside, to the wider PSF), so additional limit to prevent division of small values */
/** Seems to work, possible improvements: 1-filter spectrum in high-freq areas. 2 - use farther inner points for farther approximation */
/* Extrapolation is defined here only in the direction of decreasing of the spectral amplitudes (outside, to the wider PSF), so additional limit to prevent division of small values */
/* Seems to work, possible improvements: 1-filter spectrum in high-freq areas. 2 - use farther inner points for farther approximation */
else if ((c<0.0) && (amp01[i][j][0]>amp01[i][j][1])) a=Math.sqrt(amp01[i][j][0]);
else if ((c>1.0) && (amp01[i][j][0]<amp01[i][j][1])) a=Math.sqrt(amp01[i][j][1]);
......@@ -2328,7 +2328,7 @@ public class DoubleFHT {
return reIm;
}
/** replace +/-pi phase with the full phase, using amplitude to guide grouth of the covered area, so amplitude and phase does not need to be a pair from the same FFT array */
/* replace +/-pi phase with the full phase, using amplitude to guide grouth of the covered area, so amplitude and phase does not need to be a pair from the same FFT array */
public void fullPhase(double [][][] aphase) {
int size = aphase[0].length;
int hsize=aphase.length-1;
......@@ -2359,7 +2359,7 @@ public class DoubleFHT {
double maxValue=-1.0;
while (pixelList.size()>0) {
/** Find maximal new neighbor */
/* Find maximal new neighbor */
maxValue=-1.0;
listIndex=0;
while (listIndex<pixelList.size()) {
......@@ -2373,7 +2373,7 @@ public class DoubleFHT {
if ((iy1>hsize) || (((iy1==0) || (iy1==hsize)) && (ix1> hsize))) {
ix1n=(size-ix1)%size;
iy1n=(size-iy1)%size;
} else { /** But phase will be opposite sign */
} else { /* But phase will be opposite sign */
ix1n=ix1;
iy1n=iy1;
}
......@@ -2393,7 +2393,7 @@ public class DoubleFHT {
if (pixelList.size()==0) break;
/** To calculate the phase - find already processed neighbor with the highest amplitude */
/* To calculate the phase - find already processed neighbor with the highest amplitude */
maxValue=-1.0;
for (j=0;j<8;j++) {
ix1=(maxX+dirs[j][0]+size) % size;
......@@ -2401,7 +2401,7 @@ public class DoubleFHT {
if ((iy1>hsize) || (((iy1==0) || (iy1==hsize)) && (ix1> hsize))) {
ix1n=(size-ix1)%size;
iy1n=(size-iy1)%size;
} else { /** But phase will be opposite sign */
} else { /* But phase will be opposite sign */
ix1n=ix1;
iy1n=iy1;
}
......@@ -2416,7 +2416,7 @@ public class DoubleFHT {
}
}
/** Calculate the phase from the closest neighbor */
/* Calculate the phase from the closest neighbor */
oldPhase=(oldConj?-1:1)*aphase[oldY][oldX][1];
fullCyclesPhase=2*Math.PI*Math.floor(oldPhase/(2*Math.PI)+0.5);
oldPhase-=fullCyclesPhase; // +/- pi
......@@ -2430,13 +2430,13 @@ public class DoubleFHT {
" Diff="+IJ.d2s((aphase[maxY][maxX][1]-(oldConj?-1:1)*aphase[oldY][oldX][1]),2));
}
*/
/** Add this new point to the list */
/* Add this new point to the list */
Index=maxY*size + maxX;
pixelList.add (Index);
clusterSize++;
map[maxY][maxX]=true;
} // end of while (pixelList.size()>0)
/** Fix remaining phases for y=0 and y=hsize */
/* Fix remaining phases for y=0 and y=hsize */
for (i=1;i<hsize;i++) {
aphase[0][size-i][1]=-aphase[0][i][1];
aphase[hsize][size-i][1]=-aphase[hsize][i][1];
......
......@@ -27,11 +27,11 @@
public class DoubleGaussianBlur {
/** the standard deviation of the Gaussian*/
/* the standard deviation of the Gaussian*/
// private static double sigma = 2.0;
/** whether sigma is given in units corresponding to the pixel scale (not pixels)*/
/* whether sigma is given in units corresponding to the pixel scale (not pixels)*/
// private static boolean sigmaScaled = false;
/** The flags specifying the capabilities and needs */
/* The flags specifying the capabilities and needs */
// private int flags = DOES_ALL|SUPPORTS_MASKING|PARALLELIZE_STACKS|KEEP_PREVIEW;
// private ImagePlus imp; // The ImagePlus of the setup call, needed to get the spatial calibration
// private boolean hasScale = false; // whether the image has an x&y scale
......@@ -39,7 +39,7 @@ public class DoubleGaussianBlur {
// private int nChannels = 1; // The number of color channels
private int pass; // Current pass
/** Default constructor */
/* Default constructor */
public DoubleGaussianBlur() {
}
......@@ -58,7 +58,7 @@ public class DoubleGaussianBlur {
return;
}
/** Blur an image in one direction (x or y) by a Gaussian.
/* Blur an image in one direction (x or y) by a Gaussian.
* @param ip The Image with the original data where also the result will be stored
* @param sigma Standard deviation of the Gaussian
* @param accuracy Accuracy of kernel, should not be > 0.02
......@@ -139,7 +139,7 @@ public class DoubleGaussianBlur {
}
return;
}
/** Create a 1-dimensional normalized Gaussian kernel with standard deviation sigma
/* Create a 1-dimensional normalized Gaussian kernel with standard deviation sigma
* and the running sum over the kernel
* Note: this is one side of the kernel only, not the full kernel as used by the
* Convolver class of ImageJ.
......@@ -203,7 +203,7 @@ public class DoubleGaussianBlur {
}
return kernel;
}
/** Scale a line (row or column of a FloatProcessor or part thereof)
/* Scale a line (row or column of a FloatProcessor or part thereof)
* down by a factor <code>reduceBy</code> and write the result into
* <code>cache</code>.
* Input line pixel # <code>unscaled0</code> will correspond to output
......@@ -253,7 +253,7 @@ public class DoubleGaussianBlur {
return kernel;
}
/** Scale a line up by factor <code>reduceBy</code> and write as a row
/* Scale a line up by factor <code>reduceBy</code> and write as a row
* or column (or part thereof) to the pixels array of a FloatProcessor.
*/
void upscaleLine (double[] cache, double[] pixels, double[] kernel,
......@@ -269,7 +269,7 @@ public class DoubleGaussianBlur {
}
}
/** Create a kernel for upscaling. The kernel function is a convolution
/* Create a kernel for upscaling. The kernel function is a convolution
* of four unit squares, i.e., four uniform kernels with value +1
* from -0.5 to +0.5 (in downscaled coordinates). The second derivative
* of this kernel is smooth, the third is not. Its standard deviation
......@@ -296,7 +296,7 @@ public class DoubleGaussianBlur {
return kernel;
}
/** Convolve a line with a symmetric kernel and write to a separate array,
/* Convolve a line with a symmetric kernel and write to a separate array,
* possibly the pixels array of a FloatProcessor (as a row or column or part thereof)
*
* @param input Input array containing the line
......
This diff is collapsed.
......@@ -785,7 +785,7 @@ public class EyesisCorrectionParameters {
}
/** === Parameter classes === */
/* === Parameter classes === */
public static class ProcessParameters {
public int numEyesisChannels=3;
public int numEyesisSubChannels=3;
......@@ -973,7 +973,7 @@ public class EyesisCorrectionParameters {
}
}
/** ======================================================================== */
/* ======================================================================== */
public static class FilesParameters {
public String [][] rPSFNames=new String [3][3];
public String [][] gaussianNames=new String [3][3];
......@@ -1057,7 +1057,7 @@ public class EyesisCorrectionParameters {
}
}
/** ======================================================================== */
/* ======================================================================== */
public static class RGBParameters {
public double r_min;
public double g_min;
......@@ -1092,7 +1092,7 @@ public class EyesisCorrectionParameters {
}
}
/** ======================================================================== */
/* ======================================================================== */
public static class ColorProcParameters {
public double balanceRed;
......@@ -1346,7 +1346,7 @@ public class EyesisCorrectionParameters {
if (properties.getProperty(prefix+"use8")!=null) this.use8=Boolean.parseBoolean(properties.getProperty(prefix+"use8"));
}
}
/** ======================================================================== */
/* ======================================================================== */
// individual per-channel color balance and gain
public static class ColorCalibParameters {
public double[][] gain=new double[3][3];
......@@ -1437,7 +1437,7 @@ public class EyesisCorrectionParameters {
}
}
/** ======================================================================== */
/* ======================================================================== */
public static class NonlinParameters {
public boolean useRejectBlocksFilter;
public boolean combineBothModes;
......@@ -1608,7 +1608,7 @@ public class EyesisCorrectionParameters {
}
}
/** ======================================================================== */
/* ======================================================================== */
public static class SplitParameters {
public int oversample;
public int addLeft;
......@@ -1639,7 +1639,7 @@ public class EyesisCorrectionParameters {
this.addBottom=Integer.parseInt(properties.getProperty(prefix+"addBottom"));
}
}
/** ======================================================================== */
/* ======================================================================== */
public static class DebayerParameters {
public int size;
public double polarStep;
......@@ -1945,6 +1945,6 @@ public class EyesisCorrectionParameters {
/** ======================================================================== */
/* ======================================================================== */
}
This diff is collapsed.
......@@ -213,7 +213,7 @@ public EyesisTiff(){
tiffSaver.setWritingSequentially(true);
tiffSaver.setLittleEndian(false);
tiffSaver.writeHeader();
// tiffSaver.writeIFD(ifd,0); //** SHould not write here, some fields are calculated during writeImage, that writes IFD too
// tiffSaver.writeIFD(ifd,0); //* SHould not write here, some fields are calculated during writeImage, that writes IFD too
// System.out.println("bytes.length="+bytes.length);
tiffSaver.writeImage(bytes,
ifd,
......@@ -310,7 +310,7 @@ public EyesisTiff(){
tiffSaver.setWritingSequentially(true);
tiffSaver.setLittleEndian(false);
tiffSaver.writeHeader();
// tiffSaver.writeIFD(ifd,0); //** SHould not write here, some fields are calculated during writeImage, that writes IFD too
// tiffSaver.writeIFD(ifd,0); //* SHould not write here, some fields are calculated during writeImage, that writes IFD too
System.out.println("bytes.length="+bytes.length);
tiffSaver.writeImage(bytes,
ifd,
......
This diff is collapsed.
......@@ -1414,7 +1414,7 @@ horizontal axis:
this.motorsSimultaneous= gd.getNextBoolean();
return true;
}
/** ======================================================================== */
/* ======================================================================== */
}
......
This diff is collapsed.
......@@ -1593,7 +1593,7 @@ public class LensAdjustment {
this.numIterations= (int) gd.getNextNumber();
return true;
}
/** ======================================================================== */
/* ======================================================================== */
//returns triads - x,y,distance from the lens center
public double [][][] sampleCoordinates(
double x0, // lens center on the sensor
......
This diff is collapsed.
This diff is collapsed.
......@@ -16475,7 +16475,7 @@ public class PixelMapping {
}
}
/** Create a Thread[] array as large as the number of processors available.
/* Create a Thread[] array as large as the number of processors available.
* From Stephan Preibisch's Multithreading.java class. See:
* http://repo.or.cz/w/trakem2.git?a=blob;f=mpi/fruitfly/general/MultiThreading.java;hb=HEAD
*/
......@@ -16484,7 +16484,7 @@ public class PixelMapping {
if (n_cpus>maxCPUs)n_cpus=maxCPUs;
return new Thread[n_cpus];
}
/** Start all given threads and wait on each of them until all are done.
/* Start all given threads and wait on each of them until all are done.
* From Stephan Preibisch's Multithreading.java class. See:
* http://repo.or.cz/w/trakem2.git?a=blob;f=mpi/fruitfly/general/MultiThreading.java;hb=HEAD
*/
......
This diff is collapsed.
......@@ -188,7 +188,7 @@ public class PolynomialApproximation {
}
/** ======================================================================== */
/* ======================================================================== */
/**
* Approximate function z(x,y) as a second degree polynomial (or just linear)
* f(x,y)=A*x^2+B*y^2+C*x*y+D*x+E*y+F or f(x,y)=D*x+E*y+F
......
This diff is collapsed.
......@@ -65,7 +65,7 @@ public final class WindowTools {
// -- Utility methods --
/** Adds AWT scroll bars to the given container. */
/* Adds AWT scroll bars to the given container. */
@SuppressWarnings("serial")
public static void addScrollBars(Container pane) {
GridBagLayout layout = (GridBagLayout) pane.getLayout();
......@@ -170,17 +170,17 @@ public static void addScrollBars(Container pane) {
w.setLocation(p);
}
/** Reports the given exception with stack trace in an ImageJ error dialog. */
/* Reports the given exception with stack trace in an ImageJ error dialog. */
public static void reportException(Throwable t) {
reportException(t, false, null);
}
/** Reports the given exception with stack trace in an ImageJ error dialog. */
/* Reports the given exception with stack trace in an ImageJ error dialog. */
public static void reportException(Throwable t, boolean quiet) {
reportException(t, quiet, null);
}
/** Reports the given exception with stack trace in an ImageJ error dialog. */
/* Reports the given exception with stack trace in an ImageJ error dialog. */
public static void reportException(Throwable t, boolean quiet, String msg) {
if (quiet) return;
// BF.status(quiet, "");
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -17,7 +17,7 @@ import ij.process.*;
/** For square arrays */
/* For square arrays */
public void showArrays(double[][] pixels, String title) { showArrays(pixels, false, title);}
public void showArrays(double[][] pixels, boolean asStack, String title) {
......
This diff is collapsed.
......@@ -10,6 +10,7 @@
# will get that as arg parameter; otherwise arg is simply the empty string.
Process, "Aberration Calibration", Aberration_Calibration
Process, "Aberration Correction", Aberration_Correction
Process, "Eyesis Correction", Eyesis_Correction
Process, "JP46 Reader camera", JP46_Reader_camera
#Plugins, "Aberration Calibration", Aberration_Calibration
#Process, "Aberration Correction", Aberration_Correction
#Process, "Eyesis Correction", Eyesis_Correction
#Process, "JP46 Reader camera", JP46_Reader_camera
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