Changeset 5081 for trunk/utils


Ignore:
Timestamp:
05/06/09 08:02:00 (11 years ago)
Author:
melissa
Message:

Fixed how ConvertToOmeTiff handles multi-series files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/utils/ConvertToOmeTiff.java

    r5074 r5081  
    3737 
    3838      // write out image planes 
    39       int totalImages = reader.getImageCount()*reader.getSeriesCount(); 
    40       for (int j=0; j<totalImages; j++) { 
    41         BufferedImage plane = reader.openImage(j); 
    42         // write plane to output file 
    43         writer.saveImage(plane, j == totalImages - 1); 
    44         System.out.print("."); 
     39      int seriesCount = reader.getSeriesCount(); 
     40      for (int series=0; series<seriesCount; series++) { 
     41        reader.setSeries(series); 
     42        int imageCount = reader.getImageCount(); 
     43        for (int image=0; image<imageCount; image++) { 
     44          BufferedImage plane = reader.openImage(image); 
     45          // write plane to output file 
     46          writer.saveImage(plane, series, image == imageCount - 1, 
     47            (image == imageCount - 1) && (series == seriesCount - 1)); 
     48          System.out.print("."); 
     49        } 
    4550      } 
    4651      writer.close(); 
Note: See TracChangeset for help on using the changeset viewer.