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
add3d2c2
Commit
add3d2c2
authored
1 year ago
by
Sharon Yates
Browse files
Options
Downloads
Patches
Plain Diff
Cleap up, comments, etc
parent
6e4ac639
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
PyNutil/folder_of_segmentations_to_meshview_multithreaded.py
+5
-3
5 additions, 3 deletions
PyNutil/folder_of_segmentations_to_meshview_multithreaded.py
with
5 additions
and
3 deletions
PyNutil/folder_of_segmentations_to_meshview_multithreaded.py
+
5
−
3
View file @
add3d2c2
...
...
@@ -9,7 +9,7 @@ import json
from
datetime
import
datetime
#import json, use to define input parameters
#import json
into "input" variable
, use to define input parameters
with
open
(
'
../test/test1.json
'
,
'
r
'
)
as
f
:
input
=
json
.
load
(
f
)
#print(input)
...
...
@@ -24,7 +24,6 @@ startTime = datetime.now()
points
=
FolderToAtlasSpaceMultiThreaded
(
input
[
"
segmentation_folder
"
],
input
[
"
alignment_json
"
],
pixelID
=
input
[
"
colour
"
],
nonLinear
=
input
[
"
nonlinear
"
])
time_taken
=
datetime
.
now
()
-
startTime
print
(
f
"
Folder to atlas took:
{
time_taken
}
"
)
#first we need to find the label file for the volume
#then the path to the volume
...
...
@@ -38,13 +37,16 @@ labels = labelPoints(points, data, scale_factor=2.5)
#save points to a meshview json
WritePointsToMeshview
(
points
,
labels
,
input
[
"
points_json_path
"
],
label_df
)
#Task:
#SY Task:
# function for counting no. of objects per region
# Make a pandas dataframe
# Column 1: counted_labels
# Column 2: label_counts
# Column 3: region_name (look up by reading Allen2022_colours.csv, look up name and RGB)
# Save dataframe in output as CSV
# next task is to create functions from this.
counted_labels
,
label_counts
=
np
.
unique
(
labels
,
return_counts
=
True
)
counts_per_label
=
list
(
zip
(
counted_labels
,
label_counts
))
...
...
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