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
c2322c49
Commit
c2322c49
authored
4 months ago
by
polarbean
Browse files
Options
Downloads
Patches
Plain Diff
make load quint json function more general
parent
19c5def5
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
PyNutil/io/read_and_write.py
+4
-7
4 additions, 7 deletions
PyNutil/io/read_and_write.py
PyNutil/processing/coordinate_extraction.py
+11
-2
11 additions, 2 deletions
PyNutil/processing/coordinate_extraction.py
with
15 additions
and
9 deletions
PyNutil/io/read_and_write.py
+
4
−
7
View file @
c2322c49
...
@@ -182,7 +182,7 @@ def load_segmentation(segmentation_path: str):
...
@@ -182,7 +182,7 @@ def load_segmentation(segmentation_path: str):
# related to read and write
# related to read and write
# this function reads a VisuAlign JSON and returns the slices
# this function reads a VisuAlign JSON and returns the slices
def
load_
visualign
_json
(
filename
,
apply_damage_mask
):
def
load_
quint
_json
(
filename
,
apply_damage_mask
=
True
):
"""
"""
Reads a VisuAlign JSON file (.waln or .wwrp) and extracts slice information.
Reads a VisuAlign JSON file (.waln or .wwrp) and extracts slice information.
Slices may include anchoring, grid spacing, and other image metadata.
Slices may include anchoring, grid spacing, and other image metadata.
...
@@ -215,12 +215,9 @@ def load_visualign_json(filename, apply_damage_mask):
...
@@ -215,12 +215,9 @@ def load_visualign_json(filename, apply_damage_mask):
slices
=
vafile
[
"
slices
"
]
slices
=
vafile
[
"
slices
"
]
if
len
(
slices
)
>
1
:
if
len
(
slices
)
>
1
:
slices
=
propagate
(
slices
)
slices
=
propagate
(
slices
)
for
slice
in
slices
:
vafile
[
"
slices
"
]
=
slices
if
not
apply_damage_mask
:
return
vafile
if
"
grid
"
in
slice
:
slice
.
pop
(
"
grid
"
)
gridspacing
=
vafile
[
"
gridspacing
"
]
if
"
gridspacing
"
in
vafile
else
None
return
slices
,
gridspacing
# related to read_and_write, used in write_points_to_meshview
# related to read_and_write, used in write_points_to_meshview
...
...
This diff is collapsed.
Click to expand it.
PyNutil/processing/coordinate_extraction.py
+
11
−
2
View file @
c2322c49
import
numpy
as
np
import
numpy
as
np
import
pandas
as
pd
import
pandas
as
pd
from
..io.read_and_write
import
load_
visualign
_json
from
..io.read_and_write
import
load_
quint
_json
from
.counting_and_load
import
flat_to_dataframe
,
rescale_image
,
load_image
from
.counting_and_load
import
flat_to_dataframe
,
rescale_image
,
load_image
from
.generate_target_slice
import
generate_target_slice
from
.generate_target_slice
import
generate_target_slice
from
.visualign_deformations
import
triangulate
from
.visualign_deformations
import
triangulate
...
@@ -134,7 +134,16 @@ def folder_to_atlas_space(
...
@@ -134,7 +134,16 @@ def folder_to_atlas_space(
Returns:
Returns:
tuple: Various arrays and lists containing transformed coordinates and labels.
tuple: Various arrays and lists containing transformed coordinates and labels.
"""
"""
slices
,
gridspacing
=
load_visualign_json
(
quint_alignment
,
apply_damage_mask
)
quint_json
=
load_quint_json
(
quint_alignment
,
apply_damage_mask
)
slices
=
quint_json
[
'
slices
'
]
if
apply_damage_mask
and
"
gridspacing
"
in
quint_json
:
gridspacing
=
quint_json
[
"
gridspacing
"
]
else
:
gridspacing
=
None
if
not
apply_damage_mask
:
for
slice
in
slices
:
if
"
grid
"
in
slice
:
slice
.
pop
(
"
grid
"
)
segmentations
=
get_segmentations
(
folder
)
segmentations
=
get_segmentations
(
folder
)
flat_files
,
flat_file_nrs
=
get_flat_files
(
folder
,
use_flat
)
flat_files
,
flat_file_nrs
=
get_flat_files
(
folder
,
use_flat
)
region_areas_list
=
[
region_areas_list
=
[
...
...
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