Skip to content

Commit

Permalink
minor fix + added both GM and FULL Hammers atlas as output
Browse files Browse the repository at this point in the history
  • Loading branch information
pjmark committed Nov 7, 2023
1 parent 1c2ee7a commit 7b6de7f
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions amypet/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,17 @@ def get_atlas(atlas='hammers', res=1):
hfldr = hfldr[0]
dfldr = dfldr[0]

fatl = list(hfldr.glob('Hammers_*full*'))
if len(fatl) != 1:
fatl_full = list(hfldr.glob('Hammers_*full*'))
if len(fatl_full) != 1:
raise IOError('Confused with obtaining the Hammers atlas (FULL)')
else:
fatl = fatl[0]
fatl_full = fatl_full[0]

fatl_gm = list(hfldr.glob('Hammers_*gm*'))
if len(fatl_gm) != 1:
raise IOError('Confused with obtaining the Hammers atlas (FULL)')
else:
fatl_gm = fatl_gm[0]

flbl = list(dfldr.glob('Hammers*atlases*n30r95*label*indices*SPM12*.xml'))
if len(flbl) != 1:
Expand Down Expand Up @@ -111,11 +117,17 @@ def get_atlas(atlas='hammers', res=1):
else:
hfldr = hfldr[0]

fatl = list(hfldr.glob('Hammers_*full*'))
if len(fatl) != 1:
fatl_full = list(hfldr.glob('Hammers_*full*'))
if len(fatl_full) != 1:
raise IOError('Confused with obtaining the Hammers atlas (FULL)')
else:
fatl = fatl[0]
fatl_full = fatl_full[0]

fatl_gm = list(hfldr.glob('Hammers_*gm*'))
if len(fatl_gm) != 1:
raise IOError('Confused with obtaining the Hammers atlas (FULL)')
else:
fatl_gm = fatl_gm[0]

# > atlas demographics
urld = urllib.request.urlopen(murl + '/Hammers_mith-n30-ancillary-data.tar.gz')
Expand Down Expand Up @@ -172,7 +184,7 @@ def get_atlas(atlas='hammers', res=1):
with open(atlas_fldr / 'hammers_license', 'w') as f:
f.write('submit the license')

outdct = {'fatlas': fatl, 'flabels': flbl, 'voi_lobes': dlobes, 'vois': datlas}
outdct = {'fatlas': fatl_gm, 'fatlas_full':fatl_full, 'flabels': flbl, 'voi_lobes': dlobes, 'vois': datlas}

Check failure on line 187 in amypet/utils.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] amypet/utils.py#L187

E231 missing whitespace after ':'
Raw output
amypet/utils.py:187:51: E231 missing whitespace after ':'

Check failure on line 187 in amypet/utils.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] amypet/utils.py#L187

E501 line too long (115 > 99 characters)
Raw output
amypet/utils.py:187:100: E501 line too long (115 > 99 characters)

#||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

Check failure on line 189 in amypet/utils.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] amypet/utils.py#L189

E265 block comment should start with '# '
Raw output
amypet/utils.py:189:5: E265 block comment should start with '# '
# > AAL ATLAS
Expand Down Expand Up @@ -228,7 +240,7 @@ def get_atlas(atlas='hammers', res=1):
flbl = atlas_fldr/'Schaefer_2018_100_Parcels.csv'

data = []
with open(fpth, 'r') as csv_file:
with open(flbl, 'r') as csv_file:
csvread = csv.reader(csv_file)
for row in csvread:
data.append(row)
Expand Down

0 comments on commit 7b6de7f

Please sign in to comment.