Changeset 7850 for trunk/projects/slim-plugin
- Timestamp:
- 12/23/11 16:33:55 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/projects/slim-plugin/src/main/java/imagej/slim/histogram/HistogramTool.java
r7848 r7850 9 9 import java.io.IOException; 10 10 11 import ij.IJ; 11 12 import ij.plugin.LutLoader; 12 13 import ij.process.ByteProcessor; … … 19 20 import java.awt.event.ItemEvent; 20 21 import java.awt.event.ItemListener; 22 import java.io.File; 21 23 import java.util.Timer; 22 24 import java.util.TimerTask; … … 44 46 private final static int COLORBAR_HEIGHT = 20; 45 47 private final static int TASK_PERIOD = 100; 46 //TODO kludged in, user s/b able to select LUTS, somewhere else: 47 //TODO note that most IJ LUTs are unsuitable here, so having one standard lifetime LUT is not so bad 48 private final static String HARDCODED_LUT = "/Applications/ImageJ/luts/aivar6.lut"; // aivar6 is my five color blue/cyan/green/yellow/red spectral palette 48 private final static String LUT = "lifetime.lut"; 49 49 private static HistogramTool INSTANCE = null; 50 50 private final Object _synchObject = new Object(); … … 64 64 _colorBarPanel = new ColorBarPanel(WIDTH, INSET, COLORBAR_HEIGHT); 65 65 _colorBarPanel.setLUT(getLUT()); 66 _uiPanel = new UIPanel( true);66 _uiPanel = new UIPanel(false); // true); 67 67 _uiPanel.setListener(new UIPanelListener()); 68 68 69 69 _frame = new JFrame("Histogram"); 70 70 _frame.setResizable(false); 71 _frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); //TODO kind of lame, for now71 //_frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); //TODO kind of lame, for now 72 72 _frame.getContentPane().add(_histogramPanel, BorderLayout.NORTH); 73 73 _frame.getContentPane().add(_colorBarPanel, BorderLayout.CENTER); … … 97 97 public static IndexColorModel getIndexColorModel() { 98 98 IndexColorModel colorModel = null; 99 // 'getDirectory("luts")' works in IJ but not during NetBeans development 100 String startupPath = IJ.getDirectory("startup"); 101 String lutPath = startupPath + "luts" + File.separatorChar + LUT; 99 102 try { 100 colorModel = LutLoader.open( HARDCODED_LUT);103 colorModel = LutLoader.open(lutPath); 101 104 } 102 105 catch (IOException e) { 103 System.out.println(" Error opening LUT " + e.getMessage());106 System.out.println("Problem loading LUT " + lutPath); 104 107 } 105 108
Note: See TracChangeset
for help on using the changeset viewer.