Changeset 3196
- Timestamp:
- 09/27/07 11:29:18 (12 years ago)
- Location:
- trunk/loci/plugins
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/loci/plugins/CustomImage.java
r3015 r3196 35 35 protected String order; 36 36 protected int z, t, channels; 37 38 public CustomImage(ImagePlus imp, String order, int z, int t, int channels) { 37 boolean autoscale; 38 39 public CustomImage(ImagePlus imp, String order, int z, int t, int channels, 40 boolean autoscale) 41 { 39 42 this.z = z; 40 43 this.t = t; 41 44 this.channels = channels; 42 45 this.order = order; 46 this.autoscale = autoscale; 43 47 ImageStack stack2; 44 48 boolean isRGB = imp.getBitDepth() == 24; … … 117 121 if (slice > nChannels) slice = nChannels; 118 122 119 if (slice - 1 != currentChannel ) {123 if (slice - 1 != currentChannel && autoscale) { 120 124 currentChannel = slice - 1; 121 125 getProcessor().setMinAndMax(cip[currentChannel].getMin(), … … 136 140 137 141 ImageProcessor iip = getProcessor(); 138 cip[currentChannel].setMinAndMax(iip.getMin(), iip.getMax());142 if (autoscale) cip[currentChannel].setMinAndMax(iip.getMin(), iip.getMax()); 139 143 if (singleChannel) { 140 144 PixelGrabber pg = new PixelGrabber(cip[currentChannel].createImage(), -
trunk/loci/plugins/Importer.java
r3177 r3196 30 30 import ij.measure.Calibration; 31 31 import ij.process.*; 32 import java.awt.Dimension;33 import java.awt.Frame;34 import java.awt.event.*;35 32 import java.awt.image.*; 36 33 import java.io.*; … … 131 128 boolean concatenate = options.isConcatenate(); 132 129 boolean specifyRanges = options.isSpecifyRanges(); 130 boolean autoscale = options.isAutoscale(); 133 131 134 132 boolean viewNone = options.isViewNone(); … … 713 711 boolean mergeChannels = options.isMergeChannels(); 714 712 boolean concatenate = options.isConcatenate(); 715 716 Util.adjustColorRange(imp); 713 if (options.isAutoscale()) Util.adjustColorRange(imp); 717 714 718 715 // convert to RGB if needed … … 722 719 !r.isIndexed()) 723 720 { 724 makeRGB(imp, r, r.getSizeC() );721 makeRGB(imp, r, r.getSizeC(), options.isAutoscale()); 725 722 } 726 723 else if (mergeChannels && r.getSizeC() > 1 && r.getSizeC() < 4 && … … 743 740 catch (ReflectException exc) { 744 741 imp = new CustomImage(imp, stackOrder, r.getSizeZ(), 745 r.getSizeT(), r.getSizeC() );742 r.getSizeT(), r.getSizeC(), options.isAutoscale()); 746 743 } 747 744 } 748 745 else { 749 746 imp = new CustomImage(imp, stackOrder, r.getSizeZ(), 750 r.getSizeT(), r.getSizeC() );747 r.getSizeT(), r.getSizeC(), options.isAutoscale()); 751 748 } 752 749 } … … 766 763 { 767 764 String option = options.getMergeOption(); 768 if (option.indexOf("2 channels") != -1) makeRGB(imp, r, 2); 769 else if (option.indexOf("3 channels") != -1) makeRGB(imp, r, 3); 765 if (option.indexOf("2 channels") != -1) { 766 makeRGB(imp, r, 2, options.isAutoscale()); 767 } 768 else if (option.indexOf("3 channels") != -1) { 769 makeRGB(imp, r, 3, options.isAutoscale()); 770 } 770 771 } 771 772 } … … 832 833 } 833 834 834 private void makeRGB(ImagePlus imp, IFormatReader r, int c ) {835 private void makeRGB(ImagePlus imp, IFormatReader r, int c, boolean scale) { 835 836 ImageStack s = imp.getStack(); 836 837 ImageStack newStack = new ImageStack(s.getWidth(), s.getHeight()); … … 840 841 } 841 842 imp.setStack(imp.getTitle(), newStack); 842 Util.adjustColorRange(imp);843 if (scale) Util.adjustColorRange(imp); 843 844 844 845 s = imp.getStack(); -
trunk/loci/plugins/ImporterOptions.java
r3177 r3196 101 101 public static final String PREF_THUMBNAIL = "bioformats.forceThumbnails"; 102 102 public static final String PREF_MERGE_OPTION = "bioformats.mergeOption"; 103 public static final String PREF_AUTOSCALE = "bioformats.autoscale"; 103 104 104 105 // labels for user dialog; when trimmed these double as argument & macro keys … … 114 115 "Concatenate compatible series"; 115 116 public static final String LABEL_RANGE = "Specify range for each series"; 117 public static final String LABEL_AUTOSCALE = "Autoscale images"; 116 118 117 119 public static final String LABEL_LOCATION = "Location: "; … … 130 132 private Checkbox concatenateBox; 131 133 private Checkbox rangeBox; 134 private Checkbox autoscaleBox; 132 135 private Choice mergeChoice; 133 136 … … 143 146 private boolean concatenate; 144 147 private boolean specifyRanges; 148 private boolean autoscale; 145 149 private boolean forceThumbnails; 146 150 private String mergeOption; … … 166 170 public boolean isSpecifyRanges() { return specifyRanges; } 167 171 public boolean isForceThumbnails() { return forceThumbnails; } 172 public boolean isAutoscale() { return autoscale; } 168 173 public String getMergeOption() { return mergeOption; } 169 174 … … 198 203 public void setSpecifyRanges(boolean b) { specifyRanges = b; } 199 204 public void setForceThumbnails(boolean b) { forceThumbnails = b; } 205 public void setAutoscale(boolean b) { autoscale = b; } 200 206 201 207 /** Loads default option values from IJ_Prefs.txt. */ … … 211 217 specifyRanges = Prefs.get(PREF_RANGE, false); 212 218 forceThumbnails = Prefs.get(PREF_THUMBNAIL, false); 219 autoscale = Prefs.get(PREF_AUTOSCALE, true); 213 220 mergeOption = Prefs.get(PREF_MERGE_OPTION, MERGE_DEFAULT); 214 221 } … … 226 233 Prefs.set(PREF_RANGE, specifyRanges); 227 234 Prefs.set(PREF_MERGE_OPTION, mergeOption); 235 Prefs.set(PREF_AUTOSCALE, autoscale); 228 236 } 229 237 … … 262 270 stackFormat = Macro.getValue(arg, LABEL_STACK, stackFormat); 263 271 mergeOption = Macro.getValue(arg, LABEL_MERGE_OPTION, mergeOption); 272 autoscale = getMacroValue(arg, LABEL_AUTOSCALE, autoscale); 264 273 265 274 location = Macro.getValue(arg, LABEL_LOCATION, location); … … 423 432 gd.addCheckbox(LABEL_CONCATENATE, concatenate); 424 433 gd.addCheckbox(LABEL_RANGE, specifyRanges); 434 gd.addCheckbox(LABEL_AUTOSCALE, autoscale); 425 435 426 436 // extract GUI components from dialog and add listeners … … 442 452 concatenateBox = (Checkbox) boxes.get(5); 443 453 rangeBox = (Checkbox) boxes.get(6); 454 autoscaleBox = (Checkbox) boxes.get(7); 444 455 for (int i=0; i<boxes.size(); i++) { 445 456 ((Checkbox) boxes.get(i)).addItemListener(this); … … 459 470 concatenate = gd.getNextBoolean(); 460 471 specifyRanges = gd.getNextBoolean(); 472 autoscale = gd.getNextBoolean(); 461 473 462 474 return STATUS_OK;
Note: See TracChangeset
for help on using the changeset viewer.