Changeset 6636


Ignore:
Timestamp:
07/02/10 14:48:59 (9 years ago)
Author:
bdezonia
Message:

added UINT16 support to all colorTests. added back all virtual modes to color tests. cleanup.

File:
1 edited

Legend:

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

    r6634 r6636  
    3939//   should be able to make colorTests() handle both ImagePluses and CompositeImages. Change lutTest() too. Then can get 
    4040//     rid of ImagePlusLutTest(). 
    41 //   the color test methods seem to fail for indexed data 
    42 //   the color test methods seem to fail for virtual=true 
     41//   the color test methods seem to fail for indexed data (my issue - need to fix indexValuesTest for special cases) 
     42//     the special case is 1/1/indexed w/lutLen=3. 2/3's of values are all 0. This is correct behavior. 
     43//   the color test methods seem to fail for virtual=true (no longer seems to be case - something Curtis fixed?) 
    4344//   datasetSwapDims has ugly workaround to handle bad signed data / virtual flag interaction. Need BF fix. 
    4445//   many test methods are only UINT8 
     
    5657//    with I guess. 
    5758 
    58 // seem broken but don't know status from Curtis 
     59// (OLD) seem broken but don't know status from Curtis 
    5960//   colorized: 1/1/indexed (all indices 0 for all images), 3/1/indexed (iIndex,cIndex) (although w/ falseColor its okay), 
    6061//     6/3/nonindexed (iIndex,cIndex), 12/3/nonindexed (iIndex,cIndex), 3/3/indexed (iIndex,cIndex) 
    6162//   record does not work 
    62  
    63 // testable code according to my notes 
    64 //   composite, gray, custom: working for 2<=sizeC<=7 nonindexed (only Composite is tested for this) 
    6563 
    6664// note 
     
    7068//     I'm only doing UINT8 for now this is not a problem. 
    7169 
    72 // waiting on BF implementations for 
     70// (OLD) waiting on BF implementations for 
    7371//   - indexed color support 
    7472 
     
    7977//      comboConcatSplit() - done and passing 
    8078//      comboManyOptions - done and passing 
    81 //      other combo tests - rely on color code working. Waiting for BF. 
     79//      other combo tests - rely on color code working. Waiting for BF. (OLD) 
    8280 
    8381// would be nice to address before release 
     
    473471    int effC = sizeC; 
    474472     
    475     if (indexed) 
     473    if (indexed)  // this is from Melissa 
    476474    { 
    477475      if (falseColor) 
     
    808806           
    809807          // TODO - hack in place to clarify an underlying BF bug. Remove when bug fixed. Also remove virtual & pixType params. 
    810           if (virtual) 
     808          if (true)  // TODO - temp until I confirm with Curtis that he has fixed underlying BF bug. 
    811809          { 
    812810            actualZ = (int)(offset + tIndex(proc)); // Z<->T swapped 
     
    13531351  private void autoscaleTester(int pixType, boolean wantAutoscale) 
    13541352  { 
     1353    System.out.println("autoscaleTester() : pix "+FormatTools.getPixelTypeString(pixType)+" scale "+wantAutoscale); 
     1354 
     1355    if ((pixType == FormatTools.UINT8) && (wantAutoscale)) 
     1356      System.out.println("  broken case"); 
     1357     
    13551358    final int sizeZ = 2, sizeC = 3, sizeT = 4, sizeX = 51, sizeY = 16; 
    13561359    final String path = constructFakeFilename("autoscale",pixType, sizeX, sizeY, sizeZ, sizeC, sizeT, -1, false, -1, false, -1); 
     
    14401443                                    boolean falseColor, int numSeries, boolean wantLutDefined) 
    14411444  { 
    1442     System.out.println("colorDefaultTester(): pixType "+FormatTools.getPixelTypeString(pixType)+" indexed "+indexed+" channels "+channels+" chanPerPlane "+chanPerPlane+" falseColor "+falseColor+" numSeries "+numSeries); 
     1445    System.out.println("colorDefaultTester(): pixType "+FormatTools.getPixelTypeString(pixType)+" indexed "+indexed+" channels "+ 
     1446        channels+" chanPerPlane "+chanPerPlane+" falseColor "+falseColor+" numSeries "+numSeries+" defineLut "+wantLutDefined); 
    14431447     
    14441448    int sizeX = 55, sizeY = 71, sizeZ = 3, sizeT = 4; 
     
    14461450    // reportedly works in BF as long as numSeries*sizeC*3 <= 25 
    14471451     
    1448     String path = constructFakeFilename("colorComposite", pixType, sizeX, sizeY, sizeZ, channels, sizeT, numSeries, 
     1452    String path = constructFakeFilename("colorDefault", pixType, sizeX, sizeY, sizeZ, channels, sizeT, numSeries, 
    14491453        indexed, chanPerPlane, falseColor, -1); 
    14501454     
     
    14901494      Color[] colorOrder; 
    14911495      int expectedType; 
    1492       if (chanPerPlane > 1) 
     1496      if (chanPerPlane > 1)  // TODO : apparently need another test here for channelFiller.isFilled() case so 1/1/indexed works 
    14931497      { 
    14941498        expectedType = CompositeImage.COMPOSITE; 
    14951499        colorOrder = DEFAULT_COLOR_ORDER; 
    14961500      } 
    1497       else if (indexed && wantLutDefined)  
     1501      else if (indexed && wantLutDefined) 
    14981502      { 
    1499         // TODO - left working here. this case doesn't work yet. have to figure how BF calcs hasChannelLut so I can set it 
     1503        // TODO - left working here. this case doesn't work yet. 
     1504        //   have to figure how BF calcs hasChannelLut so I can exercise it here 
    15001505        expectedType = CompositeImage.COLOR; 
    15011506        colorOrder = new Color[]{Color.PINK,Color.WHITE,Color.WHITE,Color.WHITE,Color.WHITE,Color.WHITE,Color.WHITE,Color.WHITE}; 
     
    23322337 
    23332338  // TODO - enable virtual case 
    2334   // TODO - only testing UINT8 
    23352339  @Test 
    23362340  public void testColorDefault() 
    23372341  { 
    2338     for (boolean virtual : new boolean[]{false}) { // TODO : broekn for virtual - reenable 
    2339       for (boolean defineLutEntry : BOOLEAN_STATES) { 
     2342    for (int pixType : new int[]{FormatTools.UINT8, FormatTools.UINT16}) { 
     2343      for (boolean virtual : new boolean[]{false,true}) { 
     2344        for (boolean defineLutEntry : BOOLEAN_STATES) { 
    23402345      // these here to simplify debugging 
    23412346   
    2342         // edge cases in number of channels nonindexed in one series 
    2343         colorDefaultTester(virtual,FormatTools.UINT8,NOT_INDEXED,1,1,REAL_COLOR,ONE_SERIES,defineLutEntry); 
    2344         colorDefaultTester(virtual,FormatTools.UINT8,NOT_INDEXED,2,2,REAL_COLOR,ONE_SERIES,defineLutEntry); 
    2345         colorDefaultTester(virtual,FormatTools.UINT8,NOT_INDEXED,7,7,REAL_COLOR,ONE_SERIES,defineLutEntry); 
    2346         colorDefaultTester(virtual,FormatTools.UINT8,NOT_INDEXED,8,8,REAL_COLOR,ONE_SERIES,defineLutEntry); 
    2347      
    2348         // edge cases in number of channels nonindexed in one series 
    2349         colorDefaultTester(virtual,FormatTools.UINT8,NOT_INDEXED,4,4,REAL_COLOR,ONE_SERIES,defineLutEntry); 
    2350         colorDefaultTester(virtual,FormatTools.UINT8,NOT_INDEXED,6,3,REAL_COLOR,ONE_SERIES,defineLutEntry); 
    2351         colorDefaultTester(virtual,FormatTools.UINT8,NOT_INDEXED,12,3,REAL_COLOR,ONE_SERIES,defineLutEntry); 
    2352      
    2353         // edge case : standard 3 chan planar layout 
    2354         colorDefaultTester(virtual,FormatTools.UINT8,NOT_INDEXED,3,1,REAL_COLOR,ONE_SERIES,defineLutEntry); 
    2355      
    2356         // edge case 1 channel indexed 
    2357         // TODO - this one fails. Actual czt vals back from code are all zeroes 2/3 of the time (1 chan goes to 3) 
    2358         //colorDefaultTester(virtual,FormatTools.UINT8,INDEXED,1,1,REAL_COLOR,ONE_SERIES,defineLutEntry); 
     2347          // edge cases in number of channels nonindexed in one series 
     2348          colorDefaultTester(virtual,pixType,NOT_INDEXED,1,1,REAL_COLOR,ONE_SERIES,defineLutEntry); 
     2349          colorDefaultTester(virtual,pixType,NOT_INDEXED,2,2,REAL_COLOR,ONE_SERIES,defineLutEntry); 
     2350          colorDefaultTester(virtual,pixType,NOT_INDEXED,7,7,REAL_COLOR,ONE_SERIES,defineLutEntry); 
     2351          colorDefaultTester(virtual,pixType,NOT_INDEXED,8,8,REAL_COLOR,ONE_SERIES,defineLutEntry); 
     2352       
     2353          // edge cases in number of channels nonindexed in one series 
     2354          colorDefaultTester(virtual,pixType,NOT_INDEXED,4,4,REAL_COLOR,ONE_SERIES,defineLutEntry); 
     2355          colorDefaultTester(virtual,pixType,NOT_INDEXED,6,3,REAL_COLOR,ONE_SERIES,defineLutEntry); 
     2356          colorDefaultTester(virtual,pixType,NOT_INDEXED,12,3,REAL_COLOR,ONE_SERIES,defineLutEntry); 
     2357       
     2358          // edge case : standard 3 chan planar layout 
     2359          colorDefaultTester(virtual,pixType,NOT_INDEXED,3,1,REAL_COLOR,ONE_SERIES,defineLutEntry); 
     2360       
     2361          // edge case 1 channel indexed 
     2362          // TODO - this one fails UINT8 before I used general pixTypes. With gen pix types indexed does not make sense. 
     2363          //colorDefaultTester(virtual,FormatTools.UINT8,INDEXED,1,1,REAL_COLOR,ONE_SERIES,defineLutEntry); 
     2364        } 
    23592365      } 
    23602366    } 
     
    23622368   
    23632369  // TODO - enable virtual case 
    2364   // TODO - only testing UINT8 
    23652370  @Test 
    23662371  public void testColorComposite() 
    23672372  { 
    2368     for (boolean virtual : new boolean[]{false}) {  // TODO : fails when virtual is true for numChannels < 2 or > 7 
     2373    for (boolean virtual : new boolean[]{false,true}) { 
    23692374       
    23702375      // these here to simplify debugging 
     
    24302435   
    24312436  // TODO - enable virtual case 
    2432   // TODO - only testing UINT8 
    24332437  @Test 
    24342438  public void testColorColorized() 
    24352439  { 
    2436     for (boolean virtual : new boolean[]{false}) { // TODO : broekn for virtual - reenable 
    2437       // these here to simplify debugging 
    2438    
    2439       // edge cases in number of channels nonindexed in one series 
    2440       colorColorizedTester(virtual,FormatTools.UINT8,NOT_INDEXED,1,1,REAL_COLOR,ONE_SERIES); 
    2441       colorColorizedTester(virtual,FormatTools.UINT8,NOT_INDEXED,2,2,REAL_COLOR,ONE_SERIES); 
    2442       colorColorizedTester(virtual,FormatTools.UINT8,NOT_INDEXED,7,7,REAL_COLOR,ONE_SERIES); 
    2443       colorColorizedTester(virtual,FormatTools.UINT8,NOT_INDEXED,8,8,REAL_COLOR,ONE_SERIES); 
    2444    
    2445       // edge cases in number of channels nonindexed in one series 
    2446       colorColorizedTester(virtual,FormatTools.UINT8,NOT_INDEXED,4,4,REAL_COLOR,ONE_SERIES); 
    2447       colorColorizedTester(virtual,FormatTools.UINT8,NOT_INDEXED,6,3,REAL_COLOR,ONE_SERIES); 
    2448       colorColorizedTester(virtual,FormatTools.UINT8,NOT_INDEXED,12,3,REAL_COLOR,ONE_SERIES); 
    2449    
    2450       // edge case : standard 3 chan planar layout 
    2451       colorColorizedTester(virtual,FormatTools.UINT8,NOT_INDEXED,3,1,REAL_COLOR,ONE_SERIES); 
    2452    
    2453       // edge case 1 channel indexed 
    2454       // TODO - this one fails. Actual czt vals back from code are all zeroes 2/3 of the time (1 chan goes to 3) 
    2455       //colorColorizedTester(FormatTools.UINT8,INDEXED,1,1,REAL_COLOR,ONE_SERIES); 
     2440    for (int pixType : new int[]{FormatTools.UINT8, FormatTools.UINT16}) { 
     2441      for (boolean virtual : new boolean[]{false,true}) { 
     2442        // these here to simplify debugging 
     2443     
     2444        // edge cases in number of channels nonindexed in one series 
     2445        colorColorizedTester(virtual,pixType,NOT_INDEXED,1,1,REAL_COLOR,ONE_SERIES); 
     2446        colorColorizedTester(virtual,pixType,NOT_INDEXED,2,2,REAL_COLOR,ONE_SERIES); 
     2447        colorColorizedTester(virtual,pixType,NOT_INDEXED,7,7,REAL_COLOR,ONE_SERIES); 
     2448        colorColorizedTester(virtual,pixType,NOT_INDEXED,8,8,REAL_COLOR,ONE_SERIES); 
     2449     
     2450        // edge cases in number of channels nonindexed in one series 
     2451        colorColorizedTester(virtual,pixType,NOT_INDEXED,4,4,REAL_COLOR,ONE_SERIES); 
     2452        colorColorizedTester(virtual,pixType,NOT_INDEXED,6,3,REAL_COLOR,ONE_SERIES); 
     2453        colorColorizedTester(virtual,pixType,NOT_INDEXED,12,3,REAL_COLOR,ONE_SERIES); 
     2454     
     2455        // edge case : standard 3 chan planar layout 
     2456        colorColorizedTester(virtual,pixType,NOT_INDEXED,3,1,REAL_COLOR,ONE_SERIES); 
     2457     
     2458        // edge case 1 channel indexed 
     2459        // TODO - this one fails UINT8 before I used general pixTypes. With gen pix types indexed does not make sense. 
     2460        //colorColorizedTester(virtual,FormatTools.UINT8,INDEXED,1,1,REAL_COLOR,ONE_SERIES); 
     2461      } 
    24562462    } 
    24572463  } 
    24582464   
    24592465  // TODO - enable virtual case 
    2460   // TODO - only testing UINT8 
    24612466  @Test 
    24622467  public void testColorGrayscale() 
    24632468  { 
    2464     for (boolean virtual : new boolean[]{false}) { // TODO : broekn for virtual - reenable 
    2465       // these here to simplify debugging 
    2466    
    2467       // edge cases in number of channels nonindexed in one series 
    2468       colorGrayscaleTester(virtual,FormatTools.UINT8,NOT_INDEXED,1,1,REAL_COLOR,ONE_SERIES); 
    2469       colorGrayscaleTester(virtual,FormatTools.UINT8,NOT_INDEXED,2,2,REAL_COLOR,ONE_SERIES); 
    2470       colorGrayscaleTester(virtual,FormatTools.UINT8,NOT_INDEXED,7,7,REAL_COLOR,ONE_SERIES); 
    2471       colorGrayscaleTester(virtual,FormatTools.UINT8,NOT_INDEXED,8,8,REAL_COLOR,ONE_SERIES); 
    2472    
    2473       // edge cases in number of channels nonindexed in one series 
    2474       colorGrayscaleTester(virtual,FormatTools.UINT8,NOT_INDEXED,4,4,REAL_COLOR,ONE_SERIES); 
    2475       colorGrayscaleTester(virtual,FormatTools.UINT8,NOT_INDEXED,6,3,REAL_COLOR,ONE_SERIES); 
    2476       colorGrayscaleTester(virtual,FormatTools.UINT8,NOT_INDEXED,12,3,REAL_COLOR,ONE_SERIES); 
    2477    
    2478       // edge case : standard 3 chan planar layout 
    2479       colorGrayscaleTester(virtual,FormatTools.UINT8,NOT_INDEXED,3,1,REAL_COLOR,ONE_SERIES); 
    2480    
    2481       // edge case 1 channel indexed 
    2482       // TODO - this one fails. Actual czt vals back from code are all zeroes 2/3 of the time (1 chan goes to 3) 
    2483       //colorGrayscaleTester(FormatTools.UINT8,INDEXED,1,1,REAL_COLOR,ONE_SERIES); 
     2469    for (int pixType : new int[]{FormatTools.UINT8, FormatTools.UINT16}) { 
     2470      for (boolean virtual : new boolean[]{false,true}) { 
     2471        // these here to simplify debugging 
     2472     
     2473        // edge cases in number of channels nonindexed in one series 
     2474        colorGrayscaleTester(virtual,pixType,NOT_INDEXED,1,1,REAL_COLOR,ONE_SERIES); 
     2475        colorGrayscaleTester(virtual,pixType,NOT_INDEXED,2,2,REAL_COLOR,ONE_SERIES); 
     2476        colorGrayscaleTester(virtual,pixType,NOT_INDEXED,7,7,REAL_COLOR,ONE_SERIES); 
     2477        colorGrayscaleTester(virtual,pixType,NOT_INDEXED,8,8,REAL_COLOR,ONE_SERIES); 
     2478     
     2479        // edge cases in number of channels nonindexed in one series 
     2480        colorGrayscaleTester(virtual,pixType,NOT_INDEXED,4,4,REAL_COLOR,ONE_SERIES); 
     2481        colorGrayscaleTester(virtual,pixType,NOT_INDEXED,6,3,REAL_COLOR,ONE_SERIES); 
     2482        colorGrayscaleTester(virtual,pixType,NOT_INDEXED,12,3,REAL_COLOR,ONE_SERIES); 
     2483     
     2484        // edge case : standard 3 chan planar layout 
     2485        colorGrayscaleTester(virtual,pixType,NOT_INDEXED,3,1,REAL_COLOR,ONE_SERIES); 
     2486     
     2487        // edge case 1 channel indexed 
     2488        // TODO - this one fails UINT8 before I used general pixTypes. With gen pix types indexed does not make sense. 
     2489        //colorGrayscaleTester(FormatTools.UINT8,INDEXED,1,1,REAL_COLOR,ONE_SERIES); 
     2490      } 
    24842491    } 
    24852492  } 
    24862493   
    24872494  // TODO - enable virtual case 
    2488   // TODO - only testing UINT8 
    24892495  @Test 
    24902496  public void testColorCustom() 
    24912497  { 
    2492     for (boolean virtual : new boolean[]{false}) { // TODO : broekn for virtual - reenable 
    2493       // these here to simplify debugging 
    2494    
    2495       // edge cases in number of channels nonindexed in one series 
    2496       colorCustomTester(virtual,FormatTools.UINT8,NOT_INDEXED,1,1,REAL_COLOR,ONE_SERIES); 
    2497       colorCustomTester(virtual,FormatTools.UINT8,NOT_INDEXED,2,2,REAL_COLOR,ONE_SERIES); 
    2498       colorCustomTester(virtual,FormatTools.UINT8,NOT_INDEXED,7,7,REAL_COLOR,ONE_SERIES); 
    2499       colorCustomTester(virtual,FormatTools.UINT8,NOT_INDEXED,8,8,REAL_COLOR,ONE_SERIES); 
    2500    
    2501       // edge cases in number of channels nonindexed in one series 
    2502       colorCustomTester(virtual,FormatTools.UINT8,NOT_INDEXED,4,4,REAL_COLOR,ONE_SERIES); 
    2503       colorCustomTester(virtual,FormatTools.UINT8,NOT_INDEXED,6,3,REAL_COLOR,ONE_SERIES); 
    2504       colorCustomTester(virtual,FormatTools.UINT8,NOT_INDEXED,12,3,REAL_COLOR,ONE_SERIES); 
    2505    
    2506       // edge case : standard 3 chan planar layout 
    2507       colorCustomTester(virtual,FormatTools.UINT8,NOT_INDEXED,3,1,REAL_COLOR,ONE_SERIES); 
    2508    
    2509       // edge case 1 channel indexed 
    2510       // TODO - this one fails. Actual czt vals back from code are all zeroes 2/3 of the time (1 chan goes to 3) 
    2511       //colorCustomTester(FormatTools.UINT8,INDEXED,1,1,REAL_COLOR,ONE_SERIES); 
     2498    for (int pixType : new int[]{FormatTools.UINT8, FormatTools.UINT16}) { 
     2499      for (boolean virtual : new boolean[]{false,true}) { 
     2500        // these here to simplify debugging 
     2501     
     2502        // edge cases in number of channels nonindexed in one series 
     2503        colorCustomTester(virtual,pixType,NOT_INDEXED,1,1,REAL_COLOR,ONE_SERIES); 
     2504        colorCustomTester(virtual,pixType,NOT_INDEXED,2,2,REAL_COLOR,ONE_SERIES); 
     2505        colorCustomTester(virtual,pixType,NOT_INDEXED,7,7,REAL_COLOR,ONE_SERIES); 
     2506        colorCustomTester(virtual,pixType,NOT_INDEXED,8,8,REAL_COLOR,ONE_SERIES); 
     2507     
     2508        // edge cases in number of channels nonindexed in one series 
     2509        colorCustomTester(virtual,pixType,NOT_INDEXED,4,4,REAL_COLOR,ONE_SERIES); 
     2510        colorCustomTester(virtual,pixType,NOT_INDEXED,6,3,REAL_COLOR,ONE_SERIES); 
     2511        colorCustomTester(virtual,pixType,NOT_INDEXED,12,3,REAL_COLOR,ONE_SERIES); 
     2512     
     2513        // edge case : standard 3 chan planar layout 
     2514        colorCustomTester(virtual,pixType,NOT_INDEXED,3,1,REAL_COLOR,ONE_SERIES); 
     2515     
     2516        // edge case 1 channel indexed 
     2517        // TODO - this one fails UINT8 before I used general pixTypes. With gen pix types indexed does not make sense. 
     2518        //colorCustomTester(FormatTools.UINT8,INDEXED,1,1,REAL_COLOR,ONE_SERIES); 
     2519      } 
    25122520    } 
    25132521 
Note: See TracChangeset for help on using the changeset viewer.