Changeset 6802


Ignore:
Timestamp:
08/17/10 12:09:01 (9 years ago)
Author:
melissa
Message:
  • Ignore missing L2D scans, instead of throwing an exception.
  • More thorough type detection for Li-Cor TIFFs.
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.2/components/bio-formats/src/loci/formats/in/L2DReader.java

    r6663 r6802  
    8383    if (list == null) return false; 
    8484 
     85    boolean hasScan = false, hasRootFile = false; 
     86 
    8587    for (String file : list) { 
    86       if (checkSuffix(file, "scn")) return true; 
    87     } 
    88     return false; 
     88      if (checkSuffix(file, "scn")) { 
     89        hasScan = true; 
     90        break; 
     91      } 
     92    } 
     93 
     94    parent = parent.getParentFile(); 
     95    if (parent == null) return false; 
     96    list = parent.list(); 
     97    if (list == null) return false; 
     98 
     99    for (String file : list) { 
     100      if (checkSuffix(file, "l2d")) { 
     101        hasRootFile = true; 
     102        break; 
     103      } 
     104    } 
     105 
     106    return hasScan && hasRootFile; 
    89107  } 
    90108 
     
    181199 
    182200    String[] scans = getScanNames(); 
     201    Location parent = new Location(id).getAbsoluteFile().getParentFile(); 
     202 
     203    // remove scan names that do not correspond to existing directories 
     204 
     205    Vector<String> validScans = new Vector<String>(); 
     206    for (String s : scans) { 
     207      Location scanDir = new Location(parent, s); 
     208      if (scanDir.exists() && scanDir.isDirectory()) validScans.add(s); 
     209    } 
     210    scans = validScans.toArray(new String[validScans.size()]); 
    183211 
    184212    // read metadata from each scan 
     
    194222    String model = null; 
    195223 
    196     Location parent = new Location(id).getAbsoluteFile().getParentFile(); 
    197224    for (int i=0; i<scans.length; i++) { 
    198225      setSeries(i); 
  • trunk/components/bio-formats/src/loci/formats/in/L2DReader.java

    r6655 r6802  
    8383    if (list == null) return false; 
    8484 
     85    boolean hasScan = false, hasRootFile = false; 
     86 
    8587    for (String file : list) { 
    86       if (checkSuffix(file, "scn")) return true; 
    87     } 
    88     return false; 
     88      if (checkSuffix(file, "scn")) { 
     89        hasScan = true; 
     90        break; 
     91      } 
     92    } 
     93 
     94    parent = parent.getParentFile(); 
     95    if (parent == null) return false; 
     96    list = parent.list(); 
     97    if (list == null) return false; 
     98 
     99    for (String file : list) { 
     100      if (checkSuffix(file, "l2d")) { 
     101        hasRootFile = true; 
     102        break; 
     103      } 
     104    } 
     105 
     106    return hasScan && hasRootFile; 
    89107  } 
    90108 
     
    181199 
    182200    String[] scans = getScanNames(); 
     201    Location parent = new Location(id).getAbsoluteFile().getParentFile(); 
     202 
     203    // remove scan names that do not correspond to existing directories 
     204 
     205    Vector<String> validScans = new Vector<String>(); 
     206    for (String s : scans) { 
     207      Location scanDir = new Location(parent, s); 
     208      if (scanDir.exists() && scanDir.isDirectory()) validScans.add(s); 
     209    } 
     210    scans = validScans.toArray(new String[validScans.size()]); 
    183211 
    184212    // read metadata from each scan 
     
    194222    String model = null; 
    195223 
    196     Location parent = new Location(id).getAbsoluteFile().getParentFile(); 
    197224    for (int i=0; i<scans.length; i++) { 
    198225      setSeries(i); 
Note: See TracChangeset for help on using the changeset viewer.