Changeset 6587


Ignore:
Timestamp:
06/29/10 09:36:04 (9 years ago)
Author:
bdezonia
Message:

modified comboConcatSplit methods to work with BF's latest changes

File:
1 edited

Legend:

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

    r6579 r6587  
    3737 
    3838// left off 
    39 //   comboConcatSplit bugs: IJ reorders dims cuz stacksize does not match ZxCxT. Waiting for Curtis to implement default 
    40 //     concat axis choice behavior and then fix those tests. 
    41 //   expand testing to use virtual stacks everywhere if possible 
     39//   comboConcatSplit bugs: IJ reorders dims cuz stacksize does not match ZxCxT. Curtis implemented default behavior: 
     40//     if 2 dims match concat on third. if all three compat then concat along T (then Z then C). Fix tests to reflect 
     41//      this behavior. 
     42//   expand testing to use virtual stacks everywhere - partially done 
    4243//   expand compositeTestSubcases() to handle more pixTypes and indexed data 
    4344//   finish the colorize tests 
     
    869870    { 
    870871      ImagePlus imp = imps[z]; 
    871       xyzctTest(imp,sizeX,sizeY,1,sizeC,sizeT); 
     872      xyzctTest(imp,sizeX,sizeY,1,sizeC,sizeT*numSeries); 
    872873      stackTest(imp,numSeries*sizeC*sizeT); 
    873874      ImageStack st = imp.getStack(); 
     
    878879            //System.out.println("index "+index); 
    879880            ImageProcessor proc = st.getProcessor(++slice); 
     881            //printVals(proc); 
    880882            //System.out.println("s z c t "+s+" "+z+" "+c+" "+t); 
    881883            //System.out.println("z c t "+z+" "+c+" "+t); 
     
    899901    { 
    900902      ImagePlus imp = imps[c]; 
    901       xyzctTest(imp,sizeX,sizeY,sizeZ,1,sizeT); 
     903      xyzctTest(imp,sizeX,sizeY,sizeZ,1,sizeT*numSeries); 
    902904      stackTest(imp,numSeries*sizeZ*sizeT); 
    903905      ImageStack st = imp.getStack(); 
     
    921923  } 
    922924   
     925  // this one will be different from the previous two as we concat along T by default for FakeFiles as all dims compat. 
     926  //   Then we're splitting on T. Logic will need to be different from others. 
    923927  /** tests that a set of images is ordered via T first - used by concatSplit tests */ 
    924928  private void imageSeriesInTczOrderTest(ImagePlus[] imps, int numSeries, int sizeX, int sizeY, int sizeZ, int sizeC, int sizeT) 
    925929  { 
    926     System.out.println("imageSeriesInTczOrderTest(z="+sizeZ+" c="+sizeC+" t="+sizeT+" s="+numSeries+")"); 
    927     // from CZT order: T pulled out, CZ in order 
    928     for (int t = 0; t < sizeT; t++) 
     930    int imageNum = 0; 
     931    for (int s = 0; s < numSeries; s++) 
    929932    { 
    930       ImagePlus imp = imps[t]; 
    931       xyzctTest(imp,sizeX,sizeY,sizeZ,sizeC,1); 
    932       stackTest(imp,numSeries*sizeZ*sizeC); 
    933       ImageStack st = imp.getStack(); 
    934       for (int s = 0; s < numSeries; s++) { 
    935         int slice = s*sizeZ*sizeC; 
     933      // from CZT order: T pulled out, CZ in order 
     934      for (int t = 0; t < sizeT; t++) 
     935      { 
     936        ImagePlus imp = imps[imageNum++]; 
     937        xyzctTest(imp,sizeX,sizeY,sizeZ,sizeC,1); 
     938        stackTest(imp,sizeZ*sizeC); 
     939        ImageStack st = imp.getStack(); 
     940        int slice = 0; 
    936941        for (int z = 0; z < sizeZ; z++) { 
    937942          for (int c = 0; c < sizeC; c++) { 
    938943            ImageProcessor proc = st.getProcessor(++slice); 
     944            printVals(proc); 
    939945            //System.out.println("index "+index); 
    940946            //System.out.println("s z c t "+s+" "+z+" "+c+" "+t); 
     
    11271133   
    11281134  /** tests BF's options.setOpenAllSeries() and options.setConcatenate() */ 
    1129   private void datasetConcatenateTester(boolean virtual,int pixType, int x, int y, int z, int c, int t, int s) 
     1135  private void datasetConcatenateTester(int pixType, int x, int y, int z, int c, int t, int s) 
    11301136  { 
    11311137    assertTrue(s >= 1);  // necessary for this test 
     
    11391145    try { 
    11401146      ImporterOptions options = new ImporterOptions(); 
    1141       options.setVirtual(virtual); 
     1147      //options.setVirtual(virtual);  // NOTE - do not allow this combo 
    11421148      options.setId(path); 
    11431149      options.setOpenAllSeries(true); 
     
    16581664    // run split and concat at same time 
    16591665 
    1660     //TODO - restore - final int sizeX = 50, sizeY = 20, sizeZ = 5, sizeC = 3, sizeT = 7, series = 4; 
    1661     final int sizeX = 50, sizeY = 20, sizeZ = 1, sizeC = 1, sizeT = 1, series = 2; 
     1666    final int sizeX = 50, sizeY = 20, sizeZ = 3, sizeC = 5, sizeT = 7, series = 4; 
    16621667     
    16631668    final String path = constructFakeFilename("concatSplitZ", 
     
    16941699    // run split and concat at same time 
    16951700 
    1696     // TODO - restore -  final int sizeX = 50, sizeY = 20, sizeZ = 5, sizeC = 3, sizeT = 7, series = 4; 
    1697     final int sizeX = 50, sizeY = 20, sizeZ = 1, sizeC = 1, sizeT = 1, series = 2; 
     1701    final int sizeX = 50, sizeY = 20, sizeZ = 3, sizeC = 5, sizeT = 7, series = 4; 
    16981702     
    16991703    final String path = constructFakeFilename("concatSplitC", 
     
    17301734    // run split and concat at same time 
    17311735 
    1732     // TODO - restore - final int sizeX = 50, sizeY = 20, sizeZ = 5, sizeC = 3, sizeT = 7, series = 4; 
    1733     final int sizeX = 50, sizeY = 20, sizeZ = 1, sizeC = 1, sizeT = 1, series = 2; 
     1736    final int sizeX = 50, sizeY = 20, sizeZ = 3, sizeC = 5, sizeT = 7, numSeries = 4; 
    17341737   
    17351738    final String path = constructFakeFilename("concatSplitT", 
    1736       FormatTools.UINT8, sizeX, sizeY, sizeZ, sizeC, sizeT, series, false, -1, false, -1); 
     1739      FormatTools.UINT8, sizeX, sizeY, sizeZ, sizeC, sizeT, numSeries, false, -1, false, -1); 
    17371740 
    17381741    // open image 
     
    17541757    } 
    17551758     
    1756     // one image per time point 
    1757     impsCountTest(imps,sizeT); 
    1758      
    1759     imageSeriesInTczOrderTest(imps,series,sizeX,sizeY,sizeZ,sizeC,sizeT); 
     1759    // numSeries images per timepoint 
     1760    impsCountTest(imps,sizeT*numSeries); 
     1761     
     1762    imageSeriesInTczOrderTest(imps,numSeries,sizeX,sizeY,sizeZ,sizeC,sizeT); 
    17601763  } 
    17611764   
     
    19431946  public void testDatasetConcatenate() 
    19441947  { 
    1945     for (boolean virtual : BooleanStates) 
    1946     { 
    1947       // open a dataset that has multiple series and should get back a single series 
    1948       datasetConcatenateTester(virtual,FormatTools.UINT8, 82, 47, 1, 1, 1, 1); 
    1949       datasetConcatenateTester(virtual,FormatTools.UINT8, 82, 47, 1, 1, 1, 17); 
    1950       datasetConcatenateTester(virtual,FormatTools.UINT8, 82, 47, 4, 5, 2, 9); 
    1951     } 
     1948    // NOTE: for now we will not use a virtual boolean with datasetConcatenateTester() as that combo not a legal one in BF 
     1949     
     1950    // open a dataset that has multiple series and should get back a single series 
     1951    datasetConcatenateTester(FormatTools.UINT8, 82, 47, 1, 1, 1, 1); 
     1952    datasetConcatenateTester(FormatTools.UINT8, 82, 47, 1, 1, 1, 17); 
     1953    datasetConcatenateTester(FormatTools.UINT8, 82, 47, 4, 5, 2, 9); 
    19521954  } 
    19531955 
Note: See TracChangeset for help on using the changeset viewer.