Skip to content

Commit

Permalink
Merge pull request #21 from khanlab/lobefix
Browse files Browse the repository at this point in the history
fix LOBE heuristic, move vNav files
  • Loading branch information
akhanf authored Aug 21, 2021
2 parents dae0cc1 + 1bc7106 commit 12e807d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 19 deletions.
10 changes: 8 additions & 2 deletions etc/merge_vNav.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,17 @@ def zero_pad(m):


#move all other files to sourcedata
print('moving vnav files to sourcedata, replacing with:')
print('moving vnav files to sourcedata/vNav, replacing with:')
print(vnav_4d)

#create vNav folder in sourcedata:
from pathlib import Path
Path(os.path.join(bids_dir,'sourcedata','vNav')).mkdir(
parents=True, exist_ok=True)

for f in glob.glob(prefix + 'vNav????.*'):
(head,tail) = os.path.split(f)
os.rename(f,os.path.join(bids_dir,'sourcedata',tail))
os.rename(f,os.path.join(bids_dir,'sourcedata','vNav',tail))

#save new 4d file
nib_4d = nib.nifti1.Nifti1Image(vol_4d, init_nib.affine)
Expand Down
35 changes: 18 additions & 17 deletions heuristics/LOBE_HCPLS.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,24 +77,25 @@ def infotodict(seqinfo):


# T1w images
if 'T1w_MPR_vNav_setter' in s.series_description:
if 'MOSAIC' in s.image_type:
info[t1w_vnavs].append({'item': s.series_id})

elif ('tfl_mgh_epinav_ABCD' in s.series_description):
if 'OTHER' in s.image_type:
if 'NORM' in s.image_type:
info[t1w_norm].append({'item': s.series_id})
else:
info[t1w].append({'item': s.series_id})
if 'M' in s.image_type:
if 'NORM' in s.image_type:
info[t1w_me_norm].append({'item': s.series_id})
if 'T1w_MPR' in s.series_description:
if 'vNav' in s.series_description:
if 'setter' in s.series_description:
if 'MOSAIC' in s.image_type:
info[t1w_vnavs].append({'item': s.series_id})
else:
info[t1w_me].append({'item': s.series_id})

elif ('T1w_MPR' in s.series_description):
info[t1w_basic].append({'item': s.series_id})
if 'OTHER' in s.image_type:
if 'NORM' in s.image_type:
info[t1w_norm].append({'item': s.series_id})
else:
info[t1w].append({'item': s.series_id})
if 'M' in s.image_type:
if 'NORM' in s.image_type:
info[t1w_me_norm].append({'item': s.series_id})
else:
info[t1w_me].append({'item': s.series_id})

else:
info[t1w_basic].append({'item': s.series_id})


#T2w images
Expand Down

0 comments on commit 12e807d

Please sign in to comment.