Changeset 3869


Ignore:
Timestamp:
04/02/08 13:23:57 (12 years ago)
Author:
melissa
Message:

Parse series names.

File:
1 edited

Legend:

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

    r3865 r3869  
    296296      pixelBytes += ((Long) pixelLengths.get(i)).longValue(); 
    297297    } 
     298 
     299    String[] imageNames = new String[core.sizeX.length]; 
     300    int nextName = 0; 
    298301 
    299302    // try to find the width and height 
     
    367370      } 
    368371      else if (n == 'h') hCount++; 
     372      else if (n == 'j') { 
     373        // this block should contain an image name 
     374        in.skipBytes(4); 
     375        in.order(!core.littleEndian[0]); 
     376        int length = in.readShort(); 
     377        in.order(core.littleEndian[0]); 
     378        in.skipBytes(3); 
     379        // read image name, removing all non-whitespace and 
     380        // non-alphanumeric characters 
     381        imageNames[nextName++] = 
     382          in.readString(length).replaceAll("[\\W&&[\\S]]", ""); 
     383      } 
    369384    } 
    370385 
     
    388403 
    389404    for (int i=0; i<core.sizeX.length; i++) { 
    390       store.setImageName("Series " + i, i); 
     405      store.setImageName(imageNames[i], i); 
    391406      store.setImageCreationDate( 
    392407        DataTools.convertDate(System.currentTimeMillis(), DataTools.UNIX), i); 
Note: See TracChangeset for help on using the changeset viewer.