Changeset 7845 for trunk/projects/slim-plugin
- Timestamp:
- 12/20/11 23:56:21 (8 years ago)
- Location:
- trunk/projects/slim-plugin/src/main/java/imagej/slim
- Files:
-
- 1 added
- 1 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/projects/slim-plugin/src/main/java/imagej/slim/fitting/AbstractBaseFittedImage.java
r7842 r7845 10 10 import java.awt.image.IndexColorModel; 11 11 12 //import ij.process.MyFloatProcessor; //TODO IJ hack; update to IJ2 ImgLib13 12 import ij.ImagePlus; 14 13 import ij.process.FloatProcessor; … … 41 40 _image = new FloatProcessor(x, y); 42 41 _image.setColorModel(imagej.slim.histogram.HistogramTool.getIndexColorModel()); 43 // TODO fill the image with a color that will be out of LUT range and paint black!:44 _image.setValue(Float.NaN); //TODO45 _image.fill(); //TODO42 // fill the image with a value that will be out of LUT range and paint black. 43 _image.setValue(Float.NaN); 44 _image.fill(); 46 45 _imagePlus = new ImagePlus(title, _image); 47 46 _imagePlus.show(); … … 129 128 for (int y = 0; y < values[0].length; ++y) { 130 129 for (int x = 0; x < values.length; ++x) { 131 if ( InvalidDouble.isValue(values[x][y])) {130 if (Double.isNaN(values[x][y])) { 132 131 ++num; 133 132 } … … 138 137 return num; 139 138 } 140 141 142 143 139 144 140 /** … … 188 184 for (int y = 0; y < values[0].length; ++y) { 189 185 for (int x = 0; x < values.length; ++x) { 190 values[x][y] = InvalidDouble.value();186 values[x][y] = Double.NaN; 191 187 } 192 188 } -
trunk/projects/slim-plugin/src/main/java/imagej/slim/histogram/HistogramData.java
r7838 r7845 224 224 225 225 if (null != _listener) { 226 System.out.println("tell listener " + _minView + " " + _maxView + "," + _minLUT + " " + _maxLUT); 226 227 _listener.minMaxChanged(_minView, _maxView, _minLUT, _maxLUT); 227 228 } -
trunk/projects/slim-plugin/src/main/java/imagej/slim/histogram/HistogramDataChannel.java
r7842 r7845 4 4 */ 5 5 package imagej.slim.histogram; 6 7 import imagej.slim.fitting.InvalidDouble;8 6 9 7 /** … … 15 13 public class HistogramDataChannel { 16 14 private double[][] _values; 17 private double _min;18 private double _max;19 15 private double _minLUT; 20 16 private double _maxLUT; … … 34 30 public HistogramDataChannel(double[][] values) { 35 31 _values = values; 36 _min = _max = 0.0f;37 32 } 38 33 … … 66 61 */ 67 62 public double[] findMinMax() { 68 _min = Double.MAX_VALUE;69 _max = Double.MIN_VALUE;63 double min = Double.MAX_VALUE; 64 double max = Double.MIN_VALUE; 70 65 for (int i = 0; i < _values.length; ++i) { 71 66 for (int j = 0; j < _values[0].length; ++j) { 72 if ( InvalidDouble.isValue(_values[i][j])) {73 if (_values[i][j] < _min) {74 _min = _values[i][j];67 if (!Double.isNaN(_values[i][j])) { 68 if (_values[i][j] < min) { 69 min = _values[i][j]; 75 70 } 76 if (_values[i][j] > _max) {77 _max = _values[i][j];71 if (_values[i][j] > max) { 72 max = _values[i][j]; 78 73 } 79 74 } 80 75 } 81 76 } 82 return new double[] { _min, _max };77 return new double[] { min, max }; 83 78 } 84 79 -
trunk/projects/slim-plugin/src/main/java/imagej/slim/histogram/HistogramTool.java
r7844 r7845 65 65 _colorBarPanel.setLUT(getLUT()); 66 66 _uiPanel = new UIPanel(); 67 _uiPanel.setListener(new UIPanelListener()); 67 68 68 69 _frame = new JFrame("Histogram"); … … 217 218 double minLUT = pixelToValue(min); 218 219 double maxLUT = pixelToValue(max); 220 221 // set min and max on UI panel 222 _uiPanel.setMinMaxLUT(minLUT, maxLUT); 219 223 220 224 // redraw image and save … … 311 315 } 312 316 } 317 318 private class UIPanelListener implements IUIPanelListener { 319 //tOEOprivate UIPanelListener() { } 320 @Override 321 public void setAuto(boolean auto) { 322 // turn on/off the cursors 323 // they are usually at -1 & 255 324 // but if you are autoranging & showing all channels 325 // they need to be calculated 326 // autorange off, stuff shouldn't change right away 327 // autorange on, should calculate new bounds 328 } 329 330 @Override 331 public void setMinMaxLUT(double min, double max) { 332 // user has typed in some new values 333 // can't be autoranging 334 // adjust cursors and color bar and possibly histogram 335 } 336 } 313 337 } -
trunk/projects/slim-plugin/src/main/java/imagej/slim/histogram/UIPanel.java
r7838 r7845 24 24 */ 25 25 public class UIPanel extends JPanel { 26 IUIPanelListener _listener; 26 27 JCheckBox m_autoCheckBox; 27 28 JTextField m_startTextField; … … 46 47 47 48 m_auto = true; 48 m_start = m_stop = m_min = m_max = 0.0; 49 m_start = m_stop = m_min = m_max = 0.0; //TODO gotta be a better way 49 50 50 51 setLayout(new BoxLayout(this, BoxLayout.X_AXIS)); … … 96 97 } 97 98 99 public void setListener(IUIPanelListener listener) { 100 _listener = listener; 101 } 102 103 public void setAuto(boolean auto) { 104 105 } 106 107 public void setMinMaxLUT(double min, double max) { 108 System.out.println("SetMinMaxLUT " + min + " " + max); 109 m_startTextField.setText("" + min); 110 m_stopTextField.setText("" + max); 111 } 112 113 // not 98 114 /** 99 115 * IColorizeRangeListener method. Gets external changes to settings.
Note: See TracChangeset
for help on using the changeset viewer.