def test_core_arrayed_procpar(self): gems_arr_te = glob.glob(vj.config['dataset_dir']+'/arrayed/'+\ 'gems_*array_te*')[0] procpar = gems_arr_te+'/procpar' pd = vj.read_procpar(procpar) varray = vj.read_fid(gems_arr_te)
def test_read_fid(self): fid = glob.glob(vj.config['fids_dir']+'/gems*')[0] varr = vj.read_fid(fid) self.assertEqual(varr.source,'fid') self.assertEqual(len(varr.data.shape),2) self.assertEqual(varr.space,'fid') self.assertEqual(varr.pd['pslabel'],'gems') self.assertEqual(varr.apptype,'im2D')
def test_ge3d_to_kspace(self): vj.config['verbose'] = False seq = glob.glob(vj.config['fids_dir'] + '/ge3d*axial_*')[0] varr = vj.read_fid(seq) varr.to_kspace() self.assertEqual(varr.data.shape, (128, 128, 128, 1, 4)) self.assertEqual(varr.space, 'local') self.assertEqual(varr.vdtype, 'kspace')
def load_data(): b0dir = vj.config['dataset_dir'] + '/parameterfit/b0/gems' seqlist = sorted(glob.glob(b0dir + '/gems*'))[4:7] print('\nLoading gems data from: \n') for i in seqlist: print(i) varr_list = [] for i in seqlist: varr = vj.read_fid(i) varr.to_kspace().to_anatomical().to_imagespace() varr_list.append(varr) return concatenate(varr_list)
def test_xrecon(self): fid = glob.glob(vj.config['dataset_dir'] + '/xrecontest/ge3d*')[0] varr = vj.read_fid(fid, load_data=False) varr.to_kspace(method='xrecon') self.assertEqual(varr.pd['rawIM'], 'y')
def test_xrecon_read_fid(self): fid = glob.glob(vj.config['dataset_dir'] + '/xrecontest/gems*')[0] varr = vj.read_fid(fid, xrecon=True, xrecon_space='imagespace') self.assertEqual(varr.data.shape, (128, 128, 20, 1, 4)) self.assertEqual(varr.vdtype, 'imagespace')