Changeset 7970
- Timestamp:
- 04/13/12 18:25:10 (8 years ago)
- Location:
- trunk/projects/slim-plugin/src/main/java/loci/slim
- Files:
-
- 1 added
- 15 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/projects/slim-plugin/src/main/java/loci/slim/IGrayScaleImage.java
r7922 r7970 46 46 * @author Aivar Grislis 47 47 */ 48 public interface IGrayScaleImage {48 public interface IGrayScaleImage extends IGrayScalePixelValue { 49 49 50 50 /** … … 68 68 */ 69 69 public void enable(boolean enable); 70 71 /**72 * Gets a grayscale pixel value, to test against a threshold.73 *74 * @param channel75 * @param x76 * @param y77 * @return unsigned byte expressed as an integer, 0...25578 */79 public int getPixel(int channel, int x, int y);80 70 81 71 /** -
trunk/projects/slim-plugin/src/main/java/loci/slim/SLIMProcessor.java
r7937 r7970 379 379 m_excitationPanel.quit(); 380 380 m_excitationPanel = null; 381 updateExcitation(null, null); 381 382 //TODO redo stop/start cursors on decay curve? 382 383 } … … 450 451 x *= zoomFactor; 451 452 y *= zoomFactor; 453 454 m_x = x; 455 m_y = y; //TODO ARG 4/6/12 trying to fix my flakey bug 456 452 457 uiPanel.setX(x); 453 458 uiPanel.setY(y); … … 602 607 603 608 success = true; 609 } 610 else { 611 _fittingCursor.setHasPrompt(false); 604 612 } 605 613 return success; … … 794 802 fitInfo.setNoiseModel(uiPanel.getNoiseModel()); 795 803 fitInfo.setFittedImages(uiPanel.getFittedImages()); 804 fitInfo.setColorizeGrayScale(uiPanel.getColorizeGrayScale()); 796 805 fitInfo.setAnalysisList(uiPanel.getAnalysisList()); 797 806 fitInfo.setFitAllChannels(uiPanel.getFitAllChannels()); … … 907 916 ColorizedImageType[] outputImages = parser.getColorizedImages(); 908 917 imageColorizer = new ColorizedImageFitter(); 909 imageColorizer.setUpFit(outputImages, dimension, 910 fitInfo.getIndexColorModel(), components); 918 imageColorizer.setUpFit( 919 outputImages, 920 dimension, 921 fitInfo.getIndexColorModel(), 922 components, 923 fitInfo.getColorizeGrayScale(), 924 m_grayScaleImage); 911 925 imageColorizer.beginFit(); 912 926 } -
trunk/projects/slim-plugin/src/main/java/loci/slim/fitting/FitInfo.java
r7889 r7970 25 25 private String _fittedImages; 26 26 private IndexColorModel _indexColorModel; 27 private boolean _colorizeGrayScale; 27 28 private String[] _analysisList; 28 29 private boolean _fitAllChannels; … … 199 200 public void setIndexColorModel(IndexColorModel indexColorModel) { 200 201 _indexColorModel = indexColorModel; 202 } 203 204 /** 205 * Returns whether to create colorized grayscale images. 206 * 207 * @return 208 */ 209 public boolean getColorizeGrayScale() { 210 return _colorizeGrayScale; 211 } 212 213 /** 214 * Sets whether to create colorized grayscale images. 215 * 216 * @param colorizeGrayScale 217 */ 218 public void setColorizeGrayScale(boolean colorizeGrayScale) { 219 _colorizeGrayScale = colorizeGrayScale; 201 220 } 202 221 -
trunk/projects/slim-plugin/src/main/java/loci/slim/fitting/cursor/FitterEstimator.java
r7936 r7970 23 23 @Override 24 24 public int getEstimateStartIndex(double[] yCount, int start, int stop) { 25 System.out.println("FitterEstimator.getEstimateStartIndex " + yCount.length + " " + start + " " + stop); 25 26 // start index changes for RLD estimate fit 26 27 int transEstimateStartIndex = findMax(yCount, start, stop); … … 29 30 30 31 @Override 31 public double getEstimateA(double A, double[] yCount, int start, int stop) { 32 public double getEstimateAValue(double A, double[] yCount, int start, int stop) { 33 System.out.println("FitterEstimator.getEstimateA " + yCount.length + " " + start + " " + stop); 32 34 // A parameter estimate changes for RLD estimate fit 33 35 int transEstimateStartIndex = findMax(yCount, start, stop); -
trunk/projects/slim-plugin/src/main/java/loci/slim/fitting/images/AbstractBaseColorizedImage.java
r7963 r7970 18 18 import ij.process.FloatProcessor; 19 19 20 import loci.slim.IGrayScalePixelValue; 20 21 import loci.slim.histogram.HistogramData; 21 22 import loci.slim.histogram.HistogramDataChannel; … … 36 37 private int _channels; 37 38 private int _channel; 39 private boolean _colorizeGrayScale; 38 40 private ImageStack _imageStack; 39 41 private ImagePlus _imagePlus; … … 45 47 private IColorizedFittedImage _fittedImage; 46 48 47 public AbstractBaseColorizedImage(String title, int[] dimension, 48 IndexColorModel indexColorModel) { 49 public AbstractBaseColorizedImage( 50 String title, 51 int[] dimension, 52 IndexColorModel indexColorModel, 53 boolean colorizeGrayScale, 54 IGrayScalePixelValue grayScalePixelValue) { 49 55 _title = title; 50 56 _width = dimension[0]; … … 52 58 _channels = dimension[2]; 53 59 _channel = UNKNOWN_CHANNEL; 60 _colorizeGrayScale = colorizeGrayScale; 54 61 55 62 // building an image stack … … 64 71 = new ArrayList<HistogramDataChannel>(); 65 72 66 for (int c = 0; c < _channels; ++c) { 67 // build the actual displayed image 68 IColorizedFittedImage fittedImage = null; 69 if (true) { 70 fittedImage = new FloatFittedImage(); 71 } 72 else { 73 fittedImage = new ColorFittedImage(); 74 } 75 76 fittedImage.init(_width, _height, indexColorModel); 77 78 // add to stack 79 _imageStack.addSlice("" + c, fittedImage.getImageProcessor()); 80 73 for (int c = 0; c < _channels; ++c) { 81 74 // build the histogram data 82 75 _values = new double[_width][_height]; 83 76 clear(_values); 84 HistogramDataChannel histogramDataChannel = new HistogramDataChannel(_values); 77 HistogramDataChannel histogramDataChannel 78 = new HistogramDataChannel(_values); 79 dataChannelList.add(histogramDataChannel); 85 80 81 // build the actual displayed image 82 IColorizedFittedImage fittedImage = null; 83 if (colorizeGrayScale) { 84 fittedImage 85 = new ColorizedFittedImage(grayScalePixelValue, _values); 86 } 87 else { 88 fittedImage = new FloatFittedImage(); 89 } 90 fittedImage.init(_width, _height, c, indexColorModel); 86 91 fittedImageList.add(fittedImage); 87 dataChannelList.add(histogramDataChannel); 92 93 // add to stack 94 _imageStack.addSlice("" + c, fittedImage.getImageProcessor()); 88 95 } 89 96 … … 191 198 minMaxLUT = PaletteFix.adjustMinMax(minMaxLUT[0], minMaxLUT[1]); 192 199 if (null != _fittedImage) { 193 _fittedImage.setMinAndMax(minMaxLUT[0], minMaxLUT[1]); 200 if (_colorizeGrayScale) { 201 // redraw all images with new LUT 202 for (IColorizedFittedImage fittedImage : _fittedImages) { 203 fittedImage.setMinAndMax(minMaxLUT[0], minMaxLUT[1]); 204 } 205 } 206 else { 207 // when using a FloatProcessor the LUT belongs to entire stack 208 _fittedImage.setMinAndMax(minMaxLUT[0], minMaxLUT[1]); 209 } 194 210 195 211 //TODO ARG KLUDGE 196 212 // This is a workaround to redisplay after the LUT range changes. 197 213 // Hopefully it will go away in IJ2. 198 // Maybe update(ImageProcessor ip) 214 // Maybe update(ImageProcessor ip) would work. 199 215 // "Updates this stack so its attributes such as min max calibration table and color model, are the same as 'ip'" 200 if (_fittedImage instanceof FloatFittedImage) { 201 _imagePlus.setProcessor(_fittedImage.getImageProcessor().duplicate()); 202 } 216 _imagePlus.setProcessor(_fittedImage.getImageProcessor().duplicate()); 203 217 } 204 218 } -
trunk/projects/slim-plugin/src/main/java/loci/slim/fitting/images/ColorizedFittedImage.java
r7963 r7970 5 5 package loci.slim.fitting.images; 6 6 7 import java.awt.Color; 8 import java.awt.color.ColorSpace; 7 9 import java.awt.image.IndexColorModel; 8 10 11 import ij.process.ColorProcessor; 9 12 import ij.process.ImageProcessor; 13 14 import loci.slim.IGrayScalePixelValue; 10 15 11 16 /** … … 15 20 * @author Aivar Grislis 16 21 */ 17 public class ColorFittedImage implements IColorizedFittedImage { 22 public class ColorizedFittedImage implements IColorizedFittedImage { 23 private static final float SATURATION = 0.75f; 24 IGrayScalePixelValue _grayScalePixelValue; 25 double[][] _values; 26 int _width; 27 int _height; 28 int _channel; 29 IndexColorModel _indexColorModel; 30 ColorProcessor _colorProcessor; 31 double _min; 32 double _max; 33 34 public ColorizedFittedImage(IGrayScalePixelValue grayScalePixelValue, 35 double[][] values) { 36 _grayScalePixelValue = grayScalePixelValue; 37 _values = values; 38 } 18 39 19 public void init(int width, int height, IndexColorModel indexColorModel) { 40 @Override 41 public void init(int width, int height, int channel, 42 IndexColorModel indexColorModel) { 43 _width = width; 44 _height = height; 45 _channel = channel; 46 _indexColorModel = indexColorModel; 47 _colorProcessor = new ColorProcessor(width, height); 48 for (int y = 0; y < height; ++y) { 49 for (int x = 0; x < width; ++x) { 50 int grayValue = _grayScalePixelValue.getPixel(channel, x, y); 51 Color gray = getGrayColor(grayValue); 52 _colorProcessor.setColor(gray); 53 _colorProcessor.drawPixel(x, y); 54 } 55 } 56 } 57 58 @Override 59 public void setColorModel(IndexColorModel indexColorModel) { 60 _indexColorModel = indexColorModel; 61 } 62 63 @Override 64 public ImageProcessor getImageProcessor() { 65 return _colorProcessor; 66 } 67 68 @Override 69 public void setMinAndMax(double min, double max) { 70 if (min != _min || max != max) { 71 _min = min; 72 _max = max; 73 74 // redraw the entire image 75 for (int y = 0; y < _height; ++y) { 76 for (int x = 0; x < _width; ++x) { 77 Color color = null; 78 int grayValue = _grayScalePixelValue.getPixel(_channel, x, y); 79 double value = _values[x][y]; 80 if (min <= value && value <= max) { 81 color = getColorizedGrayColor(grayValue, value); 82 } 83 else { 84 color = getGrayColor(grayValue); 85 } 86 _colorProcessor.setColor(color); 87 _colorProcessor.drawPixel(x, y); 88 } 89 } 90 } 91 } 92 93 @Override 94 public void draw(int x, int y, double value) { 95 int grayValue = _grayScalePixelValue.getPixel(_channel, x, y); 96 Color colorizedGray = getColorizedGrayColor(grayValue, value); 97 _colorProcessor.setColor(colorizedGray); 98 _colorProcessor.drawPixel(x, y); 20 99 } 21 100 22 p ublic void setColorModel(IndexColorModel indexColorModel) {23 101 private Color getGrayColor(int grayValue) { 102 return new Color(grayValue, grayValue, grayValue); 24 103 } 25 104 26 public ImageProcessor getImageProcessor() { 27 return null; 28 } 29 30 public void setMinAndMax(double min, double max) { 31 } 32 33 public void draw(int x, int y, double value) { 105 private Color getColorizedGrayColor(int grayValue, double value) { 106 if (_max == _min) { 107 return getGrayColor(grayValue); 108 } 34 109 110 // convert value to 0.0..1.0 111 value = (value - _min) / (_max - _min); 112 113 // convert 0.0..1.0 to 1..254 (colors 0 and 255 have a special use) 114 int index = 1 + (int) (value * 253); 115 116 // get color 117 Color color = new Color(_indexColorModel.getRGB(index)); 118 119 // decompose color 120 float[] hsv = new float[3]; 121 Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), hsv); 122 123 // synthesize new color, using grayValue brightness 124 float hue = hsv[0]; 125 float saturation = SATURATION; 126 float brightness = (float) grayValue / 255.0f; // 0..255 -> 0.0..1.0 127 return Color.getHSBColor(hue, saturation, brightness); 35 128 } 36 129 } -
trunk/projects/slim-plugin/src/main/java/loci/slim/fitting/images/ColorizedImage.java
r7889 r7970 7 7 import java.awt.image.IndexColorModel; 8 8 9 import loci.slim. fitting.images.AbstractBaseColorizedImage;9 import loci.slim.IGrayScalePixelValue; 10 10 11 11 /** … … 25 25 */ 26 26 public ColorizedImage(String title, int[] dimension, 27 IndexColorModel indexColorModel, int parameterIndex) { 28 super(title, dimension, indexColorModel); 27 IndexColorModel indexColorModel, int parameterIndex, 28 boolean colorizeGrayScale, IGrayScalePixelValue grayScalePixelValue) { 29 super(title, dimension, indexColorModel, colorizeGrayScale, grayScalePixelValue); 29 30 _parameterIndex = parameterIndex; 30 31 } … … 40 41 return parameters[_parameterIndex]; 41 42 } 42 43 43 } -
trunk/projects/slim-plugin/src/main/java/loci/slim/fitting/images/ColorizedImageFactory.java
r7889 r7970 7 7 import java.awt.image.IndexColorModel; 8 8 9 import loci.slim.IGrayScalePixelValue; 9 10 import loci.slim.fitting.images.IColorizedImage; 10 11 import loci.slim.fitting.images.ColorizedImage; … … 30 31 } 31 32 32 public IColorizedImage createImage(ColorizedImageType outputImage, 33 int[] dimension, IndexColorModel indexColorModel, int components) { 33 public IColorizedImage createImage( 34 ColorizedImageType outputImageType, 35 int[] dimension, 36 IndexColorModel indexColorModel, 37 int components, 38 boolean colorizeGrayScale, 39 IGrayScalePixelValue grayScalePixelValue) 40 { 34 41 IColorizedImage fittedImage = null; 35 42 String title; 36 switch (outputImage ) {43 switch (outputImageType) { 37 44 case A1: 38 45 title = (1 == components) ? "A" : "A1"; 39 46 fittedImage = new ColorizedImage(title, dimension, 40 indexColorModel, ColorizedImageFitter.A1_INDEX); 47 indexColorModel, ColorizedImageFitter.A1_INDEX, 48 colorizeGrayScale, 49 grayScalePixelValue); 41 50 break; 42 51 case T1: 43 52 title = (1 == components) ? "T" : "T1"; 44 53 fittedImage = new ColorizedImage(title, dimension, 45 indexColorModel, ColorizedImageFitter.T1_INDEX); 54 indexColorModel, ColorizedImageFitter.T1_INDEX, 55 colorizeGrayScale, 56 grayScalePixelValue); 46 57 break; 47 58 case A2: 48 59 fittedImage = new ColorizedImage("A2", dimension, 49 indexColorModel, ColorizedImageFitter.A2_INDEX); 60 indexColorModel, ColorizedImageFitter.A2_INDEX, 61 colorizeGrayScale, 62 grayScalePixelValue); 50 63 break; 51 64 case T2: 52 65 fittedImage = new ColorizedImage("T2", dimension, 53 indexColorModel, ColorizedImageFitter.T2_INDEX); 66 indexColorModel, ColorizedImageFitter.T2_INDEX, 67 colorizeGrayScale, 68 grayScalePixelValue); 54 69 break; 55 70 case A3: 56 71 fittedImage = new ColorizedImage("A3", dimension, 57 indexColorModel, ColorizedImageFitter.A2_INDEX); 72 indexColorModel, ColorizedImageFitter.A2_INDEX, 73 colorizeGrayScale, 74 grayScalePixelValue); 58 75 break; 59 76 case T3: 60 77 fittedImage = new ColorizedImage("T3", dimension, 61 indexColorModel, ColorizedImageFitter.T2_INDEX); 78 indexColorModel, ColorizedImageFitter.T2_INDEX, 79 colorizeGrayScale, 80 grayScalePixelValue); 62 81 break; 63 82 case H: 64 83 fittedImage = new ColorizedImage("H", dimension, 65 indexColorModel, ColorizedImageFitter.H_INDEX); 84 indexColorModel, ColorizedImageFitter.H_INDEX, 85 colorizeGrayScale, 86 grayScalePixelValue); 66 87 break; 67 88 case Z: 68 89 fittedImage = new ColorizedImage("Z", dimension, 69 indexColorModel, ColorizedImageFitter.Z_INDEX); 90 indexColorModel, ColorizedImageFitter.Z_INDEX, 91 colorizeGrayScale, 92 grayScalePixelValue); 70 93 break; 71 94 case CHISQ: 72 95 fittedImage = new ColorizedImage("X2", dimension, 73 indexColorModel, ColorizedImageFitter.CHISQ_INDEX); 96 indexColorModel, ColorizedImageFitter.CHISQ_INDEX, 97 colorizeGrayScale, 98 grayScalePixelValue); 74 99 break; 75 100 case F1: 76 101 fittedImage = new FractionalIntensityImage("F1", dimension, 77 indexColorModel, 0, components); 102 indexColorModel, 0, components, colorizeGrayScale, 103 grayScalePixelValue); 78 104 break; 79 105 case F2: 80 106 fittedImage = new FractionalIntensityImage("F2", dimension, 81 indexColorModel, 1, components); 107 indexColorModel, 1, components, colorizeGrayScale, 108 grayScalePixelValue); 82 109 break; 83 110 case F3: 84 111 fittedImage = new FractionalIntensityImage("F3", dimension, 85 indexColorModel, 2, components); 112 indexColorModel, 2, components, colorizeGrayScale, 113 grayScalePixelValue); 86 114 break; 87 115 case f1: 88 116 fittedImage = new FractionalContributionImage("f1", dimension, 89 indexColorModel, 0, components); 117 indexColorModel, 0, components, colorizeGrayScale, 118 grayScalePixelValue); 90 119 break; 91 120 case f2: 92 121 fittedImage = new FractionalContributionImage("f2", dimension, 93 indexColorModel, 1, components); 122 indexColorModel, 1, components, colorizeGrayScale, 123 grayScalePixelValue); 94 124 break; 95 125 case f3: 96 126 fittedImage = new FractionalContributionImage("f3", dimension, 97 indexColorModel, 2, components); 127 indexColorModel, 2, components, colorizeGrayScale, 128 grayScalePixelValue); 98 129 break; 99 130 } -
trunk/projects/slim-plugin/src/main/java/loci/slim/fitting/images/ColorizedImageFitter.java
r7963 r7970 9 9 import java.util.List; 10 10 11 import loci.slim.IGrayScalePixelValue; 11 12 import loci.slim.histogram.HistogramTool; 12 13 … … 35 36 } 36 37 37 public void setUpFit(ColorizedImageType[] images, int[] dimension, 38 IndexColorModel indexColorModel, int components) { 38 public void setUpFit( 39 ColorizedImageType[] images, 40 int[] dimension, 41 IndexColorModel indexColorModel, 42 int components, 43 boolean colorizeGrayScale, 44 IGrayScalePixelValue grayScalePixelValue) 45 { 39 46 _fittedImages.clear(); 40 47 for (ColorizedImageType image : images) { 41 48 IColorizedImage fittedImage = 42 49 ColorizedImageFactory.getInstance().createImage 43 (image, dimension, indexColorModel, components); 50 (image, 51 dimension, 52 indexColorModel, 53 components, 54 colorizeGrayScale, 55 grayScalePixelValue); 44 56 _fittedImages.add(fittedImage); 45 57 } -
trunk/projects/slim-plugin/src/main/java/loci/slim/fitting/images/FloatFittedImage.java
r7963 r7970 17 17 int _width; 18 18 int _height; 19 int _channel; 19 20 FloatProcessor _imageProcessor; 20 21 21 public void init(int width, int height, IndexColorModel indexColorModel) { 22 public void init(int width, int height, int channel, 23 IndexColorModel indexColorModel) { 22 24 _width = width; 23 25 _height = height; 26 _channel = channel; 24 27 25 28 _imageProcessor = new FloatProcessor(width, height); … … 33 36 34 37 public void setColorModel(IndexColorModel indexColorModel) { 35 38 _imageProcessor.setColorModel(indexColorModel); 36 39 } 37 40 -
trunk/projects/slim-plugin/src/main/java/loci/slim/fitting/images/FractionalContributionImage.java
r7889 r7970 7 7 import java.awt.image.IndexColorModel; 8 8 9 import loci.slim.IGrayScalePixelValue; 9 10 import loci.slim.fitting.images.AbstractBaseColorizedImage; 10 11 … … 31 32 */ 32 33 public FractionalContributionImage(String title, int[] dimension, 33 IndexColorModel indexColorModel, int component, int components) { 34 super(title, dimension, indexColorModel); 34 IndexColorModel indexColorModel, int component, int components, 35 boolean colorizeGrayScale, IGrayScalePixelValue grayScalePixelValue) { 36 super(title, dimension, indexColorModel, colorizeGrayScale, grayScalePixelValue); 35 37 _component = component; 36 38 _components = components; -
trunk/projects/slim-plugin/src/main/java/loci/slim/fitting/images/FractionalIntensityImage.java
r7889 r7970 7 7 import java.awt.image.IndexColorModel; 8 8 9 import loci.slim.IGrayScalePixelValue; 9 10 import loci.slim.fitting.images.AbstractBaseColorizedImage; 10 11 … … 31 32 */ 32 33 public FractionalIntensityImage(String title, int[] dimension, 33 IndexColorModel indexColorModel, int component, int components) { 34 super(title, dimension, indexColorModel); 34 IndexColorModel indexColorModel, int component, int components, 35 boolean colorizeGrayScale, IGrayScalePixelValue grayScalePixelValue) { 36 super(title, dimension, indexColorModel, colorizeGrayScale, grayScalePixelValue); 35 37 _component = component; 36 38 _components = components; -
trunk/projects/slim-plugin/src/main/java/loci/slim/fitting/images/IColorizedFittedImage.java
r7963 r7970 15 15 public interface IColorizedFittedImage { 16 16 17 public void init(int width, int height, IndexColorModel indexColorModel); 17 public void init(int width, int height, int channel, 18 IndexColorModel indexColorModel); 18 19 19 20 public void setColorModel(IndexColorModel indexColorModel); -
trunk/projects/slim-plugin/src/main/java/loci/slim/heuristics/CursorEstimator.java
r7936 r7970 50 50 * <a href="http://dev.loci.wisc.edu/svn/software/trunk/projects/slim-plugin/src/main/java/loci/slim/CursorHelper.java">SVN</a></dd></dl> 51 51 * 52 * @author aivar52 * @author Aivar Grislis 53 53 */ 54 54 public class CursorEstimator { … … 282 282 transEndIndex = 9 * decay.length / 10; // "90% of transient" 283 283 if (transEndIndex <= transStartIndex + 2 * ATTEMPTS) { // "oops" 284 //TODO ARG transStartIndex etc. are unitialized 285 // do_estimate_resets restores values to previous, not this! 284 286 returnValue[PROMPT_START] = startp; 285 287 returnValue[PROMPT_STOP] = endp; … … 369 371 returnValue[DATA_START] = startt; 370 372 returnValue[TRANSIENT_STOP] = transEndIndex; 373 System.out.print("1 "); 374 dump(returnValue); 371 375 return returnValue; //TODO do estimate resets/frees??? 372 376 } … … 379 383 transStartIndex += index; 380 384 transFitStartIndex = transStartIndex + (transEndIndex - transStartIndex) / 20; 385 386 System.out.println("made it all the way to the end of estimateCursors"); 381 387 382 388 returnValue[PROMPT_START] = startp; … … 386 392 returnValue[DATA_START] = transFitStartIndex; 387 393 returnValue[TRANSIENT_STOP] = transEndIndex; 394 System.out.print("2 "); 395 dump(returnValue); 388 396 return returnValue; 397 } 398 399 private static void dump(double[] value) { 400 System.out.print("prompt "); 401 System.out.print("start " + value[PROMPT_START]); 402 System.out.print("end " + value[PROMPT_STOP]); 403 System.out.print("transient "); 404 System.out.print("start " + value[TRANSIENT_START]); 405 System.out.print("data start " + value[DATA_START]); 406 System.out.println("end " + value[TRANSIENT_STOP]); 389 407 } 390 408 … … 551 569 552 570 private static int findMax(double[] values, int startIndex, int endIndex) { 571 if (endIndex > values.length) { 572 System.out.println("CursorEstimator.findMax endIndex is " + endIndex + " values.length is " + values.length); 573 endIndex = values.length; 574 } 575 if (startIndex > values.length) { 576 System.out.println("CursorEstimator.findMax startIndex is " + startIndex + " values.length is " + values.length); 577 startIndex = values.length; 578 } 579 if (values.length == 0) { 580 System.out.println("CursorEstimator.findMax but values is length zero"); 581 return startIndex; 582 } 553 583 int index = startIndex; 554 584 double max = values[startIndex]; -
trunk/projects/slim-plugin/src/main/java/loci/slim/ui/IUserInterfacePanel.java
r7915 r7970 107 107 108 108 /** 109 * Returns whether to create colorized grayscale fitted images. 110 * 111 * @return 112 */ 113 public boolean getColorizeGrayScale(); 114 115 /** 109 116 * Gets analysis plugin names. 110 117 * -
trunk/projects/slim-plugin/src/main/java/loci/slim/ui/UserInterfacePanel.java
r7960 r7970 172 172 JComboBox m_noiseModelComboBox; 173 173 JComboBox m_fittedImagesComboBox; 174 JCheckBox m_colorizeGrayScale; 174 175 JCheckBox[] m_analysisCheckBoxList; 175 176 JCheckBox m_fitAllChannels; … … 476 477 fitPanel.add(m_fittedImagesComboBox); 477 478 479 JLabel dummyLabel = new JLabel(""); 480 dummyLabel.setHorizontalAlignment(SwingConstants.RIGHT); 481 fitPanel.add(dummyLabel); 482 m_colorizeGrayScale = new JCheckBox("Colorize grayscale"); 483 fitPanel.add(m_colorizeGrayScale); 484 478 485 int choices = analysisChoices.length; 479 486 if (choices > 0) { … … 494 501 495 502 // rows, cols, initX, initY, xPad, yPad 496 SpringUtilities.makeCompactGrid(fitPanel, 5+ choices, 2, 4, 4, 4, 4);503 SpringUtilities.makeCompactGrid(fitPanel, 6 + choices, 2, 4, 4, 4, 4); 497 504 498 505 JPanel panel = new JPanel(new BorderLayout()); … … 1230 1237 m_noiseModelComboBox.setEnabled(enable); 1231 1238 m_fittedImagesComboBox.setEnabled(enable); 1239 m_colorizeGrayScale.setEnabled(enable); 1232 1240 for (JCheckBox checkBox : m_analysisCheckBoxList) { 1233 1241 checkBox.setEnabled(enable); … … 1419 1427 System.out.println("changes to " + returnValue); 1420 1428 return returnValue.toString(); 1429 } 1430 1431 /** 1432 * Returns whether to create colorized grayscale fitted images. 1433 * 1434 * @return 1435 */ 1436 public boolean getColorizeGrayScale() { 1437 return m_colorizeGrayScale.isSelected(); 1421 1438 } 1422 1439
Note: See TracChangeset
for help on using the changeset viewer.