Changeset 3484


Ignore:
Timestamp:
12/17/07 15:59:34 (12 years ago)
Author:
melissa
Message:

Differentiate between series in files and series outside of files.

File:
1 edited

Legend:

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

    r3465 r3484  
    100100  private Vector fileVector; 
    101101  private Vector seriesNames; 
     102  private boolean seriesInFile; 
    102103 
    103104  // -- Constructors -- 
     
    373374    FormatTools.assertId(currentId, true, 2); 
    374375    int[] q = computeIndices(no); 
    375     int sno = getSeries(); 
     376    int sno = seriesInFile ? 0 : getSeries(); 
    376377    int fno = q[0], ino = q[1]; 
     378    if (seriesInFile) readers[sno][fno].setSeries(getSeries()); 
    377379    if (ino < readers[sno][fno].getImageCount()) { 
    378380      return readers[sno][fno].openImage(ino); 
    379381    } 
     382 
     383    sno = getSeries(); 
    380384 
    381385    // return a blank image to cover for the fact that 
     
    400404    FormatTools.assertId(currentId, true, 2); 
    401405    int[] q = computeIndices(no); 
    402     int sno = getSeries(); 
     406    int sno = seriesInFile ? 0 : getSeries(); 
    403407    int fno = q[0], ino = q[1]; 
     408    if (seriesInFile) readers[sno][fno].setSeries(getSeries()); 
    404409    if (ino < readers[sno][fno].getImageCount()) { 
    405410      return readers[sno][fno].openBytes(ino); 
    406411    } 
     412 
     413    sno = getSeries(); 
    407414 
    408415    // return a blank image to cover for the fact that 
     
    431438    FormatTools.assertId(currentId, true, 2); 
    432439    int[] q = computeIndices(no); 
    433     int sno = getSeries(); 
     440    int sno = seriesInFile ? 0 : getSeries(); 
    434441    int fno = q[0], ino = q[1]; 
     442    if (seriesInFile) readers[sno][fno].setSeries(getSeries()); 
    435443    if (ino < readers[sno][fno].getImageCount()) { 
    436444      return readers[sno][fno].openBytes(ino, buf); 
     
    479487    FormatTools.assertId(currentId, true, 2); 
    480488    int[] q = computeIndices(no); 
    481     int sno = getSeries(); 
     489    int sno = seriesInFile ? 0 : getSeries(); 
    482490    int fno = q[0], ino = q[1]; 
     491    if (seriesInFile) readers[sno][fno].setSeries(getSeries()); 
    483492    if (ino < readers[sno][fno].getImageCount()) { 
    484493      return readers[sno][fno].openThumbImage(ino); 
    485494    } 
     495 
     496    sno = getSeries(); 
    486497 
    487498    // return a blank image to cover for the fact that 
     
    498509    FormatTools.assertId(currentId, true, 2); 
    499510    int[] q = computeIndices(no); 
    500     int sno = getSeries(); 
     511    int sno = seriesInFile ? 0 : getSeries(); 
    501512    int fno = q[0], ino = q[1]; 
     513    if (seriesInFile) readers[sno][fno].setSeries(getSeries()); 
    502514    if (ino < readers[sno][fno].getImageCount()) { 
    503515      return readers[sno][fno].openThumbBytes(ino); 
    504516    } 
     517 
     518    sno = getSeries(); 
    505519 
    506520    // return a blank image to cover for the fact that 
     
    565579  public int getSeries() { 
    566580    FormatTools.assertId(currentId, true, 2); 
    567     return series == 0 ? reader.getSeries() : series; 
     581    return seriesInFile ? reader.getSeries() : series; 
    568582  } 
    569583 
     
    849863 
    850864    int seriesCount = reader.getSeriesCount(); 
    851     boolean seriesInFile = true; 
     865    seriesInFile = true; 
    852866    if (guesser.getAxisCountS() > 0) { 
    853867      int[] count = fp.getCount(); 
     
    10271041      core.pixelType[i] = rr.getPixelType(); 
    10281042      imagesPerFile[i] = rr.getImageCount(); 
    1029       core.imageCount[i] = files[i].length * imagesPerFile[i]; 
     1043      core.imageCount[i] = 
     1044        imagesPerFile[i] * files[seriesInFile ? 0 : i].length; 
    10301045      core.thumbSizeX[i] = rr.getThumbSizeX(); 
    10311046      core.thumbSizeY[i] = rr.getThumbSizeY(); 
     
    10681083  /** Computes axis length arrays, and total axis lengths. */ 
    10691084  protected void computeAxisLengths() throws FormatException { 
    1070     int sno = getSeries(); 
     1085    int sno = seriesInFile ? 0 : getSeries(); 
    10711086 
    10721087    FilePattern p = new FilePattern(FilePattern.findPattern(files[sno][0], 
     
    10781093    try { 
    10791094      readers[sno][0].setId(files[sno][0]); 
     1095      readers[sno][0].setSeries(seriesInFile ? getSeries() : 0); 
    10801096    } 
    10811097    catch (IOException e) { 
     
    10831099    } 
    10841100 
    1085     ag[sno] = new AxisGuesser(p, readers[sno][0].getDimensionOrder(), 
     1101    ag[getSeries()] = new AxisGuesser(p, readers[sno][0].getDimensionOrder(), 
    10861102      readers[sno][0].getSizeZ(), readers[sno][0].getSizeT(), 
    10871103      readers[sno][0].getSizeC(), readers[sno][0].isOrderCertain()); 
     1104    sno = getSeries(); 
    10881105    int[] axes = ag[sno].getAxisTypes(); 
    10891106    int numZ = ag[sno].getAxisCountZ(); 
     
    11991216    int fno = FormatTools.positionToRaster(count, pos); 
    12001217 
     1218    if (seriesInFile) sno = 0; 
     1219 
    12011220    // configure the reader, in case we haven't done this one yet 
    12021221    readers[sno][fno].setId(files[sno][fno]); 
Note: See TracChangeset for help on using the changeset viewer.