예제 #1
0
 def _ring_inner():
     return masks.ring(centerX=cx,
                       centerY=cy,
                       imageSizeX=detector_x,
                       imageSizeY=detector_y,
                       radius=ro,
                       radius_inner=ri)
예제 #2
0
파일: server.py 프로젝트: jan-car/LiberTEM
 def _ring_inner():
     return masks.ring(centerX=cx,
                       centerY=cy,
                       imageSizeX=frame_size[1],
                       imageSizeY=frame_size[0],
                       radius=ro,
                       radius_inner=ri)
예제 #3
0
파일: com.py 프로젝트: sk1p/LiberTEM
 def get_mask_factories(self):
     if self.dataset.shape.sig.dims != 2:
         raise ValueError("can only handle 2D signals currently")
     if self.parameters.get('ri'):
         # annular CoM:
         return com_masks_generic(detector_y=self.dataset.shape.sig[0],
                                  detector_x=self.dataset.shape.sig[1],
                                  base_mask_factory=lambda: masks.ring(
                                      imageSizeY=self.dataset.shape.sig[0],
                                      imageSizeX=self.dataset.shape.sig[1],
                                      centerY=self.parameters['cy'],
                                      centerX=self.parameters['cx'],
                                      radius=self.parameters['r'],
                                      radius_inner=self.parameters['ri'],
                                  ))
     else:
         # CoM with radius cut-off:
         return com_masks_factory(
             detector_y=self.dataset.shape.sig[0],
             detector_x=self.dataset.shape.sig[1],
             cx=self.parameters['cx'],
             cy=self.parameters['cy'],
             r=self.parameters['r'],
         )