Commit ab19db78 authored by Andrey Filippov's avatar Andrey Filippov
Browse files

cluster texture output

parent 2717c448
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ public class CorrectionColorProc {
    void setDebug(int debugLevel){this.debugLevel=debugLevel;}

    
    public void  processColorsWeights(ImageStack stack,
    public void  processColorsWeights(ImageStack stack, // does not like NaN (in GaussianBlur
  		  double scale,     // initial maximal pixel value (16))
  		  EyesisCorrectionParameters.ColorProcParameters  colorProcParameters,
  		  CorrectionColorProc.ColorGainsParameters channelGainParameters,
@@ -107,7 +107,7 @@ public class CorrectionColorProc {

    	for (i=0;i<length;i++) {
    		double Y=Ar*fpixels_r[i]+Ag*fpixels_g[i]+Ab*fpixels_b[i];
    		Y=linGamma(colorProcParameters.gamma, gamma_a, gamma_linK, colorProcParameters.minLin, Y)/Y;
    		Y= (Y !=0.0) ? (linGamma(colorProcParameters.gamma, gamma_a, gamma_linK, colorProcParameters.minLin, Y)/Y): 0.0;
    		fpixels_r[i]*=Y*gain_red; 
    		fpixels_g[i]*=Y*gain_green; 
    		fpixels_b[i]*=Y*gain_blue; 
+10 −0
Original line number Diff line number Diff line
@@ -2022,6 +2022,8 @@ public class EyesisCorrectionParameters {
  		public double     bgnd_maybe       = 0.1; // maximal strength to ignore as non-background
//  		public double     bgnd_2diff       = 0.005; // maximal strength to ignore as non-background
  		public int        min_clstr_seed   = 2;     // number of tiles in a cluster to seed (just background?)
  		public int        min_clstr_lone   = 4;     // number of tiles in a cluster not close to other clusters (more than 2 tiles apart)
  		public int        fill_gaps        = 4;     // same as in grow - 1:  4 directions by 1 step, 2: 8 directions by 1 step. +2*n - alternating hor/vert
  		public int        min_clstr_block  = 3;     // number of tiles in a cluster to block (just non-background?)
  		public int        bgnd_grow        = 2;     // number of tiles to grow (1 - hor/vert, 2 - hor/vert/diagonal)
  		
@@ -2143,6 +2145,8 @@ public class EyesisCorrectionParameters {
			properties.setProperty(prefix+"bgnd_sure",        this.bgnd_sure +"");
			properties.setProperty(prefix+"bgnd_maybe",       this.bgnd_maybe +"");
  			properties.setProperty(prefix+"min_clstr_seed",   this.min_clstr_seed+"");
  			properties.setProperty(prefix+"min_clstr_lone",   this.min_clstr_lone+"");
  			properties.setProperty(prefix+"fill_gaps",        this.fill_gaps+"");
  			properties.setProperty(prefix+"min_clstr_block",  this.min_clstr_block+"");
  			properties.setProperty(prefix+"bgnd_grow",        this.bgnd_grow+"");
  			properties.setProperty(prefix+"ortho_min_hor",    this.ortho_min_hor +"");
@@ -2255,6 +2259,8 @@ public class EyesisCorrectionParameters {
  			if (properties.getProperty(prefix+"bgnd_sure")!=null)         this.bgnd_sure=Double.parseDouble(properties.getProperty(prefix+"bgnd_sure"));
  			if (properties.getProperty(prefix+"bgnd_maybe")!=null)        this.bgnd_maybe=Double.parseDouble(properties.getProperty(prefix+"bgnd_maybe"));
  			if (properties.getProperty(prefix+"min_clstr_seed")!=null)    this.min_clstr_seed=Integer.parseInt(properties.getProperty(prefix+"min_clstr_seed"));
  			if (properties.getProperty(prefix+"min_clstr_lone")!=null)    this.min_clstr_lone=Integer.parseInt(properties.getProperty(prefix+"min_clstr_lone"));
  			if (properties.getProperty(prefix+"fill_gaps")!=null)          this.fill_gaps=Integer.parseInt(properties.getProperty(prefix+"fill_gaps"));
  			if (properties.getProperty(prefix+"min_clstr_block")!=null)   this.min_clstr_block=Integer.parseInt(properties.getProperty(prefix+"min_clstr_block"));
  			if (properties.getProperty(prefix+"bgnd_grow")!=null)         this.bgnd_grow=Integer.parseInt(properties.getProperty(prefix+"bgnd_grow"));
  			if (properties.getProperty(prefix+"ortho_min_hor")!=null)     this.ortho_min_hor=Double.parseDouble(properties.getProperty(prefix+"ortho_min_hor"));
@@ -2382,6 +2388,8 @@ public class EyesisCorrectionParameters {
  			gd.addNumericField("Maximal strength to ignore as non-background",                                 this.bgnd_maybe,  3);

  			gd.addNumericField("Number of tiles in a cluster to seed (just background?)",                      this.min_clstr_seed,   0);
  			gd.addNumericField("Number of tiles in a cluster not close to other clusters (more than 2 tiles apart)", this.min_clstr_lone,   0);
  			gd.addNumericField("Fill gaps betsween clusters, see comments for 'grow'",                         this.fill_gaps,   0);
  			gd.addNumericField("Number of tiles in a cluster to block (just non-background?)",                 this.min_clstr_block,   0);
  			gd.addNumericField("Number of tiles to grow tile selection (1 - hor/vert, 2 - hor/vert/diagonal)", this.bgnd_grow,   0);

@@ -2503,6 +2511,8 @@ public class EyesisCorrectionParameters {
  			this.bgnd_sure=             gd.getNextNumber();
  			this.bgnd_maybe=            gd.getNextNumber();
  			this.min_clstr_seed=  (int) gd.getNextNumber();
  			this.min_clstr_lone=  (int) gd.getNextNumber();
  			this.fill_gaps=       (int) gd.getNextNumber();
  			this.min_clstr_block= (int) gd.getNextNumber();
  			this.bgnd_grow=       (int) gd.getNextNumber();
  			this.ortho_min_hor=         gd.getNextNumber();
+1 −1
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ public class EyesisTiff {
		int width = imp.getWidth();
		int height = imp.getHeight();
		int [] pixels = (int []) imp.getProcessor().getPixels();
		System.out.println("width="+width+", height="+height+" length="+pixels.length);
		System.out.println("savePNG_ARGB32("+path+"): width="+width+", height="+height+" length="+pixels.length);
		
		DataBufferInt buffer = new DataBufferInt(pixels, pixels.length);

+1 −1
Original line number Diff line number Diff line
@@ -1044,7 +1044,7 @@ public class ImageDtt {
			if (i == (transform_size-1)) enh_ortho_scale[i] = 0.0 ; // hardwired 0 in the center
			enh_ortho_scale[i] *= Math.sin(Math.PI*(i+1.0)/(2*transform_size));
		}
		if (globalDebugLevel > -1){
		if (globalDebugLevel > 0){
			System.out.println("enhortho_width="+ enhortho_width+" enhortho_scale="+ enhortho_scale);
			for (int i = 0; i < corr_size; i++){
				System.out.println(" enh_ortho_scale["+i+"]="+ enh_ortho_scale[i]);
Loading