Changeset 5750


Ignore:
Timestamp:
12/18/09 08:51:48 (10 years ago)
Author:
melissa
Message:

Be more aggressive about looking for TIFF files, and throw a better exception if they are not found. Closes #444.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/components/bio-formats/src/loci/formats/in/MicromanagerReader.java

    r5624 r5750  
    391391    } 
    392392 
     393    if (tiffs.size() == 0) { 
     394      Vector<String> uniqueZ = new Vector<String>(); 
     395      Vector<String> uniqueC = new Vector<String>(); 
     396      Vector<String> uniqueT = new Vector<String>(); 
     397 
     398      Location dir = new Location(currentId).getAbsoluteFile().getParentFile(); 
     399      String[] files = dir.list(true); 
     400      Arrays.sort(files); 
     401      for (String f : files) { 
     402        if (checkSuffix(f, "tif") || checkSuffix(f, "tiff")) { 
     403          blocks = f.split("_"); 
     404          if (!uniqueT.contains(blocks[1])) uniqueT.add(blocks[1]); 
     405          if (!uniqueC.contains(blocks[2])) uniqueC.add(blocks[2]); 
     406          if (!uniqueZ.contains(blocks[3])) uniqueZ.add(blocks[3]); 
     407 
     408          tiffs.add(new Location(dir, f).getAbsolutePath()); 
     409        } 
     410      } 
     411 
     412      core[0].sizeZ = uniqueZ.size(); 
     413      core[0].sizeC = uniqueC.size(); 
     414      core[0].sizeT = uniqueT.size(); 
     415 
     416      if (tiffs.size() == 0) { 
     417        throw new FormatException("Could not find TIFF files."); 
     418      } 
     419    } 
     420 
    393421    tiffReader.setId(tiffs.get(0)); 
    394422 
Note: See TracChangeset for help on using the changeset viewer.