Changeset 3967


Ignore:
Timestamp:
04/22/08 15:18:59 (12 years ago)
Author:
melissa
Message:
  • Fixed NPE
  • FileStitcher now swaps dimensions if a Z (or T) axis is found in the file pattern, but the number of Z (or T) planes within the file is greater than 1.
Location:
trunk/loci/formats
Files:
2 edited

Legend:

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

    r3889 r3967  
    4545 
    4646  /** FormatReader to use as a template for constituent readers. */ 
    47   private IFormatReader reader; 
     47  private DimensionSwapper reader; 
    4848 
    4949  /** 
     
    132132   */ 
    133133  public FileStitcher(IFormatReader r, boolean patternIds) { 
    134     reader = r; 
     134    if (r instanceof DimensionSwapper) reader = (DimensionSwapper) r; 
     135    else reader = new DimensionSwapper(r); 
    135136    this.patternIds = patternIds; 
    136137  } 
     
    910911    } 
    911912 
     913    // check if multiple Z or multiple T axes were found 
     914 
     915    if (!reader.isOrderCertain() && ((guesser.getAxisCountZ() > 0 && 
     916      reader.getSizeZ() > 1) || (guesser.getAxisCountT() > 0 && 
     917      reader.getSizeT() > 1))) 
     918    { 
     919      String order = reader.getDimensionOrder(); 
     920      order = order.replaceAll("Z", "p"); 
     921      order = order.replaceAll("T", "Z"); 
     922      order = order.replaceAll("p", "T"); 
     923      reader.swapDimensions(order); 
     924    } 
     925 
    912926    // verify that file pattern is valid and matches existing files 
    913927    String msg = " Please rename your files or disable file stitching."; 
  • trunk/loci/formats/OutputFilter.java

    r3841 r3967  
    2222 
    2323  public void print(String s) { 
    24     if (!s.trim().startsWith("WARN:")) { 
     24    if (s == null || !s.trim().startsWith("WARN:")) { 
    2525      super.print(s); 
    2626    } 
Note: See TracChangeset for help on using the changeset viewer.