Пример #1
0
 def get_inner_product(self, other):
     """Get inner product between two images. Must be same size."""
     if not isinstance(other, NiftiImageData):
         raise AssertionError()
     handle = pyreg.cReg_NiftiImageData_get_inner_product(self.handle, other.handle)
     check_status(handle)
     inner_product = pyiutil.floatDataFromHandle(handle)
     pyiutil.deleteDataHandle(handle)
     return inner_product
Пример #2
0
 def norm(self):
     '''
     Returns the 2-norm of the container data viewed as a vector.
     '''
     assert self.handle is not None
     handle = pysirf.cSIRF_norm(self.handle)
     check_status(handle)
     r = pyiutil.floatDataFromHandle(handle)
     pyiutil.deleteDataHandle(handle)
     return r;
Пример #3
0
 def dot(self, other):
     '''
     Returns the dot product of the container data with another container 
     data viewed as vectors.
     other: DataContainer
     '''
     assert_validities(self, other)
     handle = pysirf.cSIRF_dot(self.handle, other.handle)
     check_status(handle)
     r = pyiutil.floatDataFromHandle(handle)
     pyiutil.deleteDataHandle(handle)
     return r
Пример #4
0
def _float_par_sirf(handle, set_, par):
    h = pysirfreg.cSIRFReg_parameter(handle, set_, par)
    check_status(h, inspect.stack()[1])
    value = pyiutil.floatDataFromHandle(h)
    pyiutil.deleteDataHandle(h)
    return value