コード例 #1
0
ファイル: Reg.py プロジェクト: KrisThielemans/SIRF
 def __sub__(self, other):
     """Overloads - operator."""
     z = self.clone()
     if isinstance(other, NiftiImageData):
         try_calling(pyreg.cReg_NiftiImageData_maths_im(z.handle, self.handle, other.handle, 1))
     else:
         try_calling(pyreg.cReg_NiftiImageData_maths_num(z.handle, self.handle, float(other), 1))
     check_status(z.handle)
     return z
コード例 #2
0
 def __add__(self, other):
     """Overloads + operator."""
     z = self.deep_copy()
     if isinstance(other, NiftiImageData):
         try_calling(
             pyreg.cReg_NiftiImageData_maths_im(z.handle, self.handle,
                                                other.handle, 0))
     else:
         try_calling(
             pyreg.cReg_NiftiImageData_maths_num(z.handle, self.handle,
                                                 float(other), 0))
     check_status(z.handle)
     return z