Changeset 4280


Ignore:
Timestamp:
08/04/08 10:28:09 (12 years ago)
Author:
melissa
Message:

Corrected file index calculation when dimensions have been swapped.

File:
1 edited

Legend:

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

    r4268 r4280  
    113113 
    114114  private MetadataStore store; 
     115  private String[] originalOrder; 
    115116 
    116117  // -- Constructors -- 
     
    10631064    } 
    10641065    setSeries(oldSeries); 
     1066    originalOrder = new String[seriesCount]; 
     1067    System.arraycopy(core.currentOrder, 0, originalOrder, 0, seriesCount); 
    10651068  } 
    10661069 
     
    11831186    int[] posT = FormatTools.rasterToPosition(lenT[sno], zct[2]); 
    11841187 
     1188    int[] tmpZ = new int[posZ.length]; 
     1189    System.arraycopy(posZ, 0, tmpZ, 0, tmpZ.length); 
     1190    int[] tmpC = new int[posC.length]; 
     1191    System.arraycopy(posC, 0, tmpC, 0, tmpC.length); 
     1192    int[] tmpT = new int[posT.length]; 
     1193    System.arraycopy(posT, 0, tmpT, 0, tmpT.length); 
     1194 
     1195    for (int i=0; i<3; i++) { 
     1196      char originalAxis = originalOrder[sno].charAt(i + 2); 
     1197      char newAxis = getDimensionOrder().charAt(i + 2); 
     1198 
     1199      if (newAxis != originalAxis) { 
     1200        int src = -1; 
     1201        if (originalAxis == 'Z') src = tmpZ[tmpZ.length - 1]; 
     1202        else if (originalAxis == 'C') src = tmpC[tmpC.length - 1]; 
     1203        else if (originalAxis == 'T') src = tmpT[tmpT.length - 1]; 
     1204 
     1205        if (newAxis == 'Z') posZ[posZ.length - 1] = src; 
     1206        else if (newAxis == 'C') posC[posC.length - 1] = src; 
     1207        else if (newAxis == 'T') posT[posT.length - 1] = src; 
     1208      } 
     1209    } 
     1210 
    11851211    // convert Z, C and T position lists into file index and image index 
    11861212    int[] pos = new int[axes.length]; 
Note: See TracChangeset for help on using the changeset viewer.