Changeset 3076


Ignore:
Timestamp:
08/10/07 14:11:50 (12 years ago)
Author:
melissa
Message:

Fixed to work with omebf.

Location:
trunk/loci/formats/in
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/formats/in/MicromanagerReader.java

    r3060 r3076  
    6666  } 
    6767 
     68  /* @see loci.formats.IFormatReader#getUsedFiles() */ 
     69  public String[] getUsedFiles() { 
     70    FormatTools.assertId(currentId, true, 1); 
     71    String[] s = new String[tiffs.size() + 1]; 
     72    tiffs.copyInto(s); 
     73    s[tiffs.size()] = currentId; 
     74    return s; 
     75  } 
     76 
    6877  /* @see loci.formats.IFormatReader#openBytes(int) */ 
    6978  public byte[] openBytes(int no) throws FormatException, IOException { 
     
    110119  /* @see loci.formats.IFormatHandler#isThisType(String, boolean) */ 
    111120  public boolean isThisType(String name, boolean open) { 
    112     Location parent = new Location(name).getAbsoluteFile().getParentFile(); 
    113     String[] list = parent.list(); 
     121    File f = new File(name).getAbsoluteFile();  
     122    String[] list = null;  
     123    if (f.exists()) list = f.getParentFile().list(); 
     124    else list = (String[]) Location.getIdMap().keySet().toArray(new String[0]); 
     125 
    114126    if (list == null) return false; 
    115127    for (int i=0; i<list.length; i++) { 
     
    138150    // find metadata.txt 
    139151 
    140     Location parent = new Location(currentId).getAbsoluteFile().getParentFile(); 
    141     in = new RandomAccessStream(new Location(parent, 
    142       METADATA).getAbsolutePath()); 
     152    File file = new File(currentId).getAbsoluteFile(); 
     153    in = new RandomAccessStream(file.exists() ? new File(file.getParentFile(),  
     154      METADATA).getAbsolutePath() : METADATA); 
    143155 
    144156    // usually a small file, so we can afford to read it into memory 
  • trunk/loci/formats/in/VisitechReader.java

    r3060 r3076  
    112112    if (!id.toLowerCase().endsWith("html")) { 
    113113      Location file = new Location(id).getAbsoluteFile(); 
    114       String path = file.getPath(); 
     114      String path = file.exists() ? file.getPath() : id; 
    115115      int ndx = path.lastIndexOf(File.separator); 
    116116      String base = path.substring(ndx + 1, path.indexOf(" ", ndx)); 
    117117 
    118118      currentId = null; 
    119       initFile(new Location(file.getParent(), 
    120         base + " Report.html").getAbsolutePath()); 
     119      initFile(file.exists() ? new Location(file.getParent(),  
     120        base + " Report.html").getAbsolutePath() : base + " Report.html"); 
    121121      return; 
    122122    } 
     
    124124    // parse the HTML file 
    125125 
    126     /* debug */ System.out.println(id); 
    127126    in = new RandomAccessStream(id); 
    128127    String s = in.readString((int) in.length()); 
     
    189188    files = new Vector(); 
    190189 
    191     Location file = new Location(id).getAbsoluteFile(); 
    192     String path = file.getPath(); 
    193     int ndx = path.lastIndexOf(File.separator); 
    194     String base = path.substring(ndx + 1, path.indexOf(" ", ndx)); 
     190    int ndx = currentId.lastIndexOf(File.separator); 
     191    String base = currentId.substring(ndx + 1, currentId.indexOf(" ", ndx)); 
     192   
     193    File f = new File(currentId).getAbsoluteFile(); 
    195194 
    196195    for (int i=0; i<core.sizeC[0]; i++) { 
    197       files.add(new Location(file.getParent(), 
    198         base + " " + (i + 1) + ".xys").getAbsolutePath()); 
    199     } 
    200  
     196      files.add((f.exists() ? f.getParent() + File.separator : "") + base +  
     197        " " + (i + 1) + ".xys"); 
     198    } 
    201199    files.add(currentId); 
    202  
     200     
    203201    MetadataStore store = getMetadataStore(); 
    204202    store.setImage(currentId, null, null, null); 
Note: See TracChangeset for help on using the changeset viewer.