Changeset 4291


Ignore:
Timestamp:
08/06/08 13:51:52 (12 years ago)
Author:
curtis
Message:

Fix some dimension swapper bugs... but there are still problems.

Location:
trunk/loci
Files:
5 edited

Legend:

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

    r4265 r4291  
    234234  } 
    235235 
     236  /* @see loci.formats.IFormatReader#getIndex(int, int, int) */ 
     237  public int getIndex(int z, int c, int t) { 
     238    if (outputOrder == null) return super.getIndex(z, c, t); 
     239    FormatTools.assertId(getCurrentFile(), true, 2); 
     240    int zSize = getSizeZ(); 
     241    int cSize = getEffectiveSizeC(); 
     242    int tSize = getSizeT(); 
     243    int num = getImageCount(); 
     244    return FormatTools.getIndex(outputOrder, 
     245      zSize, cSize, tSize, num, z, c, t); 
     246  } 
     247 
     248  /* @see loci.formats.IFormatReader#getZCTCoords(int) */ 
     249  public int[] getZCTCoords(int index) { 
     250    if (outputOrder == null) return super.getZCTCoords(index); 
     251    FormatTools.assertId(getCurrentFile(), true, 2); 
     252    int zSize = reader.getSizeZ(); 
     253    int cSize = reader.getEffectiveSizeC(); 
     254    int tSize = reader.getSizeT(); 
     255    int num = reader.getImageCount(); 
     256    return FormatTools.getZCTCoords(outputOrder, 
     257      zSize, cSize, tSize, num, index); 
     258  } 
     259 
    236260  // -- Helper methods -- 
    237261 
  • trunk/loci/formats/FileStitcher.java

    r4280 r4291  
    720720  /* @see IFormatReader#getIndex(int, int, int) */ 
    721721  public int getIndex(int z, int c, int t) { 
     722    FormatTools.assertId(currentId, true, 2); 
    722723    return FormatTools.getIndex(this, z, c, t); 
    723724  } 
     
    725726  /* @see IFormatReader#getZCTCoords(int) */ 
    726727  public int[] getZCTCoords(int index) { 
     728    FormatTools.assertId(currentId, true, 2); 
    727729    return FormatTools.getZCTCoords(this, index); 
    728730  } 
  • trunk/loci/formats/FormatReader.java

    r4205 r4291  
    564564  /* @see IFormatReader#getCurrentFile() */ 
    565565  public String getCurrentFile() { 
    566     return currentId == null ? "" : currentId; 
     566    return currentId; 
    567567  } 
    568568 
  • trunk/loci/formats/tools/ImageInfo.java

    r4048 r4291  
    7474    int series = 0; 
    7575    int xCoordinate = 0, yCoordinate = 0, width = 0, height = 0; 
    76     String swapOrder = null; 
     76    String swapOrder = null, shuffleOrder = null; 
    7777    String map = null; 
    7878    if (args != null) { 
     
    122122            swapOrder = args[++i].toUpperCase(); 
    123123          } 
     124          else if (args[i].equals("-shuffle")) { 
     125            shuffleOrder = args[++i].toUpperCase(); 
     126          } 
    124127          else if (args[i].equals("-map")) map = args[++i]; 
    125128          else LogTools.println("Ignoring unknown command flag: " + args[i]); 
     
    142145        "    [-merge] [-stitch] [-separate] [-expand] [-omexml]", 
    143146        "    [-normalize] [-fast] [-debug] [-range start end] [-series num]", 
    144         "    [-swap order] [-map id] [-preload] [-version v] [-crop x,y,w,h]", 
     147        "    [-swap inputOrder] [-shuffle outputOrder] [-map id] [-preload]", 
     148        "    [-version v] [-crop x,y,w,h]", 
    145149        "", 
    146150        "      file: the image file to read", 
     
    159163        "    -range: specify range of planes to read (inclusive)", 
    160164        "   -series: specify which image series to read", 
    161         "     -swap: override the default dimension order", 
     165        "     -swap: override the default input dimension order", 
     166        "  -shuffle: override the default output dimension order", 
    162167        "      -map: specify file on disk to which name should be mapped", 
    163168        "  -preload: pre-read entire file into a buffer; significantly", 
     
    215220    if (minmax) reader = minMaxCalc = new MinMaxCalculator(reader); 
    216221    DimensionSwapper dimSwapper = null; 
    217     if (swapOrder != null) reader = dimSwapper = new DimensionSwapper(reader); 
     222    if (swapOrder != null || shuffleOrder != null) { 
     223      reader = dimSwapper = new DimensionSwapper(reader); 
     224    } 
    218225 
    219226    StatusEchoer status = new StatusEchoer(); 
     
    230237    LogTools.println("Initialization took " + sec1 + "s"); 
    231238    if (swapOrder != null) dimSwapper.swapDimensions(swapOrder); 
     239    if (shuffleOrder != null) dimSwapper.setOutputOrder(shuffleOrder); 
    232240 
    233241    if (!normalize && reader.getPixelType() == FormatTools.FLOAT) { 
  • trunk/loci/plugins/BFVirtualStack.java

    r4265 r4291  
    107107    } 
    108108 
    109 /* 
    110109    // cache missed 
    111110    try { 
    112       return Util.openProcessor(reader, n); 
     111      // CTR TODO - fix this 
     112      return Util.openProcessors(reader, n)[0]; 
    113113//      int index = FormatTools.getReorderedIndex(reader, stackOrder, n - 1); 
    114114//      if (merge <= 1) return Util.openProcessor(reader, index); 
     
    129129      exc.printStackTrace(); 
    130130    } 
    131 */ 
    132131    return null; 
    133132  } 
Note: See TracChangeset for help on using the changeset viewer.