Changeset 3307


Ignore:
Timestamp:
10/25/07 07:45:48 (12 years ago)
Author:
melissa
Message:

Added command-line flags to ImageConverter (-merge, -separate, -stitch, -fill) and ImageInfo (-fill).

Location:
trunk/loci/formats/tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/formats/tools/ImageConverter.java

    r3137 r3307  
    4949  { 
    5050    String in = null, out = null; 
     51    boolean stitch = false, separate = false, merge = false, fill = false; 
    5152    if (args != null) { 
    5253      for (int i=0; i<args.length; i++) { 
    5354        if (args[i].startsWith("-") && args.length > 1) { 
    5455          if (args[i].equals("-debug")) FormatHandler.setDebug(true); 
     56          else if (args[i].equals("-stitch")) stitch = true; 
     57          else if (args[i].equals("-separate")) separate = true; 
     58          else if (args[i].equals("-merge")) merge = true; 
     59          else if (args[i].equals("-fill")) fill = true; 
    5560          else LogTools.println("Ignoring unknown command flag: " + args[i]); 
    5661        } 
     
    7580    long start = System.currentTimeMillis(); 
    7681    LogTools.print(in + " "); 
    77     ImageReader reader = new ImageReader(); 
     82    IFormatReader reader = new ImageReader(); 
     83    if (stitch) reader = new FileStitcher(reader); 
     84    if (separate) reader = new ChannelSeparator(reader); 
     85    if (merge) reader = new ChannelMerger(reader); 
     86    if (fill) reader = new ChannelFiller(reader); 
     87 
    7888    reader.setOriginalMetadataPopulated(true); 
    7989    MetadataStore store = MetadataTools.createOMEXMLMetadata(); 
  • trunk/loci/formats/tools/ImageInfo.java

    r3281 r3307  
    5959    boolean thumbs = false; 
    6060    boolean minmax = false; 
     61    boolean fill = false; 
    6162    boolean merge = false; 
    6263    boolean stitch = false; 
     
    7879          else if (args[i].equals("-thumbs")) thumbs = true; 
    7980          else if (args[i].equals("-minmax")) minmax = true; 
     81          else if (args[i].equals("-fill")) fill = true; 
    8082          else if (args[i].equals("-merge")) merge = true; 
    8183          else if (args[i].equals("-stitch")) stitch = true; 
     
    135137        "   -thumbs: read thumbnails instead of normal pixels", 
    136138        "   -minmax: compute min/max statistics", 
     139        "     -fill: convert indexed color images to RGB", 
    137140        "    -merge: combine separate channels into RGB image", 
    138141        "   -stitch: stitch files with similar names", 
     
    180183      if (pat != null) id = pat; 
    181184    } 
     185    if (fill) reader = new ChannelFiller(reader); 
    182186    if (separate) reader = new ChannelSeparator(reader); 
    183187    if (merge) reader = new ChannelMerger(reader); 
Note: See TracChangeset for help on using the changeset viewer.