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
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