Changeset 6537


Ignore:
Timestamp:
06/18/10 16:49:43 (9 years ago)
Author:
bdezonia
Message:

minor changes

File:
1 edited

Legend:

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

    r6535 r6537  
    3737 
    3838// left off 
    39 //   maybe phase out *Index(ImageProcessor) to support indexed data 
    40 //   add pixelsTest() where necessary 
     39//   do the comboConcatSplits() require options.openAllSeries()? If so, still broken. 
    4140//   expand compositeTestSubcases() to handle more pixTypes and indexed data 
    4241//   finish the colorize tests 
    4342//   implement more combo tests 
     43//   maybe phase out *Index(ImageProcessor) to support indexed data 
     44//   add pixelsTest() where necessary 
    4445//   perhaps refactor the various imageSeriesIn... and ImagesIn... order tests into a general tester and an orderBy param 
     46 
     47// broken 
     48//  comboCropAndAutoscale for INT32. I think its a limitation of Fake. The values of the cropped image are less 
     49//    than the minimum representable value of an int as a float. So when we make a FloatProcessor on the int[] data 
     50//    the huge negative values get clamped to the lowest representable point and thus max and min are not set correctly 
     51//    by IJ. I have verified that the pixel data that is sent to FloatProcessor() is correct. Limitation we'll live 
     52//    with I guess. 
    4553 
    4654// seem broken but don't know status from Curtis 
     
    5159 
    5260// testable code according to my notes 
    53 //   composite, gray, custom: working for 2 <= sizeC <= 7 and nonindexed (not yet tested) 
     61//   composite, gray, custom: working for 2<=sizeC<=7 nonindexed (only Composite is tested for this) 
    5462 
    5563// unwritten 
     
    361369  } 
    362370 
     371  /** returns the expected min value within a FakeFile plane based on pixel type and if autoscale desired */ 
    363372  private long expectedMin(int pixType, boolean wantAutoscale) 
    364373  { 
     
    377386  } 
    378387   
     388  /** returns the expected max value within a FakeFile plane based on pixel type and if autoscale desired */ 
    379389  private long expectedMax(int pixType, boolean wantAutoscale, long maxPixVal, long maxIndex) 
    380390  { 
     
    10021012  } 
    10031013   
     1014  /** tests BF's options.setStackOrder() */ 
    10041015  private void outputStackOrderTester(int pixType, ChannelOrder order, int x, int y, int z, int c, int t) 
    10051016  { 
     
    10341045  } 
    10351046 
     1047  /** tests BF's options.setSwapDimensions() */ 
    10361048  private void datasetSwapDimsTester(int pixType, int x, int y, int z, int t) 
    10371049  { 
     
    10871099  } 
    10881100   
     1101  /** tests BF's options.setOpenAllSeries() */ 
    10891102  private void datasetOpenAllSeriesTester(boolean allOfThem) 
    10901103  { 
     
    11031116  } 
    11041117   
     1118  /** tests BF's options.setOpenAllSeries() and options.setConcatenate() */ 
    11051119  private void datasetConcatenateTester(int pixType, int x, int y, int z, int c, int t, int s) 
    11061120  { 
     
    11341148  } 
    11351149   
     1150  /** tests BF's options.setAutoscale() */ 
    11361151  private void autoscaleTester(int pixType, boolean wantAutoscale) 
    11371152  { 
     
    11731188  } 
    11741189   
    1175   private void colorCompositeTester(int pixType, boolean indexed, int rgb, boolean falseColor, int sizeC, int numSeries) 
    1176   { 
     1190  /** tests BF's options.setColorMode(composite) */ 
     1191  private void colorCompositeTester(int pixType, boolean indexed, int channels, int chanPerPlane, boolean falseColor, int numSeries) 
     1192  { 
     1193    System.out.println("colorCompositeTester(): pixType "+FormatTools.getPixelTypeString(pixType)+" indexed "+indexed+" channels "+channels+" chanPerPlane "+chanPerPlane+" falseColor "+falseColor+" numSeries "+numSeries); 
     1194     
    11771195    int sizeX = 55, sizeY = 71, sizeZ = 3, sizeT = 4; 
    11781196     
    11791197    // reportedly works in BF for 2<=sizeC<=7 and also numSeries*sizeC*3 <= 25 
    11801198     
    1181     assertTrue(sizeC >= 2); 
    1182     assertTrue(sizeC <= 7); 
    1183     assertTrue(numSeries*sizeC*3 <= 25);  // slider limit in IJ 
    1184      
    1185     String path = constructFakeFilename("colorComposite", pixType, sizeX, sizeY, sizeZ, sizeC, sizeT, numSeries, 
    1186         indexed, rgb, falseColor, -1); 
     1199    assertTrue(channels >= 2); 
     1200    assertTrue(channels <= 7); 
     1201    assertTrue(numSeries*channels*3 <= 25);  // slider limit in IJ 
     1202     
     1203    String path = constructFakeFilename("colorComposite", pixType, sizeX, sizeY, sizeZ, channels, sizeT, numSeries, 
     1204        indexed, chanPerPlane, falseColor, -1); 
    11871205     
    11881206    ImagePlus[] imps = null; 
     
    12091227    int lutLen = 3; 
    12101228     
    1211     int expectedSizeC = effectiveC(sizeC, rgb, lutLen, indexed, falseColor); 
     1229    int expectedSizeC = effectiveC(channels, chanPerPlane, lutLen, indexed, falseColor); 
    12121230    
    12131231    xyzctTest(imp,sizeX,sizeY,sizeZ,expectedSizeC,sizeT); 
     
    12441262  } 
    12451263   
     1264  /** tests BF's options.setColorMode(colorized) */ 
    12461265  private void colorColorizedTester() 
    12471266  { 
     
    12911310  } 
    12921311   
     1312  /** tests BF's options.setColorMode(gray) */ 
    12931313  private void colorGrayscaleTester() 
    12941314  { 
     
    13311351  } 
    13321352 
     1353  /** tests BF's options.setColorMode(custom) */ 
    13331354  private void colorCustomTester(int pixType, int sizeX, int sizeY, int sizeZ, int sizeC, int sizeT, int numSeries) 
    13341355  { 
     
    13781399  } 
    13791400   
     1401  /** tests BF's options.setVirtual() */ 
    13801402  private void memoryVirtualStackTester(boolean desireVirtual) 
    13811403  { 
     
    14101432  } 
    14111433 
     1434  /** tests BF's options.setVirtual() with options.setRecord() */ 
    14121435  private void memoryRecordModificationsTester(boolean wantToRemember) 
    14131436  { 
     
    14611484  } 
    14621485   
     1486  /** tests BF's options.set?Begin(), options.set?End(), and options.set?Step() */ 
    14631487  private void memorySpecifyRangeTester(int z, int c, int t, 
    14641488      int zFrom, int zTo, int zBy, 
     
    15221546  } 
    15231547   
     1548  /** tests BF's options.setCrop() and options.setCropRegion() */ 
    15241549  private void memoryCropTester(int x, int y, int ox, int oy, int cropSize) 
    15251550  { 
     
    15581583  // note - this test needs to rely on crop() to get predictable nonzero minimums 
    15591584   
     1585  /** tests BF's options.setCrop() and options.setCropRegion() with options.setAutoscale() */ 
    15601586  private void comboCropAndAutoscaleTester(int pixType, int sizeX, int sizeY, int sizeZ, int sizeC, int sizeT, 
    15611587      int originCropX, int originCropY, int sizeCrop) 
     
    16071633  } 
    16081634   
     1635  /** tests BF's options.setConcatenate() with options.setSplitFocalPlanes() */ 
    16091636  private void comboConcatSplitFocalPlanesTester() 
    16101637  { 
     
    16221649    try { 
    16231650      ImporterOptions options = new ImporterOptions(); 
     1651      //options.setOpenAllSeries(true);  // TODO - added to see if needed for passing 
    16241652      options.setConcatenate(true); 
    16251653      options.setSplitFocalPlanes(true); 
     
    16401668  } 
    16411669   
     1670  /** tests BF's options.setConcatenate() with options.setSplitChannels() */ 
    16421671  private void comboConcatSplitChannelsTester() 
    16431672  { 
     
    16551684    try { 
    16561685      ImporterOptions options = new ImporterOptions(); 
     1686      //options.setOpenAllSeries(true);  // TODO - added to see if needed for passing 
    16571687      options.setConcatenate(true); 
    16581688      options.setSplitChannels(true); 
     
    16731703  } 
    16741704   
     1705  /** tests BF's options.setConcatenate() with options.setSplitTimepoints() */ 
    16751706  private void comboConcatSplitTimepointsTester() 
    16761707  { 
     
    16881719    try { 
    16891720      ImporterOptions options = new ImporterOptions(); 
     1721      //options.setOpenAllSeries(true);  // TODO - added to see if needed for passing 
    16901722      options.setConcatenate(true); 
    16911723      options.setSplitTimepoints(true); 
     
    17061738  } 
    17071739   
     1740  /** tests BF's options.setColormode(composite) - alternate, later definition */ 
    17081741  private void compositeTester(int sizeC, boolean indexed) 
    17091742  { 
     
    19271960 
    19281961    // these here to simplify debugging 
    1929     colorCompositeTester(FormatTools.UINT8,false,1,false,3,1); 
    1930     colorCompositeTester(FormatTools.UINT8,true,1,false,3,1); 
     1962     
     1963    colorCompositeTester(FormatTools.UINT8,false,3,1,false,1); 
     1964    colorCompositeTester(FormatTools.UINT8,true,3,1,false,1); 
    19311965 
    19321966    int[] pixTypes = new int[] {FormatTools.UINT8}; 
    1933     int[] cs = new int[] {2,3,4,5,6,7};  // all that BF/IJ supports right now 
    1934     int[] ts = new int[] {1,2}; 
     1967    int[] channels = new int[] {2,3,4,5,6,7};  // all that BF/IJ supports right now 
    19351968    int[] series = new int[] {1,2,3,4}; 
    1936     int[] rgbs = new int[]{1,2,3}; 
     1969    int[] channelsPerPlaneVals = new int[]{1,2,3}; 
    19371970     
    19381971    for (int pixFormat : pixTypes) 
    1939       for (int c : cs) 
    1940         for (int t : ts) 
    1941           for (int s : series) 
    1942             if ((c*s*3) <= 25)  // IJ slider limitation 
    1943               for (int rgb : rgbs) 
    1944                 for (boolean indexed : BooleanStates) 
    1945                   for (boolean falseColor : BooleanStates) 
    1946                   { 
    1947                     //System.out.println(" format "+pixFormat+"indexed "+indexed+" rgb "+rgb+" fasleColor "+falseColor+" c "+c+" s "+s); 
    1948                     colorCompositeTester(pixFormat,indexed,rgb,falseColor,c,s); 
    1949                   } 
     1972      for (int chanCount : channels) 
     1973        for (int numSeries : series) 
     1974          if ((chanCount*numSeries*3) <= 25)  // IJ slider limitation 
     1975            for (int channelsPerPlane : channelsPerPlaneVals) 
     1976              for (boolean indexed : BooleanStates) 
     1977                for (boolean falseColor : BooleanStates) 
     1978                { 
     1979                  //System.out.println(" format "+pixFormat+"indexed "+indexed+" rgb "+rgb+" fasleColor "+falseColor+" c "+c+" s "+s); 
     1980                  colorCompositeTester(pixFormat,indexed,chanCount,channelsPerPlane,falseColor,numSeries); 
     1981                } 
    19501982  } 
    19511983   
     
    23242356    for (int pixType : PixelTypes) 
    23252357      comboCropAndAutoscaleTester(pixType,240,240,2,2,2,225,225,10); 
    2326  
    2327     // broken 
    2328     //  comboCropAndAutoscale for INT32. I think its a limitation of Fake. The values of the cropped image are less 
    2329     //    than the minimum representable value of an int as a float. So when we make a FloatProcessor on the int[] data 
    2330     //    the huge negative values get clamped to the lowest representable point and thus max and min are not set correctly 
    2331     //    by IJ. I have verified that the pixel data that is sent to FloatProcessor() is correct. Limitation we'll live 
    2332     //    with I guess. 
    2333  
    23342358  } 
    23352359   
     
    25152539    colorColorizedTester(FormatTools.UINT8,3,1,true,false,-1); 
    25162540    System.out.println("3/1 indexed falseColor"); 
    2517     colorColorizedTester(FormatTools.UINT8,3,1,true,true,-1); 
     2541    colorColorizedTester(FormatTools.UINT8,3,1,true,true,-1);                            // TODO - might be working 
    25182542 
    25192543    // sizeC = 3 and rgb = 3 : interleaved 
     
    25292553    // sizeC = 4 and rgb = 4 : interleaved including alpha 
    25302554    // if indexed == true this combo throws exception in CompositeImage constructor 
    2531     System.out.println("4/4 nonindexed"); 
     2555    System.out.println("4/4 nonindexed");                                                // TODO - might be working 
    25322556    colorColorizedTester(FormatTools.UINT8,4,4,false,false,-1); 
    25332557 
     
    25682592    for (boolean indexed : BooleanStates) 
    25692593      for (int channels = 2; channels <= 7; channels++) 
    2570         if (!indexed)  // TODO - remove in future; only doing nonindexed right now 
     2594        if (!indexed)  // TODO - remove this limitation when BF updated 
    25712595          compositeTester(channels,indexed); 
    25722596    fail("unfinished but 2<=sizeC<=7 nonindexed working"); 
Note: See TracChangeset for help on using the changeset viewer.