Skip to content
Snippets Groups Projects
Commit 5fd21f1f authored by Sharon Yates's avatar Sharon Yates
Browse files

Clean up

parent 1b3d3436
No related branches found
No related tags found
No related merge requests found
"""Create workflow for calculating load based on atlas maps and segmentations"""
import struct
import matplotlib.pyplot as plt
import pandas as pd
......@@ -22,6 +24,20 @@ allen_id_image = lbidx[values.astype(int)] # assign allen IDs into image array
plt.imshow(allen_id_image)
"""count pixels for unique idx"""
unique_ids, counts = np.unique(allen_id_image, return_counts=True)
area_per_label = list(zip(unique_ids,counts))
# create a list of unique regions and pixel counts per region
df_area_per_label = pd.DataFrame(area_per_label, columns=["idx","area_count"])
# create a pandas df with regions and pixel counts
print(df_area_per_label)
df_area_per_label.to_csv("../outputs/s037_area_per_idx.csv", sep=";", na_rep='', index= False)
# Count area per unique label
# Scale up to size of corresponding segmentation
......
"""This is Gergely Csusc's code from VisuAlign MediaWiki NITRC page,
this was a test, not used elsewhere in PyNutil"""
import sys
for arg in sys.argv:
if arg.startswith("flat="):
......
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