예제 #1
0
 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)
예제 #2
0
 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)
예제 #3
0
 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
예제 #4
0
 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)
예제 #5
0
 def add_gadget(self, id, gadget):
     handle = pygadgetron.cGT_addGadget(self.handle, id, gadget.handle)
     _check_status(handle)
     pygadgetron.deleteDataHandle(handle)
예제 #6
0
 def norm(self):
     handle = pygadgetron.cGT_norm(self.handle)
     _check_status(handle)
     r = pygadgetron.doubleDataFromHandle(handle)
     pygadgetron.deleteDataHandle(handle)
     return r;
예제 #7
0
 def send_acquisitions(self, acq):
     handle = pygadgetron.cGT_sendAcquisitions(self.handle, acq.handle)
     _check_status(handle)
     pygadgetron.deleteDataHandle(handle)
예제 #8
0
 def send_config_file(self, file):
     handle = pygadgetron.cGT_sendConfigFile(self.handle, file)
     _check_status(handle)
     pygadgetron.deleteDataHandle(handle)
예제 #9
0
 def register_images_receiver(self, imgs):
     handle = pygadgetron.cGT_registerImagesReceiver\
         (self.handle, imgs.handle)
     _check_status(handle)
     pygadgetron.deleteDataHandle(handle)
예제 #10
0
 def connect(self, host, port):
     handle = pygadgetron.cGT_connect(self.handle, host, port)
     _check_status(handle)
     pygadgetron.deleteDataHandle(handle)
예제 #11
0
def _set_int_par(handle, set, par, value):
    h = pygadgetron.intDataHandle(value)
    _setParameter(handle, set, par, h)
    pygadgetron.deleteDataHandle(h)
예제 #12
0
 def sort(self):
     handle = pygadgetron.cGT_orderAcquisitions(self.handle)
     _check_status(handle)
     pygadgetron.deleteDataHandle(handle)
     self.sorted = True
예제 #13
0
def _setParameter(hs, set, par, hv):
    h = pygadgetron.cGT_setParameter(hs, set, par, hv)
    _check_status(h)
    pygadgetron.deleteDataHandle(h)
예제 #14
0
 def write(self, out_file, out_group):
     handle = pygadgetron.cGT_writeImages\
         (self.handle, out_file, out_group)
     _check_status(handle)
     pygadgetron.deleteDataHandle(handle)
예제 #15
0
 def types(self):
     handle = pygadgetron.cGT_imageTypes(self.handle)
     _check_status(handle)
     n = pygadgetron.intDataFromHandle(handle)
     pygadgetron.deleteDataHandle(handle)
     return n
예제 #16
0
 def set_coil_sensitivity_maps(self, csm):
     handle = pygadgetron.cGT_setCSMs(self.handle, csm.handle)
     _check_status(handle)
     pygadgetron.deleteDataHandle(handle)
     self.csms = 'set'
예제 #17
0
 def set_timeout(self, timeout):
     handle = pygadgetron.cGT_setConnectionTimeout(self.handle, timeout)
     _check_status(handle)
     pygadgetron.deleteDataHandle(handle)
예제 #18
0
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
예제 #19
0
 def disconnect(self):
     handle = pygadgetron.cGT_disconnect(self.handle)
     _check_status(handle)
     pygadgetron.deleteDataHandle(handle)
예제 #20
0
 def set_properties(self, prop):
     handle = pygadgetron.cGT_setGadgetProperties(self.handle, prop)
     _check_status(handle)
     pygadgetron.deleteDataHandle(handle)
예제 #21
0
 def config_gadget_chain(self, gc):
     handle = pygadgetron.cGT_configGadgetChain(self.handle, gc.handle)
     _check_status(handle)
     pygadgetron.deleteDataHandle(handle)
예제 #22
0
 def add_reader(self, id, reader):
     handle = pygadgetron.cGT_addReader(self.handle, id, reader.handle)
     _check_status(handle)
     pygadgetron.deleteDataHandle(handle)
예제 #23
0
 def send_parameters(self, par):
     handle = pygadgetron.cGT_sendParameters(self.handle, par)
     _check_status(handle)
     pygadgetron.deleteDataHandle(handle)
예제 #24
0
 def add_writer(self, id, writer):
     handle = pygadgetron.cGT_addWriter(self.handle, id, writer.handle)
     _check_status(handle)
     pygadgetron.deleteDataHandle(handle)
예제 #25
0
 def send_images(self, img):
     handle = pygadgetron.cGT_sendImages(self.handle, img.handle)
     _check_status(handle)
     pygadgetron.deleteDataHandle(handle)
예제 #26
0
 def number(self):
     handle = pygadgetron.cGT_dataItems(self.handle)
     _check_status(handle)
     n = pygadgetron.intDataFromHandle(handle)
     pygadgetron.deleteDataHandle(handle)
     return n