Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/miykael/atlasreader
Browse files Browse the repository at this point in the history
  • Loading branch information
miykael committed Aug 3, 2020
2 parents 88302a8 + a80bd38 commit 18ff932
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .zenodo.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@
"affiliation": "Centre Leenaards de la Mémoire, Centre Hospitalier Universitaire Vaudois, Lausanne, Switzerland",
"orcid": "0000-0001-5507-4304"
},
{
"affiliation": "Department of Psychology, University of Bielefeld, Bielefeld, Germany.",
"name": "Doll, Anna",
"orcid": "0000-0002-0799-0831"
},
{
"name": "Whitaker, Kirstie",
"affiliation": "Alan Turing Institute, London, UK; Department of Psychiatry, University of Cambridge, Cambridge, UK",
Expand Down
7 changes: 4 additions & 3 deletions atlasreader/atlasreader.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ def coord_xyz_to_ijk(affine, coords):
Provided `coords` in cartesian space
"""
coords = _check_coord_inputs(coords)
vox_coords = np.linalg.solve(affine, coords)[:3].T.astype(int)
vox_coords = np.linalg.solve(affine, coords)[:3].T
vox_coords = np.round(vox_coords).astype(int)
return vox_coords


Expand Down Expand Up @@ -227,7 +228,7 @@ def get_peak_coords(clust_img):
maxcoords[n] = center_of_mass(cluster == cluster.max())

# sort peak coordinates by cluster size
maxcoords = np.floor(maxcoords)[np.argsort(clust_size)[::-1]]
maxcoords = np.floor(maxcoords).astype(int)[np.argsort(clust_size)[::-1]]

# convert coordinates to MNI space
coords = coord_ijk_to_xyz(clust_img.affine, maxcoords)
Expand Down Expand Up @@ -260,7 +261,7 @@ def get_subpeak_coords(clust_img, min_distance=20):
# make new clusters to check for "flat" peaks + find CoM of those clusters
labels, nl = label(local_max)
ijk = center_of_mass(data, labels=labels, index=range(1, nl + 1))
ijk = np.asarray(ijk, dtype=int)
ijk = np.round(ijk).astype(int)

if len(ijk) > 1:
# sort coordinates based on peak value
Expand Down

0 comments on commit 18ff932

Please sign in to comment.