Changeset 2255


Ignore:
Timestamp:
02/09/07 13:54:54 (13 years ago)
Author:
melissa
Message:
  • Fixed OIB axis size bug.
  • Fixed NPEs caused by FormatReader.getCurrentFile().
Location:
trunk/loci/formats
Files:
2 edited

Legend:

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

    r2212 r2255  
    417417  /* @see IFormatReader#getCurrentFile() */ 
    418418  public String getCurrentFile() { 
    419     return currentId; 
     419    return currentId == null ? "" : currentId; 
    420420  } 
    421421 
  • trunk/loci/formats/in/OIBReader.java

    r2219 r2255  
    335335      String[] labels = new String[9]; 
    336336      String[] dims = new String[9]; 
     337      String[] starts = new String[9]; 
     338      String[] stops = new String[9]; 
    337339 
    338340      for (int i=0; i<labels.length; i++) { 
    339         labels[i] = (String) 
    340           getMeta("[Axis " + i + " Parameters Common] - AxisCode"); 
    341         dims[i] = 
    342           (String) getMeta("[Axis " + i + " Parameters Common] - MaxSize"); 
     341        String pre = "[Axis " + i + " Parameters Common] - "; 
     342        labels[i] = (String) getMeta(pre + "AxisCode"); 
     343        dims[i] = (String) getMeta(pre + "MaxSize"); 
     344        starts[i] = (String) getMeta(pre + "StartPosition"); 
     345        stops[i] = (String) getMeta(pre + "EndPosition"); 
    343346        if (labels[i] == null) labels[i] = ""; 
    344347        if (dims[i] == null) dims[i] = "0"; 
     348        if (starts[i] == null) starts[i] = "0"; 
     349        if (stops[i] == null) stops[i] = "0"; 
    345350      } 
    346351 
     
    348353        if (labels[i].equals("\"X\"") || labels[i].equals("\"Y\"")) { } 
    349354        else if (labels[i].equals("\"C\"")) { 
    350           nChannels.add(new Integer(dims[i])); 
     355          if (!starts[i].equals(stops[i])) nChannels.add(new Integer(dims[i])); 
     356          else nChannels.add(new Integer(1)); 
    351357        } 
    352358        else if (labels[i].equals("\"Z\"")) { 
    353           zSize.add(new Integer(dims[i])); 
     359          if (!starts[i].equals(stops[i])) zSize.add(new Integer(dims[i])); 
     360          else zSize.add(new Integer(1)); 
    354361        } 
    355362        else if (labels[i].equals("\"T\"")) { 
    356           tSize.add(new Integer(dims[i])); 
     363          if (!starts[i].equals(stops[i])) tSize.add(new Integer(dims[i])); 
     364          else tSize.add(new Integer(1)); 
    357365        } 
    358366        else if (!dims[i].equals("0")) { 
     
    402410 
    403411        int numImages = ((Integer) nImages.get(i)).intValue(); 
     412        
    404413        if (numImages > sizeZ[i] * sizeT[i] * sizeC[i]) { 
    405414          int diff = numImages - (sizeZ[i] * sizeT[i] * sizeC[i]); 
Note: See TracChangeset for help on using the changeset viewer.