コード例 #1
0
 @Test
 public void testSectorROIBeanEqual() throws Exception {
   // SectorROI
   double[] radii = {30, 50}, angles = {6, 9};
   double dpp = 20;
   int symmetry = 5;
   ROIBean rbean = new SectorROIBean();
   ((SectorROIBean) rbean).setAngles(angles);
   ((SectorROIBean) rbean).setStartPoint(startPoint);
   ((SectorROIBean) rbean).setRadii(radii);
   ((SectorROIBean) rbean).setDpp(dpp);
   ((SectorROIBean) rbean).setSymmetry(symmetry);
   SectorROI sroi = (SectorROI) ROIBeanFactory.decapsulate(rbean);
   SectorROIBean resultBean = (SectorROIBean) ROIBeanFactory.encapsulate(sroi);
   assertEquals(rbean, resultBean);
 }
コード例 #2
0
  @Test
  public void testSectorROIBeanConversionToSectorROI() throws Exception {
    // SectorROI
    double[] radii = {30, 50}, angles = {6, 9};
    double dpp = 20;
    int symmetry = 5;
    ROIBean rbean = new SectorROIBean();
    ((SectorROIBean) rbean).setAngles(angles);
    ((SectorROIBean) rbean).setStartPoint(startPoint);
    ((SectorROIBean) rbean).setRadii(radii);
    ((SectorROIBean) rbean).setDpp(dpp);
    ((SectorROIBean) rbean).setSymmetry(symmetry);

    SectorROI sroi = (SectorROI) ROIBeanFactory.decapsulate(rbean);
    assertArrayEquals(startPoint, sroi.getPoint(), 0);
    assertArrayEquals(radii, sroi.getRadii(), 0);
    assertArrayEquals(angles, sroi.getAngles(), 0);
    assertEquals(dpp, sroi.getDpp(), 0);
    assertEquals(symmetry, sroi.getSymmetry());
  }