Changeset 6634


Ignore:
Timestamp:
07/02/10 12:53:40 (9 years ago)
Author:
bdezonia
Message:

datasetGroupFiles() improved. Constants fixed for correct style.

File:
1 edited

Legend:

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

    r6633 r6634  
    9595  private enum ChannelOrder {ZCT, ZTC, CZT, CTZ, TZC, TCZ}; 
    9696   
    97   private static final boolean[] BooleanStates = new boolean[] {false, true}; 
    98    
    99   private static final int[] PixelTypes = new int[] { 
     97  private static final boolean[] BOOLEAN_STATES = new boolean[] {false, true}; 
     98   
     99  private static final int[] PIXEL_TYPES = new int[] { 
    100100      FormatTools.FLOAT, FormatTools.DOUBLE, 
    101101      FormatTools.UINT8, FormatTools.UINT16, FormatTools.UINT32, 
     
    103103      }; 
    104104   
    105   private static Color[] DefaultColorOrder = 
     105  private static Color[] DEFAULT_COLOR_ORDER = 
    106106    new Color[] {Color.RED, Color.GREEN, Color.BLUE, Color.WHITE, Color.CYAN, Color.MAGENTA, Color.YELLOW}; 
    107107   
    108   private static Color[] CustomColorOrder = 
     108  private static Color[] CUSTOM_COLOR_ORDER = 
    109109    new Color[] {Color.BLUE, Color.RED, Color.GREEN, Color.MAGENTA, Color.YELLOW, Color.CYAN, Color.WHITE}; 
    110110 
    111   private static final boolean NotIndexed = false; 
    112   private static final boolean Indexed = true; 
    113  
    114   private static final boolean FalseColor = true; 
    115   private static final boolean RealColor = false; 
    116    
    117   private static final int OneSeries = 1; 
     111  private static final boolean NOT_INDEXED = false; 
     112  private static final boolean INDEXED = true; 
     113 
     114  private static final boolean FALSE_COLOR = true; 
     115  private static final boolean REAL_COLOR = false; 
     116   
     117  private static final int ONE_SERIES = 1; 
    118118 
    119119  private static final String[] FAKE_FILES; 
    120120  private static final String FAKE_PATTERN; 
    121121 
    122   private static final int FakePlaneCount = 7; 
    123   private static final int FakeChannelCount = 3; 
    124   private static final int FakeTimepointCount = 5; 
     122  private static final int FAKE_PLANE_COUNT = 7; 
     123  private static final int FAKE_CHANNEL_COUNT = 3; 
     124  private static final int FAKE_TIMEPOINT_COUNT = 5; 
     125  private static final int FAKE_SIZE_X = 50; 
     126  private static final int FAKE_SIZE_Y = 50; 
    125127   
    126128  static { 
    127129 
    128130    //String template = "test_C%s_TP%s&sizeX=50&sizeY=20&sizeZ=7.fake"; 
    129     String template = constructFakeFilename("test_C%s_TP%s", FormatTools.UINT8, 50, 20, FakePlaneCount, 1, 1, -1, false, -1, false, -1); 
     131    String template = constructFakeFilename("test_C%s_TP%s", FormatTools.UINT8, FAKE_SIZE_X, FAKE_SIZE_Y, FAKE_PLANE_COUNT, 1, 1, 
     132                        -1, false, -1, false, -1); 
    130133     
    131134    FAKE_FILES = new String[] { 
     
    765768          //printVals(proc); 
    766769          assertEquals(0,sIndex(proc)); 
    767           assertEquals(z,iIndex(proc));  // TODO: is this correct? it passes but looks wrong. 
     770          assertEquals(z,iIndex(proc)); 
    768771          assertEquals(z,zIndex(proc)); 
    769772          assertEquals(0,cIndex(proc)); 
     
    11731176     
    11741177    impsCountTest(imps,1); 
    1175    
    1176     groupedFilesTest(imps[0], FakePlaneCount, FakeChannelCount, FakeTimepointCount); 
     1178     
     1179    xyzctTest(imps[0], FAKE_SIZE_X, FAKE_SIZE_Y, FAKE_PLANE_COUNT, FAKE_CHANNEL_COUNT, FAKE_TIMEPOINT_COUNT); 
     1180   
     1181    groupedFilesTest(imps[0], FAKE_PLANE_COUNT, FAKE_CHANNEL_COUNT, FAKE_TIMEPOINT_COUNT); 
    11771182  } 
    11781183   
     
    14881493      { 
    14891494        expectedType = CompositeImage.COMPOSITE; 
    1490         colorOrder = DefaultColorOrder; 
     1495        colorOrder = DEFAULT_COLOR_ORDER; 
    14911496      } 
    14921497      else if (indexed && wantLutDefined)  
     
    14991504      { 
    15001505        expectedType = CompositeImage.GRAYSCALE; 
    1501         colorOrder = DefaultColorOrder; 
     1506        colorOrder = DEFAULT_COLOR_ORDER; 
    15021507      } 
    15031508       
     
    15091514      assertFalse(imp.isComposite()); 
    15101515 
    1511       imagePlusLutTest(imp,indexed,falseColor,DefaultColorOrder[0]); 
     1516      imagePlusLutTest(imp,indexed,falseColor,DEFAULT_COLOR_ORDER[0]); 
    15121517    } 
    15131518     
     
    15691574      assertEquals(CompositeImage.COMPOSITE, ci.getMode()); 
    15701575       
    1571       colorTests(ci,expectedSizeC,DefaultColorOrder); 
     1576      colorTests(ci,expectedSizeC,DEFAULT_COLOR_ORDER); 
    15721577    } 
    15731578    else  // expectedSizeC < 2 or > 7 - we should have gotten back a regular ImagePlus 
     
    15751580      assertFalse(imp.isComposite()); 
    15761581 
    1577       imagePlusLutTest(imp,indexed,falseColor,DefaultColorOrder[0]); 
     1582      imagePlusLutTest(imp,indexed,falseColor,DEFAULT_COLOR_ORDER[0]); 
    15781583    } 
    15791584     
     
    15821587    // TODO : i've done no pixel testing 
    15831588  } 
    1584    
    1585   /* old code 
    1586   private void colorColorizedTester() 
    1587   { 
    1588     // TODO: temp first attempt: sizeC == 1 and rgb matches 
    1589      
    1590     int sizeX = 100, sizeY = 120, sizeZ = 1, sizeC = 1, sizeT = 1, rgb = 1; 
    1591     boolean indexed = true, falseColor = false; 
    1592      
    1593     String path = constructFakeFilename("colorColorized", FormatTools.UINT8, sizeX, sizeY, sizeZ, sizeC, sizeT, -1, indexed, rgb, false, -1); 
    1594      
    1595     ImagePlus[] imps = null; 
    1596      
    1597     try { 
    1598       ImporterOptions options = new ImporterOptions(); 
    1599       options.setColorMode(ImporterOptions.COLOR_MODE_COLORIZED); 
    1600       options.setId(path); 
    1601       imps = BF.openImagePlus(options); 
    1602     } 
    1603     catch (IOException e) { 
    1604       fail(e.getMessage()); 
    1605     } 
    1606     catch (FormatException e) { 
    1607       fail(e.getMessage()); 
    1608     } 
    1609  
    1610     impsCountTest(imps,1); 
    1611      
    1612     ImagePlus imp = imps[0]; 
    1613      
    1614     int lutLen = 3; 
    1615      
    1616     int expectedSizeC = effectiveC(sizeC, rgb, lutLen, indexed, falseColor); 
    1617  
    1618     xyzctTest(imp,sizeX,sizeY,sizeZ,expectedSizeC,sizeT); 
    1619      
    1620     assertTrue(imp.isComposite()); 
    1621      
    1622     CompositeImage ci = (CompositeImage)imp; 
    1623      
    1624     assertFalse(ci.hasCustomLuts()); 
    1625  
    1626     assertEquals(CompositeImage.COLOR, ci.getMode()); 
    1627      
    1628     colorTests(ci,expectedSizeC,DefaultColorOrder); 
    1629  
    1630     fail("unfinished"); 
    1631   } 
    1632    */ 
    1633  
    1634   // NOTE - just copied from colorCompositeTester() and just changed mode test. Need to deepen tests here. 
     1589 
    16351590  /** tests BF's options.setColorMode(colorized) */ 
    16361591  private void colorColorizedTester(boolean virtual, int pixType, boolean indexed, int channels, int chanPerPlane, 
     
    16811636      assertEquals(CompositeImage.COLOR, ci.getMode()); 
    16821637       
    1683       colorTests(ci,expectedSizeC,DefaultColorOrder); 
     1638      colorTests(ci,expectedSizeC,DEFAULT_COLOR_ORDER); 
    16841639    } 
    16851640    else  // expectedSizeC < 2 or > 7 - we should have gotten back a regular ImagePlus 
     
    16871642      assertFalse(imp.isComposite()); 
    16881643 
    1689       imagePlusLutTest(imp,indexed,falseColor,DefaultColorOrder[0]); 
     1644      imagePlusLutTest(imp,indexed,falseColor,DEFAULT_COLOR_ORDER[0]); 
    16901645    } 
    16911646     
     
    16951650  } 
    16961651 
    1697 /*  old way 
    1698   private void colorGrayscaleTester() 
    1699   { 
    1700     int sizeX = 100, sizeY = 120, sizeZ = 2, sizeC = 7, sizeT = 4; 
    1701      
    1702     String path = constructFakeFilename("colorGrayscale", FormatTools.UINT8, sizeX, sizeY, sizeZ, sizeC, sizeT, -1, false, -1, false, -1); 
    1703      
    1704     ImagePlus[] imps = null; 
    1705      
    1706     try { 
    1707       ImporterOptions options = new ImporterOptions(); 
    1708       options.setColorMode(ImporterOptions.COLOR_MODE_GRAYSCALE); 
    1709       options.setId(path); 
    1710       imps = BF.openImagePlus(options); 
    1711     } 
    1712     catch (IOException e) { 
    1713       fail(e.getMessage()); 
    1714     } 
    1715     catch (FormatException e) { 
    1716       fail(e.getMessage()); 
    1717     } 
    1718  
    1719     impsCountTest(imps,1); 
    1720      
    1721     ImagePlus imp = imps[0]; 
    1722      
    1723     xyzctTest(imp,sizeX,sizeY,sizeZ,sizeC,sizeT); 
    1724      
    1725     assertTrue(imp.isComposite()); 
    1726      
    1727     CompositeImage ci = (CompositeImage)imp; 
    1728      
    1729     assertFalse(ci.hasCustomLuts()); 
    1730  
    1731     assertEquals(CompositeImage.GRAYSCALE, ci.getMode()); 
    1732  
    1733     colorTests(ci,sizeC,DefaultColorOrder); 
    1734  
    1735     fail("unfinished"); 
    1736   } 
    1737 */   
    17381652  /** tests BF's options.setColorMode(gray) */ 
    17391653  private void colorGrayscaleTester(boolean virtual, int pixType, boolean indexed, int channels, int chanPerPlane, 
     
    17831697      assertEquals(CompositeImage.GRAYSCALE, ci.getMode()); 
    17841698   
    1785       colorTests(ci,expectedSizeC,DefaultColorOrder); 
     1699      colorTests(ci,expectedSizeC,DEFAULT_COLOR_ORDER); 
    17861700    } 
    17871701    else  // expectedSizeC < 2 or > 7 - we should have gotten back a regular ImagePlus 
     
    17891703      assertFalse(imp.isComposite()); 
    17901704   
    1791       imagePlusLutTest(imp,indexed,falseColor,DefaultColorOrder[0]); 
     1705      imagePlusLutTest(imp,indexed,falseColor,DEFAULT_COLOR_ORDER[0]); 
    17921706    } 
    17931707   
     
    17971711  } 
    17981712 
    1799   /* old way 
    1800   private void colorCustomTester(int pixType, int sizeX, int sizeY, int sizeZ, int sizeC, int sizeT, int numSeries) 
    1801   { 
    1802     // reportedly works in BF for 2<=sizeC<=7 and also numSeries*sizeC*3 <= 25 
    1803      
    1804     assertTrue(sizeC >= 2); 
    1805     assertTrue(sizeC <= 7); 
    1806     //assertTrue(numSeries*sizeC*3 <= 25);  // slider limit in IJ 
    1807      
    1808     String path = constructFakeFilename("colorCustom", pixType, sizeX, sizeY, sizeZ, sizeC, sizeT, numSeries, false, -1, false, -1); 
    1809      
    1810     ImagePlus[] imps = null; 
    1811      
    1812     try { 
    1813       ImporterOptions options = new ImporterOptions(); 
    1814       options.setColorMode(ImporterOptions.COLOR_MODE_CUSTOM); 
    1815       for (int s = 0; s < numSeries; s++) 
    1816         for (int c = 0; c < sizeC; c++) 
    1817           options.setCustomColor(s, c, CustomColorOrder[c]); 
    1818       options.setId(path); 
    1819       imps = BF.openImagePlus(options); 
    1820     } 
    1821     catch (IOException e) { 
    1822       fail(e.getMessage()); 
    1823     } 
    1824     catch (FormatException e) { 
    1825       fail(e.getMessage()); 
    1826     } 
    1827  
    1828     // TODO - notice numSeries passed in but never tested against 
    1829      
    1830     impsCountTest(imps,1); 
    1831      
    1832     ImagePlus imp = imps[0]; 
    1833      
    1834     xyzctTest(imp,sizeX,sizeY,sizeZ,sizeC,sizeT); 
    1835      
    1836     assertTrue(imp.isComposite()); 
    1837      
    1838     CompositeImage ci = (CompositeImage)imp; 
    1839      
    1840     assertFalse(ci.hasCustomLuts()); 
    1841  
    1842     assertEquals(CompositeImage.COLOR, ci.getMode()); 
    1843  
    1844     colorTests(ci,sizeC,CustomColorOrder); 
    1845   } 
    1846   */ 
    1847    
    18481713  /** tests BF's options.setColorMode(custom) */ 
    18491714  private void colorCustomTester(boolean virtual, int pixType, boolean indexed, int channels, int chanPerPlane, 
     
    18661731      for (int s = 0; s < numSeries; s++) 
    18671732        for (int c = 0; c < maxChannels; c++) 
    1868           options.setCustomColor(s, c, CustomColorOrder[c]); 
     1733          options.setCustomColor(s, c, CUSTOM_COLOR_ORDER[c]); 
    18691734      options.setId(path); 
    18701735      imps = BF.openImagePlus(options); 
     
    18971762      assertEquals(CompositeImage.COLOR, ci.getMode()); 
    18981763   
    1899       colorTests(ci,expectedSizeC,CustomColorOrder); 
     1764      colorTests(ci,expectedSizeC,CUSTOM_COLOR_ORDER); 
    19001765    } 
    19011766    else  // expectedSizeC < 2 or > 7 - we should have gotten back a regular ImagePlus 
     
    19031768      assertFalse(imp.isComposite()); 
    19041769   
    1905       imagePlusLutTest(imp,indexed,falseColor,CustomColorOrder[0]); 
     1770      imagePlusLutTest(imp,indexed,falseColor,CUSTOM_COLOR_ORDER[0]); 
    19061771    } 
    19071772   
     
    23802245    assertEquals(CompositeImage.COMPOSITE, ci.getMode()); 
    23812246     
    2382     colorTests(ci,sizeC,DefaultColorOrder); 
     2247    colorTests(ci,sizeC,DEFAULT_COLOR_ORDER); 
    23832248       
    23842249    stackInZctOrderTest(imp,sizeZ,sizeC,sizeT,indexed,falseColor); 
     
    24062271  { 
    24072272    for (ChannelOrder order : ChannelOrder.values()) 
    2408       for (boolean virtual : BooleanStates) 
     2273      for (boolean virtual : BOOLEAN_STATES) 
    24092274        outputStackOrderTester(virtual,FormatTools.UINT8, order,  82, 47, 2, 3, 4); 
    24102275  } 
     
    24132278  public void testDatasetGroupFiles() 
    24142279  { 
    2415     for (boolean virtual : BooleanStates) 
     2280    for (boolean virtual : BOOLEAN_STATES) 
    24162281      datasetGroupFilesTester(virtual); 
    24172282  } 
     
    24202285  public void testDatasetOpenFilesIndividually() 
    24212286  { 
    2422     for (boolean virtual : BooleanStates) 
     2287    for (boolean virtual : BOOLEAN_STATES) 
    24232288      datsetOpenFilesIndividuallyTester(virtual); 
    24242289  } 
     
    24302295    //   Note that testComboManyOptions() tests another swap order 
    24312296 
    2432     for (boolean virtual : BooleanStates) 
     2297    for (boolean virtual : BOOLEAN_STATES) 
    24332298    { 
    24342299      datasetSwapDimsTester(virtual,FormatTools.UINT8, 82, 47, 1, 3); 
     
    24472312  public void testDatasetOpenAllSeries() 
    24482313  { 
    2449     for (boolean virtual : BooleanStates) { 
    2450       for (boolean openAll : BooleanStates) { 
     2314    for (boolean virtual : BOOLEAN_STATES) { 
     2315      for (boolean openAll : BOOLEAN_STATES) { 
    24512316        datasetOpenAllSeriesTester(virtual,openAll); 
    24522317        datasetOpenAllSeriesTester(virtual,openAll); 
     
    24722337  { 
    24732338    for (boolean virtual : new boolean[]{false}) { // TODO : broekn for virtual - reenable 
    2474       for (boolean defineLutEntry : BooleanStates) { 
     2339      for (boolean defineLutEntry : BOOLEAN_STATES) { 
    24752340      // these here to simplify debugging 
    24762341   
    24772342        // edge cases in number of channels nonindexed in one series 
    2478         colorDefaultTester(virtual,FormatTools.UINT8,NotIndexed,1,1,RealColor,OneSeries,defineLutEntry); 
    2479         colorDefaultTester(virtual,FormatTools.UINT8,NotIndexed,2,2,RealColor,OneSeries,defineLutEntry); 
    2480         colorDefaultTester(virtual,FormatTools.UINT8,NotIndexed,7,7,RealColor,OneSeries,defineLutEntry); 
    2481         colorDefaultTester(virtual,FormatTools.UINT8,NotIndexed,8,8,RealColor,OneSeries,defineLutEntry); 
     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); 
    24822347     
    24832348        // edge cases in number of channels nonindexed in one series 
    2484         colorDefaultTester(virtual,FormatTools.UINT8,NotIndexed,4,4,RealColor,OneSeries,defineLutEntry); 
    2485         colorDefaultTester(virtual,FormatTools.UINT8,NotIndexed,6,3,RealColor,OneSeries,defineLutEntry); 
    2486         colorDefaultTester(virtual,FormatTools.UINT8,NotIndexed,12,3,RealColor,OneSeries,defineLutEntry); 
     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); 
    24872352     
    24882353        // edge case : standard 3 chan planar layout 
    2489         colorDefaultTester(virtual,FormatTools.UINT8,NotIndexed,3,1,RealColor,OneSeries,defineLutEntry); 
     2354        colorDefaultTester(virtual,FormatTools.UINT8,NOT_INDEXED,3,1,REAL_COLOR,ONE_SERIES,defineLutEntry); 
    24902355     
    24912356        // edge case 1 channel indexed 
    24922357        // TODO - this one fails. Actual czt vals back from code are all zeroes 2/3 of the time (1 chan goes to 3) 
    2493         //colorDefaultTester(virtual,FormatTools.UINT8,Indexed,1,1,RealColor,OneSeries,defineLutEntry); 
     2358        //colorDefaultTester(virtual,FormatTools.UINT8,INDEXED,1,1,REAL_COLOR,ONE_SERIES,defineLutEntry); 
    24942359      } 
    24952360    } 
     
    25072372      // edge cases in number of channels nonindexed in one series 
    25082373      // TODO : next one fails when virtual true 
    2509       colorCompositeTester(virtual,FormatTools.UINT8,NotIndexed,1,1,RealColor,OneSeries); 
    2510       colorCompositeTester(virtual,FormatTools.UINT8,NotIndexed,2,2,RealColor,OneSeries); 
    2511       colorCompositeTester(virtual,FormatTools.UINT8,NotIndexed,7,7,RealColor,OneSeries); 
     2374      colorCompositeTester(virtual,FormatTools.UINT8,NOT_INDEXED,1,1,REAL_COLOR,ONE_SERIES); 
     2375      colorCompositeTester(virtual,FormatTools.UINT8,NOT_INDEXED,2,2,REAL_COLOR,ONE_SERIES); 
     2376      colorCompositeTester(virtual,FormatTools.UINT8,NOT_INDEXED,7,7,REAL_COLOR,ONE_SERIES); 
    25122377      // TODO : next one fails when virtual true 
    2513       colorCompositeTester(virtual,FormatTools.UINT8,NotIndexed,8,8,RealColor,OneSeries); 
     2378      colorCompositeTester(virtual,FormatTools.UINT8,NOT_INDEXED,8,8,REAL_COLOR,ONE_SERIES); 
    25142379   
    25152380      // edge cases in number of channels nonindexed in one series 
    2516       colorCompositeTester(virtual,FormatTools.UINT8,NotIndexed,4,4,RealColor,OneSeries); 
    2517       colorCompositeTester(virtual,FormatTools.UINT8,NotIndexed,6,3,RealColor,OneSeries); 
     2381      colorCompositeTester(virtual,FormatTools.UINT8,NOT_INDEXED,4,4,REAL_COLOR,ONE_SERIES); 
     2382      colorCompositeTester(virtual,FormatTools.UINT8,NOT_INDEXED,6,3,REAL_COLOR,ONE_SERIES); 
    25182383      // TODO : next one fails when virtual true 
    2519       colorCompositeTester(virtual,FormatTools.UINT8,NotIndexed,12,3,RealColor,OneSeries); 
     2384      colorCompositeTester(virtual,FormatTools.UINT8,NOT_INDEXED,12,3,REAL_COLOR,ONE_SERIES); 
    25202385   
    25212386      // edge case : standard 3 chan planar layout 
    2522       colorCompositeTester(virtual,FormatTools.UINT8,NotIndexed,3,1,RealColor,OneSeries); 
     2387      colorCompositeTester(virtual,FormatTools.UINT8,NOT_INDEXED,3,1,REAL_COLOR,ONE_SERIES); 
    25232388   
    25242389      // edge case 1 channel indexed 
    25252390      // TODO - this one fails. Actual czt vals back from code are all zeroes 2/3 of the time (1 chan goes to 3) 
    2526       //colorCompositeTester(FormatTools.UINT8,Indexed,1,1,RealColor,OneSeries); 
     2391      //colorCompositeTester(FormatTools.UINT8,INDEXED,1,1,REAL_COLOR,ONE_SERIES); 
    25272392   
    25282393      // general test loop 
     
    25362401          for (int numSeries : series) { 
    25372402            for (int channelsPerPlane : channelsPerPlaneVals) { 
    2538               for (boolean indexed : new boolean[]{false}) {  // TODO - indexed not test right now : replace with BooleanStates 
    2539                 for (boolean falseColor : BooleanStates) { 
     2403              for (boolean indexed : new boolean[]{false}) {  // TODO - indexed not test right now : replace with BOOLEAN_STATES 
     2404                for (boolean falseColor : BOOLEAN_STATES) { 
    25402405   
    25412406                  //System.out.println(" format "+pixFormat+"indexed "+indexed+" rgb "+rgb+" fasleColor "+falseColor+" c "+c+" s "+s); 
     
    25732438   
    25742439      // edge cases in number of channels nonindexed in one series 
    2575       colorColorizedTester(virtual,FormatTools.UINT8,NotIndexed,1,1,RealColor,OneSeries); 
    2576       colorColorizedTester(virtual,FormatTools.UINT8,NotIndexed,2,2,RealColor,OneSeries); 
    2577       colorColorizedTester(virtual,FormatTools.UINT8,NotIndexed,7,7,RealColor,OneSeries); 
    2578       colorColorizedTester(virtual,FormatTools.UINT8,NotIndexed,8,8,RealColor,OneSeries); 
     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); 
    25792444   
    25802445      // edge cases in number of channels nonindexed in one series 
    2581       colorColorizedTester(virtual,FormatTools.UINT8,NotIndexed,4,4,RealColor,OneSeries); 
    2582       colorColorizedTester(virtual,FormatTools.UINT8,NotIndexed,6,3,RealColor,OneSeries); 
    2583       colorColorizedTester(virtual,FormatTools.UINT8,NotIndexed,12,3,RealColor,OneSeries); 
     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); 
    25842449   
    25852450      // edge case : standard 3 chan planar layout 
    2586       colorColorizedTester(virtual,FormatTools.UINT8,NotIndexed,3,1,RealColor,OneSeries); 
     2451      colorColorizedTester(virtual,FormatTools.UINT8,NOT_INDEXED,3,1,REAL_COLOR,ONE_SERIES); 
    25872452   
    25882453      // edge case 1 channel indexed 
    25892454      // TODO - this one fails. Actual czt vals back from code are all zeroes 2/3 of the time (1 chan goes to 3) 
    2590       //colorColorizedTester(FormatTools.UINT8,Indexed,1,1,RealColor,OneSeries); 
     2455      //colorColorizedTester(FormatTools.UINT8,INDEXED,1,1,REAL_COLOR,ONE_SERIES); 
    25912456    } 
    25922457  } 
     
    26012466   
    26022467      // edge cases in number of channels nonindexed in one series 
    2603       colorGrayscaleTester(virtual,FormatTools.UINT8,NotIndexed,1,1,RealColor,OneSeries); 
    2604       colorGrayscaleTester(virtual,FormatTools.UINT8,NotIndexed,2,2,RealColor,OneSeries); 
    2605       colorGrayscaleTester(virtual,FormatTools.UINT8,NotIndexed,7,7,RealColor,OneSeries); 
    2606       colorGrayscaleTester(virtual,FormatTools.UINT8,NotIndexed,8,8,RealColor,OneSeries); 
     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); 
    26072472   
    26082473      // edge cases in number of channels nonindexed in one series 
    2609       colorGrayscaleTester(virtual,FormatTools.UINT8,NotIndexed,4,4,RealColor,OneSeries); 
    2610       colorGrayscaleTester(virtual,FormatTools.UINT8,NotIndexed,6,3,RealColor,OneSeries); 
    2611       colorGrayscaleTester(virtual,FormatTools.UINT8,NotIndexed,12,3,RealColor,OneSeries); 
     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); 
    26122477   
    26132478      // edge case : standard 3 chan planar layout 
    2614       colorGrayscaleTester(virtual,FormatTools.UINT8,NotIndexed,3,1,RealColor,OneSeries); 
     2479      colorGrayscaleTester(virtual,FormatTools.UINT8,NOT_INDEXED,3,1,REAL_COLOR,ONE_SERIES); 
    26152480   
    26162481      // edge case 1 channel indexed 
    26172482      // TODO - this one fails. Actual czt vals back from code are all zeroes 2/3 of the time (1 chan goes to 3) 
    2618       //colorGrayscaleTester(FormatTools.UINT8,Indexed,1,1,RealColor,OneSeries); 
     2483      //colorGrayscaleTester(FormatTools.UINT8,INDEXED,1,1,REAL_COLOR,ONE_SERIES); 
    26192484    } 
    26202485  } 
     
    26292494   
    26302495      // edge cases in number of channels nonindexed in one series 
    2631       colorCustomTester(virtual,FormatTools.UINT8,NotIndexed,1,1,RealColor,OneSeries); 
    2632       colorCustomTester(virtual,FormatTools.UINT8,NotIndexed,2,2,RealColor,OneSeries); 
    2633       colorCustomTester(virtual,FormatTools.UINT8,NotIndexed,7,7,RealColor,OneSeries); 
    2634       colorCustomTester(virtual,FormatTools.UINT8,NotIndexed,8,8,RealColor,OneSeries); 
     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); 
    26352500   
    26362501      // edge cases in number of channels nonindexed in one series 
    2637       colorCustomTester(virtual,FormatTools.UINT8,NotIndexed,4,4,RealColor,OneSeries); 
    2638       colorCustomTester(virtual,FormatTools.UINT8,NotIndexed,6,3,RealColor,OneSeries); 
    2639       colorCustomTester(virtual,FormatTools.UINT8,NotIndexed,12,3,RealColor,OneSeries); 
     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); 
    26402505   
    26412506      // edge case : standard 3 chan planar layout 
    2642       colorCustomTester(virtual,FormatTools.UINT8,NotIndexed,3,1,RealColor,OneSeries); 
     2507      colorCustomTester(virtual,FormatTools.UINT8,NOT_INDEXED,3,1,REAL_COLOR,ONE_SERIES); 
    26432508   
    26442509      // edge case 1 channel indexed 
    26452510      // TODO - this one fails. Actual czt vals back from code are all zeroes 2/3 of the time (1 chan goes to 3) 
    2646       //colorCustomTester(FormatTools.UINT8,Indexed,1,1,RealColor,OneSeries); 
     2511      //colorCustomTester(FormatTools.UINT8,INDEXED,1,1,REAL_COLOR,ONE_SERIES); 
    26472512    } 
    26482513 
     
    26762541    // note - can't autoscale a virtualStack. No need to test it. 
    26772542     
    2678     for (int pixType : PixelTypes) { 
    2679       for (boolean autoscale : BooleanStates) { 
     2543    for (int pixType : PIXEL_TYPES) { 
     2544      for (boolean autoscale : BOOLEAN_STATES) { 
    26802545        //System.out.println("testColorAutoscale(): pixType = "+FormatTools.getPixelTypeString(pixType)+" autoscale = "+autoscale); 
    26812546        autoscaleTester(pixType,autoscale); 
     
    26872552  public void testMemoryVirtualStack() 
    26882553  { 
    2689     for (boolean virtual : BooleanStates) 
     2554    for (boolean virtual : BOOLEAN_STATES) 
    26902555      memoryVirtualStackTester(virtual); 
    26912556  } 
     
    26982563    // recordMemory has virtual always set to true. no need to do any other virtual testing 
    26992564     
    2700     for (boolean rememberChanges : BooleanStates) 
     2565    for (boolean rememberChanges : BOOLEAN_STATES) 
    27012566      memoryRecordModificationsTester(rememberChanges); 
    27022567  } 
     
    29362801     
    29372802    // try various pixTypes 
    2938     for (int pixType : PixelTypes) 
     2803    for (int pixType : PIXEL_TYPES) 
    29392804      comboCropAndAutoscaleTester(pixType,240,240,2,2,2,225,225,10); 
    29402805  } 
     
    31042969      // TODO - falseColor stuff needs to be impl 
    31052970      if (!falseColor) 
    3106         colorTests(ci,expectedSizeC,DefaultColorOrder); 
     2971        colorTests(ci,expectedSizeC,DEFAULT_COLOR_ORDER); 
    31072972       
    31082973    } 
     
    31342999    // sizeC == 1, rgb == 1, indexed, 8 bit, implicit lut length of 3 - KEY test to do, also note can vary lut len 
    31353000    System.out.println("1/1 indexed"); 
    3136     colorizeSubcaseTester(FormatTools.UINT8,1,1,Indexed,RealColor,-1); 
     3001    colorizeSubcaseTester(FormatTools.UINT8,1,1,INDEXED,REAL_COLOR,-1); 
    31373002    System.out.println("1/1 indexed falseColor"); 
    3138     colorizeSubcaseTester(FormatTools.UINT8,1,1,Indexed,FalseColor,-1); 
     3003    colorizeSubcaseTester(FormatTools.UINT8,1,1,INDEXED,FALSE_COLOR,-1); 
    31393004    System.out.println("1/1/indexed lutLen==2"); 
    3140     colorizeSubcaseTester(FormatTools.UINT8,1,1,Indexed,RealColor,2); 
     3005    colorizeSubcaseTester(FormatTools.UINT8,1,1,INDEXED,REAL_COLOR,2); 
    31413006     
    31423007    // sizeC == 1, rgb == 1, indexed, 16 bit, implicit lut length of 3 - 2nd important test to do, also note can vary lut len 
    31433008    System.out.println("1/1 indexed (16-bit)"); 
    3144     colorizeSubcaseTester(FormatTools.UINT16,1,1,Indexed,RealColor,-1); 
     3009    colorizeSubcaseTester(FormatTools.UINT16,1,1,INDEXED,REAL_COLOR,-1); 
    31453010    System.out.println("1/1 indexed (16-bit) falseColor"); 
    3146     colorizeSubcaseTester(FormatTools.UINT16,1,1,Indexed,FalseColor,-1); 
     3011    colorizeSubcaseTester(FormatTools.UINT16,1,1,INDEXED,FALSE_COLOR,-1); 
    31473012    System.out.println("1/1/indexed (16-bit) lutLen==2"); 
    3148     colorizeSubcaseTester(FormatTools.UINT16,1,1,Indexed,RealColor,2); 
     3013    colorizeSubcaseTester(FormatTools.UINT16,1,1,INDEXED,REAL_COLOR,2); 
    31493014 
    31503015    // sizeC = 3 and rgb = 1 
    31513016    System.out.println("3/1 indexed"); 
    3152     colorizeSubcaseTester(FormatTools.UINT8,3,1,Indexed,RealColor,-1); 
     3017    colorizeSubcaseTester(FormatTools.UINT8,3,1,INDEXED,REAL_COLOR,-1); 
    31533018    System.out.println("3/1 indexed falseColor"); 
    3154     colorizeSubcaseTester(FormatTools.UINT8,3,1,Indexed,FalseColor,-1);                            // TODO - might be working 
     3019    colorizeSubcaseTester(FormatTools.UINT8,3,1,INDEXED,FALSE_COLOR,-1);                            // TODO - might be working 
    31553020 
    31563021    // sizeC = 3 and rgb = 3 : interleaved 
    31573022    System.out.println("3/3 indexed"); 
    3158     colorizeSubcaseTester(FormatTools.UINT8,3,3,Indexed,RealColor,-1); 
     3023    colorizeSubcaseTester(FormatTools.UINT8,3,3,INDEXED,REAL_COLOR,-1); 
    31593024    // TODO - enable this failing test 
    31603025    //System.out.println("3/3 indexed falseColor"); 
    3161     //colorizeSubcaseTester(FormatTools.UINT8,3,3,Indexed,FalseColor,-1); 
     3026    //colorizeSubcaseTester(FormatTools.UINT8,3,3,INDEXED,FALSE_COLOR,-1); 
    31623027 
    31633028    // NOT INDEXED 
     
    31693034    // if indexed == true this combo throws exception in CompositeImage constructor 
    31703035    System.out.println("4/4 nonindexed");                                                // TODO - might be working 
    3171     colorizeSubcaseTester(FormatTools.UINT8,4,4,NotIndexed,RealColor,-1); 
     3036    colorizeSubcaseTester(FormatTools.UINT8,4,4,NOT_INDEXED,REAL_COLOR,-1); 
    31723037 
    31733038    // sizeC = 6, rgb = 3, indexed = false 
    31743039    // if indexed == true this combo throws exception in CompositeImage constructor 
    31753040    System.out.println("6/3 nonindexed"); 
    3176     colorizeSubcaseTester(FormatTools.UINT8,6,3,NotIndexed,RealColor,-1); 
     3041    colorizeSubcaseTester(FormatTools.UINT8,6,3,NOT_INDEXED,REAL_COLOR,-1); 
    31773042    
    31783043    // sizeC = 12, rgb = 3, indexed = false 
    31793044    System.out.println("12/3 nonindexed"); 
    3180     colorizeSubcaseTester(FormatTools.UINT8,12,3,NotIndexed,RealColor,-1); 
     3045    colorizeSubcaseTester(FormatTools.UINT8,12,3,NOT_INDEXED,REAL_COLOR,-1); 
    31813046 
    31823047    System.out.println("testColorizeSubcases() - past special cases"); 
     
    31873052        if (sizeC % rgb == 0) 
    31883053          for (int pixType : new int[] {FormatTools.UINT8}) // TODO - add later FormatTools.UINT16 
    3189             for (boolean indexed : BooleanStates) 
    3190               for (boolean falseColor : BooleanStates) 
     3054            for (boolean indexed : BOOLEAN_STATES) 
     3055              for (boolean falseColor : BOOLEAN_STATES) 
    31913056              { 
    31923057                if (!indexed && falseColor)  // if !indexed make sure falseColor is false to avoid illegal combo 
     
    32063071  { 
    32073072    // TODO - handle more cases with falseColor, rgb, etc. 
    3208     for (boolean indexed : BooleanStates) 
     3073    for (boolean indexed : BOOLEAN_STATES) 
    32093074      for (int channels = 2; channels <= 7; channels++) 
    32103075        if (!indexed)  // TODO - remove this limitation when BF updated 
Note: See TracChangeset for help on using the changeset viewer.