Changeset 6605


Ignore:
Timestamp:
06/30/10 13:12:51 (9 years ago)
Author:
curtis
Message:

Backport r6603,6604 to 4.2 branch.

Location:
branches/4.2
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • branches/4.2

  • branches/4.2/components

  • branches/4.2/components/bio-formats/src

  • branches/4.2/components/bio-formats/src/loci/formats/ChannelFiller.java

  • branches/4.2/components/bio-formats/src/loci/formats/ImageTools.java

  • branches/4.2/components/bio-formats/src/loci/formats/in/FakeReader.java

  • branches/4.2/components/loci-plugins

  • branches/4.2/components/loci-plugins/src/loci/plugins

  • branches/4.2/components/loci-plugins/src/loci/plugins/in/Colorizer.java

    r6599 r6605  
    2626package loci.plugins.in; 
    2727 
     28import ij.CompositeImage; 
     29import ij.ImagePlus; 
     30import ij.process.LUT; 
     31 
    2832import java.awt.Color; 
    2933import java.awt.image.ColorModel; 
    3034import java.awt.image.IndexColorModel; 
    3135import java.util.List; 
    32  
    33 import ij.CompositeImage; 
    34 import ij.ImagePlus; 
    35 import ij.ImageStack; 
    36 import ij.process.LUT; 
    3736 
    3837import loci.formats.ChannelFiller; 
     
    7877      reader.setSeries(series); 
    7978 
    80       int mode = -1; 
    81       LUT[] luts; 
    82  
    8379      // get LUT for each channel 
    84       final ImageStack stack = imp.getStack(); 
    8580      final String stackOrder = dimSwapper.getDimensionOrder(); 
    8681      final int zSize = imp.getNSlices(); 
     
    9893      } 
    9994 
     95      int mode = -1; 
     96      LUT[] luts; 
    10097      if (options.isColorModeDefault()) { 
    10198        // NB: Default color mode behavior depends on the situation. 
     
    142139      } 
    143140 
    144       final boolean doComposite = mode != -1 && cSize > 1 && cSize <= 7; 
     141      final boolean doComposite = !options.isViewStandard() && 
     142        mode != -1 && cSize > 1 && cSize <= 7; 
    145143      if (doComposite) { 
    146144        CompositeImage compImage = new CompositeImage(imp, mode); 
     
    153151          imp.getProcessor().setColorModel(luts[0]); 
    154152        } 
    155         if (mode != -1 && cSize > 1) { 
     153        if (mode != -1 && cSize > 7) { 
    156154          // NB: Cannot use CompositeImage with more than seven channels. 
    157155          BF.warn(options.isQuiet(), "Data has too many channels for " + 
  • branches/4.2/components/loci-plugins/src/loci/plugins/in/DisplayHandler.java

    r6589 r6605  
    125125  public void displayImage(ImagePlus imp) { 
    126126    if (options.isViewNone()) return; 
     127    else if (options.isViewStandard()) displayNormal(imp); 
    127128    else if (options.isViewHyperstack()) displayNormal(imp); 
    128129    else if (options.isViewBrowser()) displayDataBrowser(imp); 
  • branches/4.2/components/loci-plugins/src/loci/plugins/in/ImagePlusReader.java

    r6599 r6605  
    409409    imp.setDimensions(cCount, zCount, tCount); 
    410410 
    411     imp.setOpenAsHyperStack(true); 
     411    // open as a hyperstack, as appropriate 
     412    boolean hyper = !options.isViewStandard(); 
     413    imp.setOpenAsHyperStack(hyper); 
    412414 
    413415    // apply intensity scaling 
  • branches/4.2/components/loci-plugins/src/loci/plugins/in/ImporterOptions.java

    r6589 r6605  
    9393  // possible values for stackFormat 
    9494  public static final String VIEW_NONE       = "Metadata only"; 
     95  public static final String VIEW_STANDARD   = "Standard ImageJ"; 
    9596  public static final String VIEW_HYPERSTACK = "Hyperstack"; 
    9697  public static final String VIEW_BROWSER    = "Data Browser"; 
     
    197198    String options = Macro.getOptions(); 
    198199 
     200    // NB: It would be nice to remove the Standard ImageJ option someday; 
     201    // when that happens, the following code provides support for old macros. 
    199202    // check obsolete view options 
    200     String stackFormat = options == null ? 
    201       null : Macro.getValue(options, "view", null); 
    202     final String viewStandard = "Standard ImageJ"; 
    203     if (viewStandard.equals(stackFormat)) { 
    204       // Standard ImageJ -> Hyperstack 
    205       options = options.replaceFirst( 
    206         "\\[" + viewStandard + "\\]", VIEW_HYPERSTACK); 
    207       Macro.setOptions(options); 
    208       setStackFormat(VIEW_HYPERSTACK); 
    209     } 
     203    //String stackFormat = options == null ? 
     204    //  null : Macro.getValue(options, "view", null); 
     205    //final String viewStandard = "Standard ImageJ"; 
     206    //if (viewStandard.equals(stackFormat)) { 
     207    //  // Standard ImageJ -> Hyperstack 
     208    //  options = options.replaceFirst( 
     209    //    "\\[" + viewStandard + "\\]", VIEW_HYPERSTACK); 
     210    //  Macro.setOptions(options); 
     211    //  setStackFormat(VIEW_HYPERSTACK); 
     212    //} 
    210213 
    211214    // check obsolete color options 
     
    349352  public String[] getStackFormats() { return getPossible(KEY_STACK_FORMAT); } 
    350353  public boolean isViewNone() { return VIEW_NONE.equals(getStackFormat()); } 
     354  public boolean isViewStandard() { 
     355    return VIEW_STANDARD.equals(getStackFormat()); 
     356  } 
    351357  public boolean isViewHyperstack() { 
    352358    return VIEW_HYPERSTACK.equals(getStackFormat()); 
  • branches/4.2/components/loci-plugins/src/loci/plugins/in/MainDialog.java

    r6589 r6605  
    433433    String stackFormatValue = stackFormatChoice.getSelectedItem(); 
    434434    boolean isStackNone = stackFormatValue.equals(ImporterOptions.VIEW_NONE); 
     435    boolean isStackStandard = 
     436      stackFormatValue.equals(ImporterOptions.VIEW_STANDARD); 
    435437    boolean isStackHyperstack = 
    436438      stackFormatValue.equals(ImporterOptions.VIEW_HYPERSTACK); 
     
    461463 
    462464    // stackOrderChoice 
    463     stackOrderEnabled = false; 
     465    stackOrderEnabled = isStackStandard; 
    464466    if (src == stackFormatChoice) { 
    465467      if (isStackHyperstack || isStackBrowser || isStackImage5D) { 
  • branches/4.2/components/loci-plugins/src/loci/plugins/in/importer-options.txt

    r6589 r6605  
    259259  <br><br>Possible choices are:<ul>                                   \ 
    260260  <li><b>Metadata only</b> - Display no pixels, only metadata.</li>   \ 
     261  <li><b>Standard ImageJ</b> - Display the pixels in ImageJ's         \ 
     262  built-in 2D viewer.</li>                                            \ 
    261263  <li><b>Hyperstack</b> - Display the pixels in ImageJ's              \ 
    262264  built-in 5D viewer.</li>                                            \ 
     
    272274values = \ 
    273275  Metadata only,   \ 
     276  Standard ImageJ, \ 
    274277  Hyperstack,      \ 
    275278  Data Browser,    \ 
     
    289292  <li>Hyperstacks must be in XYCZT order.</li>                         \ 
    290293  <li>Image5D must be in XYCZT order.</li>                             \ 
    291   <li>View5D must be in XYCZT order.</li>                              \ 
     294  <li>View5D must be in XYZCT order.</li>                              \ 
    292295  </ul><b>Example:</b> For a dataset in XYCZT order with 2 channels,   \ 
    293296  3 focal planes and 5 time points, the order would be:<ol>            \ 
  • branches/4.2/components/loci-plugins/src/loci/plugins/macro/LociFunctions.java

    r6589 r6605  
    4343import loci.formats.services.OMEXMLService; 
    4444import loci.plugins.util.ImageProcessorReader; 
    45 import loci.plugins.util.ImagePlusTools; 
    4645import loci.plugins.util.LociPrefs; 
    4746 
     
    165164    ImageProcessor[] ip = r.openProcessors(no.intValue(), 
    166165      x.intValue(), y.intValue(), w.intValue(), h.intValue()); 
     166    // START HERE - add a method to create an ImagePlus from an ImageProcessor[] 
    167167    // CTR FIXME - Ext.openSubImage 
    168168    //ImagePlusTools.makeRGB(title, ip).show(); 
Note: See TracChangeset for help on using the changeset viewer.