Ignore:
Timestamp:
05/18/10 13:07:47 (10 years ago)
Author:
melissa
Message:
  • Removed hopefully obsolete hack from RandomAccessInputStream.findString. See  omero:2374.
  • Adjusted ClassList.removeClass signature, so that reader classes can actually be removed.
  • Adjusted NRRDReader's delegation logic to be a little more straightforward.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/4.2/components/bio-formats/src/loci/formats/in/NRRDReader.java

    r6301 r6333  
    2424package loci.formats.in; 
    2525 
    26 import java.io.File; 
    2726import java.io.IOException; 
    28 import java.util.StringTokenizer; 
    2927 
    3028import loci.common.Location; 
    3129import loci.common.RandomAccessInputStream; 
     30import loci.formats.ClassList; 
    3231import loci.formats.FormatException; 
    3332import loci.formats.FormatReader; 
    3433import loci.formats.FormatTools; 
     34import loci.formats.IFormatReader; 
    3535import loci.formats.ImageReader; 
    3636import loci.formats.MetadataTools; 
     
    160160 
    161161    in = new RandomAccessInputStream(id); 
    162     helper = new ImageReader(); 
     162 
     163    ClassList<IFormatReader> classes = ImageReader.getDefaultReaderClasses(); 
     164    classes.removeClass(getClass()); 
     165    helper = new ImageReader(classes); 
    163166 
    164167    String key, v; 
     
    203206        } 
    204207        else if (key.equals("sizes")) { 
    205           StringTokenizer tokens = new StringTokenizer(v, " "); 
     208          String[] tokens = v.split(" "); 
    206209          for (int i=0; i<numDimensions; i++) { 
    207             String t = tokens.nextToken(); 
    208             int size = Integer.parseInt(t); 
     210            int size = Integer.parseInt(tokens[i]); 
    209211 
    210212            if (numDimensions >= 3 && i == 0 && size > 1 && size <= 4) { 
     
    253255        dataFile = new Location(parent, dataFile).getAbsolutePath(); 
    254256      } 
    255       // calling setId on dataFile will cause this reader to pick up 
    256       // the data file 
    257       String name = dataFile.substring(dataFile.lastIndexOf(File.separator)); 
    258       Location.mapId(name, dataFile); 
    259       helper.setId(name); 
     257      helper.setId(dataFile); 
    260258    } 
    261259 
Note: See TracChangeset for help on using the changeset viewer.