Changeset 3079


Ignore:
Timestamp:
08/10/07 16:05:58 (13 years ago)
Author:
curtis
Message:

Add option to override dimension order (tests DimensionSwapper class).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/formats/ConsoleTools.java

    r3062 r3079  
    7070    int end = Integer.MAX_VALUE; 
    7171    int series = 0; 
     72    String swapOrder = null; 
    7273    String map = null; 
    7374    if (args != null) { 
     
    104105            catch (NumberFormatException exc) { } 
    105106          } 
     107          else if (args[i].equals("-swap")) { 
     108            swapOrder = args[++i].toUpperCase(); 
     109          } 
    106110          else if (args[i].equals("-map")) map = args[++i]; 
    107111          else LogTools.println("Ignoring unknown command flag: " + args[i]); 
     
    121125      String[] s = { 
    122126        "To test read a file in " + fmt + " format, run:", 
    123         "  java " + className + " [-nopix] [-nometa] [-thumbs] [-minmax]", 
    124         "    [-merge] [-stitch] [-separate] [-omexml] [-normalize]", 
    125         "    [-fast] [-debug] [-range start end] [-series num] [-map id] file", 
     127        "  java " + className + " [-nopix] [-nometa] [-thumbs]", 
     128        "    [-minmax] [-merge] [-stitch] [-separate] [-omexml]", 
     129        "    [-normalize] [-fast] [-debug] [-range start end]", 
     130        "    [-series num] [-swap order] [-map id] file", 
    126131        "", 
    127132        "      file: the image file to read", 
     
    139144        "    -range: specify range of planes to read (inclusive)", 
    140145        "   -series: specify which image series to read", 
     146        "     -swap: override the default dimension order", 
    141147        "      -map: specify file on disk to which name should be mapped", 
    142148        "", 
     
    184190    MinMaxCalculator minMaxCalc = null; 
    185191    if (minmax) reader = minMaxCalc = new MinMaxCalculator(reader); 
     192    DimensionSwapper dimSwapper = null; 
     193    if (swapOrder != null) reader = dimSwapper = new DimensionSwapper(reader); 
    186194 
    187195    StatusEchoer status = new StatusEchoer(); 
     
    197205    float sec1 = (e1 - s1) / 1000f; 
    198206    LogTools.println("Initialization took " + sec1 + "s"); 
     207    if (swapOrder != null) dimSwapper.swapDimensions(swapOrder); 
    199208 
    200209    if (!normalize && reader.getPixelType() == FormatTools.FLOAT) { 
Note: See TracChangeset for help on using the changeset viewer.