Changeset 6314


Ignore:
Timestamp:
05/13/10 15:54:49 (10 years ago)
Author:
bdezonia
Message:

Minor reorganization to simplify tracing a BF bug

File:
1 edited

Legend:

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

    r6307 r6314  
    1010import static org.junit.Assert.fail; 
    1111 
     12import ij.IJ; 
    1213import ij.ImagePlus; 
    1314import ij.ImageStack; 
     
    2627 
    2728// TODO 
     29//    waiting on BF implementations for 
     30//      range step by 0 
     31//      BF/imageJ returning wrong max num pixels for UINT32 - off by one 
     32//      memoryRecord failure needs BF code fix? 
     33//      mergeOptions BF api for finishing merge tests 
     34//      custom color BF api for doing that test 
    2835//  - flesh out existing tests 
    2936//      write tests for the color options : 4 cases - some mention was made that indexcolor is an issue in testing 
     
    3138//        rgb colorize - need to do actual tests. see BF gui to get idea of how it works 
    3239//        custom colorize - waiting for creation of API for setting r,g,b info 
    33 //        autoscale - code stubbed out but tests not in place for histogram testing. Its possible the histogram won't 
    34 //          change when base image is a fake file because the whole data range may already be in use. 
     40//        autoscale - code written but failing 
    3541//      open individual files: try to come up with a way to test without a disk file as source 
    3642//      swapped dims test needs to test cases other than from default swapping Z & T 
     
    552558  private void autoscaleTest(int pixType, boolean wantAutoscale) 
    553559  { 
    554     //final int sizeZ = 5, sizeC = 3, sizeT = 7, sizeX = 123, sizeY = 74; 
     560    //TODO: reenable multidim when bug fixed - final int sizeZ = 5, sizeC = 3, sizeT = 7, sizeX = 123, sizeY = 74; 
    555561    final int sizeZ = 1, sizeC = 1, sizeT = 1, sizeX = 123, sizeY = 74; 
    556     final int cOriginX = 55, cOriginY = 15, cropSize = 20; 
     562    final int cOriginX = 55, cOriginY = 15, cropSize = 3; 
    557563    final String path = constructFakeFilename("autoscale",pixType, sizeX, sizeY, sizeZ, sizeC, sizeT, -1); 
    558564     
    559565    // needed for this test 
    560566    assertTrue(cOriginX >= 50); 
    561     assertTrue(cOriginY >= 10); 
     567    assertTrue(cOriginY >= 10);  
    562568    assertTrue(cOriginX + cropSize < sizeX); 
    563569    assertTrue(cOriginY + cropSize < sizeY); 
     570    assertTrue(cOriginX + cropSize < maxPixelValue(pixType)); 
    564571     
    565572    ImagePlus[] imps = null; 
     
    594601    long expectedMax = wantAutoscale ? cOriginX+cropSize-1 : maxPixelValue(pixType); 
    595602    long expectedMin = wantAutoscale ? cOriginX : 0; 
     603 
     604    // verify each slice? or just imp.getDisplayRangeMax/Min()? 
    596605     
    597606    for (int i = 0; i < numSlices; i++) 
     
    673682    assertEquals(0,(int)imp.getProcessor().getPixelValue(0,10)); 
    674683    imp.getProcessor().invert(); 
     684    //IJ.runPlugIn(imp, "Invert", "");  // this makes no difference 
    675685    assertEquals(255,(int)imp.getProcessor().getPixelValue(0,10)); 
    676686    imp.setSlice(2); 
     
    786796 
    787797  @Test 
    788   public void testDefaultBehavior() 
    789   { 
    790     defaultBehaviorTest(FormatTools.UINT16, 400, 300, 1, 1, 1); 
    791     defaultBehaviorTest(FormatTools.INT16, 107, 414, 1, 1, 1); 
    792     defaultBehaviorTest(FormatTools.UINT32, 323, 206, 3, 2, 1); 
    793     defaultBehaviorTest(FormatTools.UINT8, 57, 78, 5, 4, 3); 
    794     defaultBehaviorTest(FormatTools.INT32, 158, 99, 2, 3, 4); 
    795     defaultBehaviorTest(FormatTools.INT8, 232, 153, 3, 7, 5); 
    796   } 
    797  
    798   @Test 
    799   public void testOutputStackOrder() 
    800   { 
    801     outputStackOrderTest(FormatTools.UINT8, "XYZCT", 82, 47, 2, 3, 4); 
    802     outputStackOrderTest(FormatTools.UINT8, "XYZTC", 82, 47, 2, 3, 4); 
    803     outputStackOrderTest(FormatTools.UINT8, "XYCZT", 82, 47, 2, 3, 4); 
    804     outputStackOrderTest(FormatTools.UINT8, "XYCTZ", 82, 47, 2, 3, 4); 
    805     outputStackOrderTest(FormatTools.UINT8, "XYTCZ", 82, 47, 2, 3, 4); 
    806     outputStackOrderTest(FormatTools.UINT8, "XYTZC", 82, 47, 2, 3, 4); 
    807   } 
    808      
    809   @Test 
    810   public void testDatasetGroupFiles() 
    811   { 
    812     String path = FAKE_FILES[0]; 
    813  
    814     ImagePlus[] imps = null; 
    815     try { 
    816       ImporterOptions options = new ImporterOptions(); 
    817       options.setGroupFiles(true); 
    818       options.setId(path); 
    819       imps = BF.openImagePlus(options); 
    820       assertEquals(FAKE_PATTERN, options.getId()); 
    821     } 
    822     catch (IOException e) { 
    823       fail(e.getMessage()); 
    824     } 
    825     catch (FormatException e) { 
    826       fail(e.getMessage()); 
    827       } 
    828      
    829     assertEquals(1,imps.length); 
    830     assertEquals(105,imps[0].getStack().getSize()); 
    831   } 
    832  
    833   @Test 
    834   public void testDatasetOpenFilesIndividually() 
    835   { 
    836     // TODO - try to remove file dependency 
    837      
    838     String path = "2channel_stack_raw01.pic"; 
    839      
    840     // there is a second file called "2channel_stack_raw02.pic" present in the same directory 
    841     // if open indiv true should only load one of them, otherwise both 
    842      
    843     // try ungrouped 
    844      
    845     ImagePlus[] imps = null; 
    846     try { 
    847       ImporterOptions options = new ImporterOptions(); 
    848       options.setUngroupFiles(true); 
    849       options.setId(path); 
    850       imps = BF.openImagePlus(options); 
    851     } 
    852     catch (IOException e) { 
    853       fail(e.getMessage()); 
    854     } 
    855     catch (FormatException e) { 
    856       fail(e.getMessage()); 
    857     } 
    858      
    859     // test results 
    860      
    861     assertEquals(1,imps.length); 
    862     assertEquals(16,imps[0].getStack().getSize());  // one loaded as one set with 16 slices 
    863      
    864     // try grouped 
    865      
    866     try { 
    867       ImporterOptions options = new ImporterOptions(); 
    868       options.setUngroupFiles(false); 
    869       options.setId(path); 
    870       imps = BF.openImagePlus(options); 
    871     } 
    872     catch (IOException e) { 
    873       fail(e.getMessage()); 
    874     } 
    875     catch (FormatException e) { 
    876       fail(e.getMessage()); 
    877     } 
    878  
    879     // test results 
    880      
    881     assertEquals(1,imps.length); 
    882     assertEquals(32,imps[0].getStack().getSize());  // both loaded as one set of 32 slices 
    883   } 
    884  
    885   @Test 
    886   public void testDatasetSwapDims() 
    887   { 
    888     // TODO: testing only swapping Z&T of XYZTC. Add more option testing 
    889  
    890     datasetSwapDimsTest(FormatTools.UINT8, 82, 47, 1, 3); 
    891     datasetSwapDimsTest(FormatTools.UINT16, 82, 47, 3, 1); 
    892     datasetSwapDimsTest(FormatTools.UINT16, 82, 47, 5, 2); 
    893     datasetSwapDimsTest(FormatTools.UINT32, 82, 47, 5, 2); 
    894     datasetSwapDimsTest(FormatTools.INT8, 44, 109, 1, 4); 
    895     datasetSwapDimsTest(FormatTools.INT16, 44, 109, 2, 1); 
    896     datasetSwapDimsTest(FormatTools.INT32, 44, 109, 4, 3); 
    897     datasetSwapDimsTest(FormatTools.UINT8, 82, 47, 3, 2); 
    898   } 
    899  
    900   @Test 
    901   public void testDatasetOpenAllSeries() 
    902   { 
    903     datasetOpenAllSeriesTest(73,107,1,1,1,1);  // one series 
    904     datasetOpenAllSeriesTest(73,107,1,1,1,2);  // two series 
    905     datasetOpenAllSeriesTest(73,107,5,3,4,4);  // multiple series with Z,C,T larger than 1 
    906   } 
    907  
    908   @Test 
    909   public void testDatasetConcatenate() 
    910   { 
    911     // open a dataset that has multiple series and should get back a single series 
    912     datasetConcatenateTest(FormatTools.UINT8, "XYZCT", 82, 47, 1, 1, 1, 1); 
    913     datasetConcatenateTest(FormatTools.UINT8, "XYZCT", 82, 47, 1, 1, 1, 17); 
    914     datasetConcatenateTest(FormatTools.UINT8, "XYZCT", 82, 47, 4, 5, 2, 9); 
    915   } 
    916  
    917   @Test 
    918   public void testColorMerge() 
    919   { 
    920      
    921     String path = FAKE_FILES[0]; 
    922      
    923     ImagePlus[] imps = null; 
    924     ImagePlus imp = null; 
    925      
    926     // test when color merge false 
    927  
    928     // open file 
    929     try { 
    930       ImporterOptions options = new ImporterOptions(); 
    931       options.setMergeChannels(false); 
    932       options.setId(path); 
    933       imps = BF.openImagePlus(options); 
    934     } 
    935     catch (IOException e) { 
    936       fail(e.getMessage()); 
    937     } 
    938     catch (FormatException e) { 
    939       fail(e.getMessage()); 
    940     } 
    941      
    942     // test results 
    943     assertEquals(1,imps.length); 
    944     imp = imps[0]; 
    945     assertEquals(3,getEffectiveSizeC(imp));  // unmerged 
    946     assertEquals(7,getSizeZ(imp)); 
    947     assertEquals(5,getSizeT(imp)); 
    948      
    949     // test when color merge true 
    950      
    951     // open file 
    952     try { 
    953       ImporterOptions options = new ImporterOptions(); 
    954       options.setMergeChannels(true); 
    955       options.setId(path); 
    956       imps = BF.openImagePlus(options); 
    957     } 
    958     catch (IOException e) { 
    959       fail(e.getMessage()); 
    960     } 
    961     catch (FormatException e) { 
    962       fail(e.getMessage()); 
    963     } 
    964      
    965     // test results 
    966     assertEquals(1,imps.length); 
    967     imp = imps[0]; 
    968     assertTrue(imp.getHeight() > 10);  // required for this test to work 
    969     assertEquals(1, getEffectiveSizeC(imp));  // merged 
    970     assertEquals(7, getSizeZ(imp)); 
    971     assertEquals(5, getSizeT(imp)); 
    972     for (int i = 0; i < 10; i++) 
    973       assertEquals(mergedPixel(i),imp.getProcessor().get(i,10)); 
    974      
    975     // TODO - also test mergeOptions when chans > 3. it will be an int == chans per plane. extra blank images are 
    976     //   added as needed to make multiple images each with same number of channels 
    977     //   i.e. 6 channels can -> 123/456 or 12/34/56 or 1/2/3/4/5/6 (last one not merged ???) 
    978     //        5 channels can -> 123/45b or 12/34/5b or 1/2/3/4/5 (last one not merged ???) 
    979      
    980     fail("unfinished implementation"); 
    981   } 
    982    
    983   @Test 
    984   public void testColorRgbColorize() 
    985   { 
    986     // From BF: RGB colorize channels - Each channel is assigned an appropriate pseudocolor table rather than the normal 
    987     // grayscale.  The first channel is colorized red, the second channel is green, and the third channel is blue. This 
    988     // option is not available when Merge channels to RGB or Custom colorize channels are set. 
    989      
    990     String path = FAKE_FILES[0]; 
    991      
    992     ImagePlus[] imps = null; 
    993     ImagePlus imp = null; 
    994  
    995     // TODO - should not allow mergeChannels with rgb colorize 
    996     try { 
    997       ImporterOptions options = new ImporterOptions(); 
    998       options.setColorize(true); 
    999       options.setMergeChannels(true); 
    1000       options.setId(path); 
    1001       imps = BF.openImagePlus(options); 
    1002       // TODO - eventually fail() here but need BF support first I think 
    1003     } 
    1004     catch (IOException e) { 
    1005       fail(e.getMessage()); 
    1006     } 
    1007     catch (FormatException e) { 
    1008       fail(e.getMessage()); 
    1009     } 
    1010      
    1011     // TODO - should not allow mergeChannels with custom colorize 
    1012     try { 
    1013       ImporterOptions options = new ImporterOptions(); 
    1014       options.setColorize(true); 
    1015       options.setCustomColorize(true); 
    1016       options.setId(path); 
    1017       imps = BF.openImagePlus(options); 
    1018       // TODO - eventually fail() here but need BF support first I think 
    1019     } 
    1020     catch (IOException e) { 
    1021       fail(e.getMessage()); 
    1022     } 
    1023     catch (FormatException e) { 
    1024       fail(e.getMessage()); 
    1025     } 
    1026  
    1027     // TODO - legitimate testing 
    1028     // open file 
    1029     try { 
    1030       ImporterOptions options = new ImporterOptions(); 
    1031       options.setColorize(true); 
    1032       options.setId(path); 
    1033       imps = BF.openImagePlus(options); 
    1034     } 
    1035     catch (IOException e) { 
    1036       fail(e.getMessage()); 
    1037     } 
    1038     catch (FormatException e) { 
    1039       fail(e.getMessage()); 
    1040     } 
    1041      
    1042     assertEquals(1,imps.length); 
    1043     imp = imps[0]; 
    1044     assertEquals(7,getSizeZ(imp)); 
    1045     assertEquals(1,getEffectiveSizeC(imp));  // TODO : correct? 
    1046     assertEquals(1,getSizeT(imp));  // TODO : huh? 
    1047      
    1048     // TODO - actual tests of data 
    1049      
    1050     fail("unfinished implementation"); 
    1051   } 
    1052  
    1053   @Test 
    1054   public void testColorCustomColorize() 
    1055   { 
    1056     // From BF: Custom colorize channels - Each channel is assigned a pseudocolor table rather than the normal grayscale. 
    1057     //   The color for each channel is chosen by the user. This option is not available when Merge channels to RGB or RGB 
    1058     //   colorize channels are set. 
    1059      
    1060     // TODO 
    1061     fail("to be implemented"); 
    1062   } 
    1063    
    1064   @Test 
    1065798  public void testColorAutoscale() 
    1066799  { 
     
    1070803    // throughout the stack. 
    1071804 
     805    autoscaleTest(FormatTools.UINT8,true); 
    1072806     
    1073807    autoscaleTest(FormatTools.UINT8,false); 
     
    1088822 
    1089823  @Test 
     824  public void testDefaultBehavior() 
     825  { 
     826    defaultBehaviorTest(FormatTools.UINT16, 400, 300, 1, 1, 1); 
     827    defaultBehaviorTest(FormatTools.INT16, 107, 414, 1, 1, 1); 
     828    defaultBehaviorTest(FormatTools.UINT32, 323, 206, 3, 2, 1); 
     829    defaultBehaviorTest(FormatTools.UINT8, 57, 78, 5, 4, 3); 
     830    defaultBehaviorTest(FormatTools.INT32, 158, 99, 2, 3, 4); 
     831    defaultBehaviorTest(FormatTools.INT8, 232, 153, 3, 7, 5); 
     832  } 
     833 
     834  @Test 
     835  public void testOutputStackOrder() 
     836  { 
     837    outputStackOrderTest(FormatTools.UINT8, "XYZCT", 82, 47, 2, 3, 4); 
     838    outputStackOrderTest(FormatTools.UINT8, "XYZTC", 82, 47, 2, 3, 4); 
     839    outputStackOrderTest(FormatTools.UINT8, "XYCZT", 82, 47, 2, 3, 4); 
     840    outputStackOrderTest(FormatTools.UINT8, "XYCTZ", 82, 47, 2, 3, 4); 
     841    outputStackOrderTest(FormatTools.UINT8, "XYTCZ", 82, 47, 2, 3, 4); 
     842    outputStackOrderTest(FormatTools.UINT8, "XYTZC", 82, 47, 2, 3, 4); 
     843  } 
     844     
     845  @Test 
     846  public void testDatasetGroupFiles() 
     847  { 
     848    String path = FAKE_FILES[0]; 
     849 
     850    ImagePlus[] imps = null; 
     851    try { 
     852      ImporterOptions options = new ImporterOptions(); 
     853      options.setGroupFiles(true); 
     854      options.setId(path); 
     855      imps = BF.openImagePlus(options); 
     856      assertEquals(FAKE_PATTERN, options.getId()); 
     857    } 
     858    catch (IOException e) { 
     859      fail(e.getMessage()); 
     860    } 
     861    catch (FormatException e) { 
     862      fail(e.getMessage()); 
     863      } 
     864     
     865    assertEquals(1,imps.length); 
     866    assertEquals(105,imps[0].getStack().getSize()); 
     867  } 
     868 
     869  @Test 
     870  public void testDatasetOpenFilesIndividually() 
     871  { 
     872    // TODO - try to remove file dependency 
     873     
     874    String path = "2channel_stack_raw01.pic"; 
     875     
     876    // there is a second file called "2channel_stack_raw02.pic" present in the same directory 
     877    // if open indiv true should only load one of them, otherwise both 
     878     
     879    // try ungrouped 
     880     
     881    ImagePlus[] imps = null; 
     882    try { 
     883      ImporterOptions options = new ImporterOptions(); 
     884      options.setUngroupFiles(true); 
     885      options.setId(path); 
     886      imps = BF.openImagePlus(options); 
     887    } 
     888    catch (IOException e) { 
     889      fail(e.getMessage()); 
     890    } 
     891    catch (FormatException e) { 
     892      fail(e.getMessage()); 
     893    } 
     894     
     895    // test results 
     896     
     897    assertEquals(1,imps.length); 
     898    assertEquals(16,imps[0].getStack().getSize());  // one loaded as one set with 16 slices 
     899     
     900    // try grouped 
     901     
     902    try { 
     903      ImporterOptions options = new ImporterOptions(); 
     904      options.setUngroupFiles(false); 
     905      options.setId(path); 
     906      imps = BF.openImagePlus(options); 
     907    } 
     908    catch (IOException e) { 
     909      fail(e.getMessage()); 
     910    } 
     911    catch (FormatException e) { 
     912      fail(e.getMessage()); 
     913    } 
     914 
     915    // test results 
     916     
     917    assertEquals(1,imps.length); 
     918    assertEquals(32,imps[0].getStack().getSize());  // both loaded as one set of 32 slices 
     919  } 
     920 
     921  @Test 
     922  public void testDatasetSwapDims() 
     923  { 
     924    // TODO: testing only swapping Z&T of XYZTC. Add more option testing 
     925 
     926    datasetSwapDimsTest(FormatTools.UINT8, 82, 47, 1, 3); 
     927    datasetSwapDimsTest(FormatTools.UINT16, 82, 47, 3, 1); 
     928    datasetSwapDimsTest(FormatTools.UINT16, 82, 47, 5, 2); 
     929    datasetSwapDimsTest(FormatTools.UINT32, 82, 47, 5, 2); 
     930    datasetSwapDimsTest(FormatTools.INT8, 44, 109, 1, 4); 
     931    datasetSwapDimsTest(FormatTools.INT16, 44, 109, 2, 1); 
     932    datasetSwapDimsTest(FormatTools.INT32, 44, 109, 4, 3); 
     933    datasetSwapDimsTest(FormatTools.UINT8, 82, 47, 3, 2); 
     934  } 
     935 
     936  @Test 
     937  public void testDatasetOpenAllSeries() 
     938  { 
     939    datasetOpenAllSeriesTest(73,107,1,1,1,1);  // one series 
     940    datasetOpenAllSeriesTest(73,107,1,1,1,2);  // two series 
     941    datasetOpenAllSeriesTest(73,107,5,3,4,4);  // multiple series with Z,C,T larger than 1 
     942  } 
     943 
     944  @Test 
     945  public void testDatasetConcatenate() 
     946  { 
     947    // open a dataset that has multiple series and should get back a single series 
     948    datasetConcatenateTest(FormatTools.UINT8, "XYZCT", 82, 47, 1, 1, 1, 1); 
     949    datasetConcatenateTest(FormatTools.UINT8, "XYZCT", 82, 47, 1, 1, 1, 17); 
     950    datasetConcatenateTest(FormatTools.UINT8, "XYZCT", 82, 47, 4, 5, 2, 9); 
     951  } 
     952 
     953  @Test 
     954  public void testColorMerge() 
     955  { 
     956     
     957    String path = FAKE_FILES[0]; 
     958     
     959    ImagePlus[] imps = null; 
     960    ImagePlus imp = null; 
     961     
     962    // test when color merge false 
     963 
     964    // open file 
     965    try { 
     966      ImporterOptions options = new ImporterOptions(); 
     967      options.setMergeChannels(false); 
     968      options.setId(path); 
     969      imps = BF.openImagePlus(options); 
     970    } 
     971    catch (IOException e) { 
     972      fail(e.getMessage()); 
     973    } 
     974    catch (FormatException e) { 
     975      fail(e.getMessage()); 
     976    } 
     977     
     978    // test results 
     979    assertEquals(1,imps.length); 
     980    imp = imps[0]; 
     981    assertEquals(3,getEffectiveSizeC(imp));  // unmerged 
     982    assertEquals(7,getSizeZ(imp)); 
     983    assertEquals(5,getSizeT(imp)); 
     984     
     985    // test when color merge true 
     986     
     987    // open file 
     988    try { 
     989      ImporterOptions options = new ImporterOptions(); 
     990      options.setMergeChannels(true); 
     991      options.setId(path); 
     992      imps = BF.openImagePlus(options); 
     993    } 
     994    catch (IOException e) { 
     995      fail(e.getMessage()); 
     996    } 
     997    catch (FormatException e) { 
     998      fail(e.getMessage()); 
     999    } 
     1000     
     1001    // test results 
     1002    assertEquals(1,imps.length); 
     1003    imp = imps[0]; 
     1004    assertTrue(imp.getHeight() > 10);  // required for this test to work 
     1005    assertEquals(1, getEffectiveSizeC(imp));  // merged 
     1006    assertEquals(7, getSizeZ(imp)); 
     1007    assertEquals(5, getSizeT(imp)); 
     1008    for (int i = 0; i < 10; i++) 
     1009      assertEquals(mergedPixel(i),imp.getProcessor().get(i,10)); 
     1010     
     1011    // TODO - also test mergeOptions when chans > 3. it will be an int == chans per plane. extra blank images are 
     1012    //   added as needed to make multiple images each with same number of channels 
     1013    //   i.e. 6 channels can -> 123/456 or 12/34/56 or 1/2/3/4/5/6 (last one not merged ???) 
     1014    //        5 channels can -> 123/45b or 12/34/5b or 1/2/3/4/5 (last one not merged ???) 
     1015     
     1016    fail("unfinished implementation"); 
     1017  } 
     1018   
     1019  @Test 
     1020  public void testColorRgbColorize() 
     1021  { 
     1022    // From BF: RGB colorize channels - Each channel is assigned an appropriate pseudocolor table rather than the normal 
     1023    // grayscale.  The first channel is colorized red, the second channel is green, and the third channel is blue. This 
     1024    // option is not available when Merge channels to RGB or Custom colorize channels are set. 
     1025     
     1026    String path = FAKE_FILES[0]; 
     1027     
     1028    ImagePlus[] imps = null; 
     1029    ImagePlus imp = null; 
     1030 
     1031    // TODO - should not allow mergeChannels with rgb colorize 
     1032    try { 
     1033      ImporterOptions options = new ImporterOptions(); 
     1034      options.setColorize(true); 
     1035      options.setMergeChannels(true); 
     1036      options.setId(path); 
     1037      imps = BF.openImagePlus(options); 
     1038      // TODO - eventually fail() here but need BF support first I think 
     1039    } 
     1040    catch (IOException e) { 
     1041      fail(e.getMessage()); 
     1042    } 
     1043    catch (FormatException e) { 
     1044      fail(e.getMessage()); 
     1045    } 
     1046     
     1047    // TODO - should not allow mergeChannels with custom colorize 
     1048    try { 
     1049      ImporterOptions options = new ImporterOptions(); 
     1050      options.setColorize(true); 
     1051      options.setCustomColorize(true); 
     1052      options.setId(path); 
     1053      imps = BF.openImagePlus(options); 
     1054      // TODO - eventually fail() here but need BF support first I think 
     1055    } 
     1056    catch (IOException e) { 
     1057      fail(e.getMessage()); 
     1058    } 
     1059    catch (FormatException e) { 
     1060      fail(e.getMessage()); 
     1061    } 
     1062 
     1063    // TODO - legitimate testing 
     1064    // open file 
     1065    try { 
     1066      ImporterOptions options = new ImporterOptions(); 
     1067      options.setColorize(true); 
     1068      options.setId(path); 
     1069      imps = BF.openImagePlus(options); 
     1070    } 
     1071    catch (IOException e) { 
     1072      fail(e.getMessage()); 
     1073    } 
     1074    catch (FormatException e) { 
     1075      fail(e.getMessage()); 
     1076    } 
     1077     
     1078    assertEquals(1,imps.length); 
     1079    imp = imps[0]; 
     1080    assertEquals(7,getSizeZ(imp)); 
     1081    assertEquals(1,getEffectiveSizeC(imp));  // TODO : correct? 
     1082    assertEquals(1,getSizeT(imp));  // TODO : huh? 
     1083     
     1084    // TODO - actual tests of data 
     1085     
     1086    fail("unfinished implementation"); 
     1087  } 
     1088 
     1089  @Test 
     1090  public void testColorCustomColorize() 
     1091  { 
     1092    // From BF: Custom colorize channels - Each channel is assigned a pseudocolor table rather than the normal grayscale. 
     1093    //   The color for each channel is chosen by the user. This option is not available when Merge channels to RGB or RGB 
     1094    //   colorize channels are set. 
     1095     
     1096    // TODO 
     1097    fail("to be implemented"); 
     1098  } 
     1099   
     1100  @Test 
    10901101  public void testMemoryVirtualStack() 
    10911102  { 
Note: See TracChangeset for help on using the changeset viewer.