Esempio n. 1
0
 def test_seammarker_expandPointCoordinate_colBeforeIsZero(self):
     "Coord after is above ubound"
     viet = self.loadImageCol()
     vietcp = viet.copy()
     slicer = PointSlicer({"x": 0, "y": 0}, vietcp)
     colBefore, colAfter = slicer.expandPointCoordinate(80,
                                                        coord=1,
                                                        thresh=5)
     colbef_comp, col_after_comp = 0, 3
     message = "Point column coordinate is expanded to {0} "
     message1 = "minimum column before is normally lower than 0"
     message2 = "maximum column after is not normally"
     self.assertEqual(colBefore, colbef_comp,
                      message.format('left') + message1)
     self.assertEqual(colAfter, col_after_comp,
                      message.format('right') + message2)
Esempio n. 2
0
 def test_seammarker_expandPointCoordinate_normal(self):
     viet = self.loadImageCol()
     vietcp = viet.copy()
     col_nb = vietcp.shape[1]
     points = getPointListFromPointPath(self.points_down_path)
     point = points[0]
     slicer = PointSlicer(point, vietcp)
     pointCol = point['x']
     colBefore, colAfter = slicer.expandPointCoordinate(col_nb,
                                                        coord=pointCol,
                                                        thresh=5)
     # colnb_comp = 872
     colbef_comp, col_after_comp = 65, 107
     # pdb.set_trace()
     message = "Point column coordinate is expanded to {0} "\
         "in an unexpected way"
     self.assertEqual(colBefore, colbef_comp, message.format('left'))
     self.assertEqual(colAfter, col_after_comp, message.format('right'))