Changeset 1422


Ignore:
Timestamp:
09/06/06 15:11:10 (14 years ago)
Author:
curtis
Message:

Add error checking for user-specified ranges; more accurate progress bar.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/plugins/LociImporter.java

    r1421 r1422  
    208208          step = (int) range.getNextNumber(); 
    209209        } 
     210        if (begin < 0) begin = 0; 
     211        if (begin >= num) begin = num - 1; 
     212        if (end < begin) end = begin; 
     213        if (end >= num) end = num - 1; 
     214        if (step < 1) step = 1; 
     215        int total = (end - begin) / step + 1; 
    210216 
    211217        // dump OME-XML to ImageJ's description field, if available 
     
    221227        int channels = r.getSizeC(id); 
    222228 
     229        int q = 0; 
    223230        for (int j=begin; j<=end; j+=step) { 
    224231          // limit message update rate 
     
    228235            time = clock; 
    229236          } 
    230           IJ.showProgress((double) j / num); 
     237          IJ.showProgress((double) q++ / total); 
    231238          BufferedImage img = r.openImage(id, j); 
    232239          img = ImageTools.padImage(img, r.getSizeX(id), r.getSizeY(id)); 
Note: See TracChangeset for help on using the changeset viewer.