Changeset 1752


Ignore:
Timestamp:
11/06/06 14:17:19 (13 years ago)
Author:
curtis
Message:

Fix bugs in axis guesser.

File:
1 edited

Legend:

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

    r1751 r1752  
    6464 
    6565  protected static final BigInteger TWO = new BigInteger("2"); 
    66   protected static final BigInteger THREE = new BigInteger("2"); 
     66  protected static final BigInteger THREE = new BigInteger("3"); 
    6767 
    6868  // -- Fields -- 
     
    115115 
    116116    for (int i=0; i<axes.length; i++) { 
    117       String p = prefixes[i]; 
     117      String p = prefixes[i].toLowerCase(); 
    118118 
    119119      // strip trailing digits and divider characters 
    120       char[] c = p.toCharArray(); 
    121       int l = c.length - 1; 
    122       while (l >= 0 && (c[l] >= '0' && c[l] <= '9' || 
    123         c[l] == ' ' || c[l] == '-' || c[l] == '_' || c[l] == '.')) 
     120      char[] ch = p.toCharArray(); 
     121      int l = ch.length - 1; 
     122      while (l >= 0 && (ch[l] >= '0' && ch[l] <= '9' || 
     123        ch[l] == ' ' || ch[l] == '-' || ch[l] == '_' || ch[l] == '.')) 
    124124      { 
    125125        l--; 
     
    128128      // useful prefix segment consists of trailing alphanumeric characters 
    129129      int f = l; 
    130       while (f >= 0 && 
    131         (c[f] >= 'A' && c[f] <= 'Z' || c[f] >= 'a' && c[f] <= 'z')) 
    132       { 
    133         f--; 
    134       } 
     130      while (f >= 0 && ch[f] >= 'a' && ch[f] <= 'z') f--; 
    135131      p = p.substring(f + 1, l + 1); 
    136  
    137       boolean isZ = false, isT = false, isC = false; 
    138132 
    139133      // check against known Z prefixes 
     
    186180        int indexZ = newOrder.indexOf('Z'); 
    187181        int indexT = newOrder.indexOf('T'); 
    188         char[] c = newOrder.toCharArray(); 
    189         c[indexZ] = 'T'; 
    190         c[indexT] = 'Z'; 
    191         newOrder = new String(c); 
    192         int s = sizeT; 
     182        char[] ch = newOrder.toCharArray(); 
     183        ch[indexZ] = 'T'; 
     184        ch[indexT] = 'Z'; 
     185        newOrder = new String(ch); 
     186        int sz = sizeT; 
    193187        sizeT = sizeZ; 
    194         sizeZ = s; 
     188        sizeZ = sz; 
    195189      } 
    196190    } 
Note: See TracChangeset for help on using the changeset viewer.