Changeset 2698


Ignore:
Timestamp:
04/27/07 13:09:03 (13 years ago)
Author:
curtis
Message:

Fix bugs in file stitcher.

File:
1 edited

Legend:

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

    r2695 r2698  
    3131 
    3232/** 
    33  * Logic to stitch together files with similar names. Stitches based on the 
    34  * first series for each file, and assumes that all files have the same 
    35  * dimensions. 
     33 * Logic to stitch together files with similar names. 
     34 * Assumes that all files have the same dimensions. 
    3635 */ 
    3736public class FileStitcher implements IFormatReader { 
     
    325324  public boolean isOrderCertain() { 
    326325    FormatTools.assertId(currentId, true, 2);  
    327     return ag[getSeries()].isCertain(); 
     326    return core.orderCertain[getSeries()]; 
    328327  } 
    329328 
     
    345344    int[] q = computeIndices(no); 
    346345    int fno = q[0], ino = q[1]; 
    347     readers[fno].setId(files[fno]); 
    348346    if (ino < readers[fno].getImageCount()) { 
    349347      return readers[fno].openImage(ino); 
     
    364362    int[] q = computeIndices(no); 
    365363    int fno = q[0], ino = q[1]; 
    366     readers[fno].setId(files[fno]); 
    367364    if (ino < readers[fno].getImageCount()) { 
    368365      return readers[fno].openBytes(ino); 
     
    386383    int[] q = computeIndices(no); 
    387384    int fno = q[0], ino = q[1]; 
    388     readers[fno].setId(files[fno]); 
    389385    return readers[fno].openBytes(ino, buf); 
    390386  } 
     
    397393    int[] q = computeIndices(no); 
    398394    int fno = q[0], ino = q[1]; 
    399     readers[fno].setId(files[fno]); 
    400395    if (ino < readers[fno].getImageCount()) { 
    401396      return readers[fno].openThumbImage(ino); 
     
    416411    int[] q = computeIndices(no); 
    417412    int fno = q[0], ino = q[1]; 
    418     readers[fno].setId(files[fno]); 
    419413    if (ino < readers[fno].getImageCount()) { 
    420414      return readers[fno].openThumbBytes(ino); 
     
    739733 
    740734    reader.setId(files[0]); 
    741     core = reader.getCoreMetadata(); 
    742735 
    743736    int seriesCount = reader.getSeriesCount(); 
     
    757750 
    758751    // analyze first file; assume each file has the same parameters 
     752    core = new CoreMetadata(seriesCount); 
    759753    int oldSeries = reader.getSeries(); 
    760754    for (int i=0; i<seriesCount; i++) { 
     
    762756      core.sizeX[i] = reader.getSizeX(); 
    763757      core.sizeY[i] = reader.getSizeY(); 
     758      // NB: core.sizeZ populated in computeAxisLengths below 
     759      // NB: core.sizeC populated in computeAxisLengths below 
     760      // NB: core.sizeT populated in computeAxisLengths below 
     761      core.pixelType[i] = reader.getPixelType(); 
    764762      imagesPerFile[i] = reader.getImageCount(); 
    765763      core.imageCount[i] = files.length * imagesPerFile[i]; 
     764      core.thumbSizeX[i] = reader.getThumbSizeX(); 
     765      core.thumbSizeY[i] = reader.getThumbSizeY(); 
     766      core.cLengths[i] = reader.getChannelDimLengths(); 
     767      core.cTypes[i] = reader.getChannelDimTypes(); 
    766768      core.currentOrder[i] = reader.getDimensionOrder(); 
     769      // NB: core.orderCertain[i] populated below 
     770      core.rgb[i] = reader.isRGB(); 
     771      core.littleEndian[i] = reader.isLittleEndian(); 
     772      core.interleaved[i] = reader.isInterleaved(); 
     773      core.seriesMetadata[i] = reader.getMetadata(); 
    767774      sizeZ[i] = reader.getSizeZ(); 
    768775      sizeC[i] = reader.getSizeC(); 
     
    782789      setSeries(i); 
    783790      core.currentOrder[i] = ag[i].getAdjustedOrder(); 
     791      core.orderCertain[i] = ag[getSeries()].isCertain(); 
    784792    } 
    785793    setSeries(oldSeries); 
     
    871879      } 
    872880    } 
     881 
    873882    int fno = FormatTools.positionToRaster(count, pos); 
    874     int ino = FormatTools.getIndex(core.currentOrder[sno], sizeZ[sno], 
    875       reader.getEffectiveSizeC(), sizeT[sno], imagesPerFile[sno], 
    876       posZ[0], posC[0], posT[0]); 
    877883 
    878884    // configure the reader, in case we haven't done this one yet 
    879885    readers[fno].setId(files[fno]); 
    880886    readers[fno].setSeries(reader.getSeries()); 
     887 
     888    int ino = FormatTools.getIndex(readers[fno], posZ[0], posC[0], posT[0]); 
    881889 
    882890    return new int[] {fno, ino}; 
Note: See TracChangeset for help on using the changeset viewer.