def process(self): if self.input_data is None: raise error('no input data') handle = pygadgetron.cGT_reconstructImages\ (self.handle, self.input_data.handle) _check_status(handle) pygadgetron.deleteDataHandle(handle)
def dot(self, other): handle = pygadgetron.cGT_dot(self.handle, other.handle) _check_status(handle) re = pygadgetron.doubleReDataFromHandle(handle) im = pygadgetron.doubleImDataFromHandle(handle) pygadgetron.deleteDataHandle(handle) return complex(re, im)
def reconstruct(self, input_data): handle = pygadgetron.cGT_reconstructImages\ (self.handle, input_data.handle) _check_status(handle) pygadgetron.deleteDataHandle(handle) images = ImagesContainer() images.handle = pygadgetron.cGT_reconstructedImages(self.handle) _check_status(images.handle) return images
def calculate(self, acqs): if acqs.is_sorted() is False: print('WARNING: acquisitions may be in a wrong order') if self.handle is not None: pygadgetron.deleteObject(self.handle) self.handle = pygadgetron.cGT_CoilSensitivities('') _check_status(self.handle) _set_int_par\ (self.handle, 'coil_sensitivity', 'smoothness', self.smoothness) handle = pygadgetron.cGT_computeCoilSensitivities\ (self.handle, acqs.handle) _check_status(handle) pygadgetron.deleteDataHandle(handle)
def add_gadget(self, id, gadget): handle = pygadgetron.cGT_addGadget(self.handle, id, gadget.handle) _check_status(handle) pygadgetron.deleteDataHandle(handle)
def norm(self): handle = pygadgetron.cGT_norm(self.handle) _check_status(handle) r = pygadgetron.doubleDataFromHandle(handle) pygadgetron.deleteDataHandle(handle) return r;
def send_acquisitions(self, acq): handle = pygadgetron.cGT_sendAcquisitions(self.handle, acq.handle) _check_status(handle) pygadgetron.deleteDataHandle(handle)
def send_config_file(self, file): handle = pygadgetron.cGT_sendConfigFile(self.handle, file) _check_status(handle) pygadgetron.deleteDataHandle(handle)
def register_images_receiver(self, imgs): handle = pygadgetron.cGT_registerImagesReceiver\ (self.handle, imgs.handle) _check_status(handle) pygadgetron.deleteDataHandle(handle)
def connect(self, host, port): handle = pygadgetron.cGT_connect(self.handle, host, port) _check_status(handle) pygadgetron.deleteDataHandle(handle)
def _set_int_par(handle, set, par, value): h = pygadgetron.intDataHandle(value) _setParameter(handle, set, par, h) pygadgetron.deleteDataHandle(h)
def sort(self): handle = pygadgetron.cGT_orderAcquisitions(self.handle) _check_status(handle) pygadgetron.deleteDataHandle(handle) self.sorted = True
def _setParameter(hs, set, par, hv): h = pygadgetron.cGT_setParameter(hs, set, par, hv) _check_status(h) pygadgetron.deleteDataHandle(h)
def write(self, out_file, out_group): handle = pygadgetron.cGT_writeImages\ (self.handle, out_file, out_group) _check_status(handle) pygadgetron.deleteDataHandle(handle)
def types(self): handle = pygadgetron.cGT_imageTypes(self.handle) _check_status(handle) n = pygadgetron.intDataFromHandle(handle) pygadgetron.deleteDataHandle(handle) return n
def set_coil_sensitivity_maps(self, csm): handle = pygadgetron.cGT_setCSMs(self.handle, csm.handle) _check_status(handle) pygadgetron.deleteDataHandle(handle) self.csms = 'set'
def set_timeout(self, timeout): handle = pygadgetron.cGT_setConnectionTimeout(self.handle, timeout) _check_status(handle) pygadgetron.deleteDataHandle(handle)
def _int_par(handle, set, par): h = pygadgetron.cGT_parameter(handle, set, par) _check_status(h) value = pygadgetron.intDataFromHandle(h) pygadgetron.deleteDataHandle(h) return value
def disconnect(self): handle = pygadgetron.cGT_disconnect(self.handle) _check_status(handle) pygadgetron.deleteDataHandle(handle)
def set_properties(self, prop): handle = pygadgetron.cGT_setGadgetProperties(self.handle, prop) _check_status(handle) pygadgetron.deleteDataHandle(handle)
def config_gadget_chain(self, gc): handle = pygadgetron.cGT_configGadgetChain(self.handle, gc.handle) _check_status(handle) pygadgetron.deleteDataHandle(handle)
def add_reader(self, id, reader): handle = pygadgetron.cGT_addReader(self.handle, id, reader.handle) _check_status(handle) pygadgetron.deleteDataHandle(handle)
def send_parameters(self, par): handle = pygadgetron.cGT_sendParameters(self.handle, par) _check_status(handle) pygadgetron.deleteDataHandle(handle)
def add_writer(self, id, writer): handle = pygadgetron.cGT_addWriter(self.handle, id, writer.handle) _check_status(handle) pygadgetron.deleteDataHandle(handle)
def send_images(self, img): handle = pygadgetron.cGT_sendImages(self.handle, img.handle) _check_status(handle) pygadgetron.deleteDataHandle(handle)
def number(self): handle = pygadgetron.cGT_dataItems(self.handle) _check_status(handle) n = pygadgetron.intDataFromHandle(handle) pygadgetron.deleteDataHandle(handle) return n