Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PyNutil
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Harry Carey
PyNutil
Commits
5fd21f1f
Commit
5fd21f1f
authored
1 year ago
by
Sharon Yates
Browse files
Options
Downloads
Patches
Plain Diff
Clean up
parent
1b3d3436
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
PyNutil/load_workflow.py
+16
-0
16 additions, 0 deletions
PyNutil/load_workflow.py
PyNutil/pyflat.py
+4
-0
4 additions, 0 deletions
PyNutil/pyflat.py
with
20 additions
and
0 deletions
PyNutil/load_workflow.py
+
16
−
0
View file @
5fd21f1f
"""
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 diff is collapsed.
Click to expand it.
PyNutil/pyflat.py
+
4
−
0
View file @
5fd21f1f
"""
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=
"
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment