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

Prep for reading flat files

parent ddd51ef9
No related branches found
No related tags found
No related merge requests found
......@@ -55,3 +55,13 @@ def PixelCountPerRegion(labelsDict, label_colours):
df_counts_per_label_name = pd.DataFrame(new_rows)
return df_counts_per_label_name
# import flat files, count pixels per label, np.unique... etc. nitrc.org/plugins/mwiki/index.php?title=visualign:Deformation
"""
base=slice["filename"][:-4]
import struct
with open(base+".flat","rb") as f:
b,w,h=struct.unpack(">BII",f.read(9))
data=struct.unpack(">"+("xBH"[b]*(w*h)),f.read(b*w*h))
"""
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