Changeset 3838


Ignore:
Timestamp:
03/19/08 14:54:17 (12 years ago)
Author:
curtis
Message:

Hack to prevent file pattern detection from depending on choice of base file.

File:
1 edited

Legend:

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

    r3466 r3838  
    447447    } 
    448448    sb.append(q > 0 ? name.substring(endList[q - 1]) : name); 
    449     return sb.toString(); 
     449    String pat = sb.toString(); 
     450 
     451    // NB: Due to variations in axis length, the file pattern detected can 
     452    // depend on the file name given as the basis of detection. 
     453    // 
     454    // To work around this problem, we redetect the pattern using the first 
     455    // file in the pattern if it differs from the current base file name. 
     456    // 
     457    // For details, see Trac ticket #19: 
     458    // https://skyking.microscopy.wisc.edu/trac/java/ticket/19 
     459    String first = pat.substring(dir.length()); 
     460    first = first.replaceAll("<([0-9]+)-[0-9]+(:[0-9]+)?>", "$1"); 
     461    if (!name.equals(first)) return findPattern(first, dir, nameList); 
     462 
     463    return pat; 
    450464  } 
    451465 
Note: See TracChangeset for help on using the changeset viewer.