Changeset 4310


Ignore:
Timestamp:
08/14/08 13:30:37 (12 years ago)
Author:
melissa
Message:

Fixed remainder of dimension swapping/shuffling bugs. Changed DimensionSwapper.getDimensionOrder() to report output order (instead of input order).

File:
1 edited

Legend:

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

    r4301 r4310  
    4141  // -- Fields -- 
    4242 
    43   /** The output dimension order for the image series. */ 
    44   protected String outputOrder; 
     43  /** The input dimension order for the image series. */ 
     44  protected String inputOrder; 
    4545 
    4646  // -- Constructors -- 
     
    125125    core.sizeC[series] = dims[newC]; 
    126126    core.sizeT[series] = dims[newT]; 
    127     core.currentOrder[series] = order; 
     127    //core.currentOrder[series] = order; 
     128    inputOrder = order; 
    128129 
    129130    if (oldC != newC) { 
     
    148149   */ 
    149150  public void setOutputOrder(String outputOrder) { 
    150     this.outputOrder = outputOrder; 
     151    //this.outputOrder = outputOrder; 
     152    if (inputOrder == null) inputOrder = getDimensionOrder(); 
     153    getCoreMetadata().currentOrder[getSeries()] = outputOrder; 
    151154  } 
    152155 
    153156  public String getOutputOrder() { 
    154     return outputOrder; 
     157    return getDimensionOrder(); 
    155158  } 
    156159 
     
    245248  } 
    246249 
    247   /* @see loci.formats.IFormatReader#getIndex(int, int, int) */ 
    248   public int getIndex(int z, int c, int t) { 
    249     if (outputOrder == null) return super.getIndex(z, c, t); 
    250     FormatTools.assertId(getCurrentFile(), true, 2); 
    251     int zSize = getSizeZ(); 
    252     int cSize = getEffectiveSizeC(); 
    253     int tSize = getSizeT(); 
    254     int num = getImageCount(); 
    255     return FormatTools.getIndex(outputOrder, 
    256       zSize, cSize, tSize, num, z, c, t); 
    257   } 
    258  
    259   /* @see loci.formats.IFormatReader#getZCTCoords(int) */ 
    260   public int[] getZCTCoords(int index) { 
    261     if (outputOrder == null) return super.getZCTCoords(index); 
    262     FormatTools.assertId(getCurrentFile(), true, 2); 
    263     int zSize = reader.getSizeZ(); 
    264     int cSize = reader.getEffectiveSizeC(); 
    265     int tSize = reader.getSizeT(); 
    266     int num = reader.getImageCount(); 
    267     return FormatTools.getZCTCoords(outputOrder, 
    268       zSize, cSize, tSize, num, index); 
    269   } 
    270  
    271250  // -- Helper methods -- 
    272251 
    273252  protected int reorder(int no) throws FormatException { 
    274     if (outputOrder == null) return no; 
    275     return FormatTools.getReorderedIndex(reader, outputOrder, no); 
     253    if (inputOrder == null) return no; 
     254    return FormatTools.getReorderedIndex(inputOrder, getDimensionOrder(), 
     255      getSizeZ(), getSizeC(), getSizeT(), getImageCount(), no); 
    276256  } 
    277257 
Note: See TracChangeset for help on using the changeset viewer.