Skip to content
Snippets Groups Projects
Commit 8ce710ca authored by sharoncy's avatar sharoncy
Browse files

Slice report with all RefAtlasRegions

parent 1651d4fa
No related branches found
No related tags found
No related merge requests found
......@@ -131,6 +131,7 @@ class PyNutil:
atlas_labels = pd.read_csv(f"{atlas_root_path}{atlas_label_path}")
print("atlas labels loaded ✅")
return atlas_volume, atlas_labels
def get_coordinates(self, non_linear=True, method="all", object_cutoff=0):
"""Extracts pixel coordinates from the segmentation data.
......@@ -229,8 +230,16 @@ class PyNutil:
# ra is region area list from
# merge current_df onto ra (region_areas_list) based on idx column
#(left means use only keys from left frame, preserve key order)
"""
current_df = ra.merge(current_df, on='idx', how='left')
current_df_new = current_df.merge(self.atlas_labels, on= 'idx', how='left')
"""
all_region_df = self.atlas_labels.merge(ra, on = 'idx', how='left')
current_df_new = all_region_df.merge(current_df, on= 'idx', how= 'left')
"""
new_rows = []
for index, row in current_df.iterrows():
mask = self.atlas_labels["idx"] == row["idx"]
......@@ -244,12 +253,11 @@ class PyNutil:
row["r"] = current_region_red[0]
row["g"] = current_region_green[0]
row["b"] = current_region_blue[0]
new_rows.append(row)
current_df_new = pd.DataFrame(new_rows)
current_df_new = pd.DataFrame(new_rows)"""
##Sharon. I would guess you should add the rgb and name adding code here
per_section_df.append(current_df_new)
prev_pl += pl
prev_cl += cl
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment