Changeset 6456


Ignore:
Timestamp:
06/03/10 10:40:13 (10 years ago)
Author:
bdezonia
Message:

testComboManyOptions() - added verification of crop size

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/components/loci-plugins/test/loci/plugins/in/ImporterTest.java

    r6455 r6456  
    19261926  { 
    19271927    int pixType = FormatTools.UINT16, sizeX = 106, sizeY = 33, sizeZ = 3, sizeC = 5, sizeT = 7; 
    1928     int cropOriginX = 0, cropOriginY = 0, cropSizeX = 55, cropSizeY = 16, stepBy = 2; 
     1928    int cropOriginX = 0, cropOriginY = 0, cropSizeX = 55, cropSizeY = 16, start = 1, stepBy = 2; 
    19291929    ChannelOrder swappedOrder = ChannelOrder.CTZ;  // orig is ZCT : this is a deadly swap of all dims 
    19301930 
     1931    // note - to reuse existing code it is necessary that the crop origin is (0,0) 
     1932     
    19311933    String path = constructFakeFilename("superCombo", pixType, sizeX, sizeY, sizeZ, sizeC, sizeT, 1, false, -1, false); 
    19321934   
     
    19401942      options.setCropRegion(0, new Region(cropOriginX,cropOriginY,cropSizeX,cropSizeY)); 
    19411943      options.setTStep(0, stepBy); 
    1942       options.setTBegin(0, 1); 
     1944      options.setTBegin(0, start); 
    19431945      options.setSplitFocalPlanes(true); 
    19441946      imps = BF.openImagePlus(options); 
     
    19571959      ImagePlus imp = imps[zIndex]; 
    19581960       
    1959       int numC = numInSeries(1,sizeC-1,stepBy); 
     1961      int numC = numInSeries(start,sizeC-1,stepBy); 
    19601962 
    19611963      xyzctTest(imp,cropSizeX,cropSizeY,1,sizeZ,numC); // all dims changed 
     
    19651967       
    19661968      int p = 1; 
    1967       for (int tIndex = 1; tIndex < sizeC; tIndex += stepBy) 
     1969      for (int tIndex = start; tIndex < sizeC; tIndex += stepBy) 
    19681970        for (int cIndex = 0; cIndex < sizeZ; cIndex++) 
    19691971        { 
    19701972          ImageProcessor proc = st.getProcessor(p++); 
     1973           
     1974          assertEquals(cropSizeX,proc.getWidth()); 
     1975          assertEquals(cropSizeY,proc.getHeight()); 
     1976 
    19711977          final int actualZ = tIndex(proc); 
    19721978          final int actualC = zIndex(proc); 
    19731979          final int actualT = cIndex(proc); 
     1980           
    19741981          assertEquals(zIndex, actualZ); 
    19751982          assertEquals(cIndex, actualC); 
Note: See TracChangeset for help on using the changeset viewer.