Skip to content

Commit

Permalink
Merge pull request #50 from MELDProject/dev_docker
Browse files Browse the repository at this point in the history
Dev docker
  • Loading branch information
kwagstyl authored Oct 24, 2024
2 parents 27ed942 + d6382ae commit d7e5b94
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion scripts/env_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def setup():
if os.path.exists(f"{MELD_DATA_PATH}/license.txt"):
print("setting license" + f"{MELD_DATA_PATH}/license.txt")
os.environ["FS_LICENSE"] = f"{MELD_DATA_PATH}/license.txt"
if os.path.exists(f"{os.getcwd()}/license.txt"):
elif os.path.exists(f"{os.getcwd()}/license.txt"):
print("setting license" + f"{os.getcwd()}/license.txt")
os.environ["FS_LICENSE"] = f"{os.getcwd()}/license.txt"
else:
Expand Down
12 changes: 8 additions & 4 deletions scripts/manage_results/plot_prediction_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,15 @@ def define_atlas():
return rois, vertex_i, rois_prop

def get_cluster_location(cluster_array):
cluster_array = np.array(cluster_array)
''' Find centre of mass of prediction
Return ROI from desikan kiliany atlas'''
verts,faces=nb.freesurfer.io.read_geometry(os.path.join(MELD_PARAMS_PATH,
'fsaverage_sym','surf','lh.sphere'))
cluster_array = np.array(cluster_array).astype(bool)
center_coords= np.mean(verts[cluster_array],axis=0)
center_vert = np.argsort((np.abs(verts-center_coords).mean(axis=1)))[0]
rois, vertex_i, rois_prop = define_atlas()
pred_rois = list(vertex_i[cluster_array])
pred_rois = np.array([[x, pred_rois.count(x)] for x in set(pred_rois) if x != 0])
ind = pred_rois[np.where(pred_rois == pred_rois[:,1].max())[0]][0][0]
ind = vertex_i[center_vert]
location = get_key(rois,ind)
return location

Expand Down

0 comments on commit d7e5b94

Please sign in to comment.