Skip to content

Commit

Permalink
Fix for "per_pixel"
Browse files Browse the repository at this point in the history
PyNutil only worked for method = "all". Fix so that it works for "per_pixel" and "per_object".
  • Loading branch information
Sharon Christine Yates committed Apr 3, 2024
1 parent 4026753 commit 012c860
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions PyNutil/coordinate_extraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ def segmentation_to_atlas_space(
region_areas = get_region_areas(use_flat, atlas_labels, flat_file_atlas, seg_width, seg_height, slice_dict, atlas_volume, triangulation)
y_scale, x_scale = transform_to_registration(seg_height, seg_width, reg_height, reg_width)
centroids, points = None, None
scaled_centroidsX, scaled_centroidsY, scaled_x, scaled_y = None, None, None, None
if method in ["per_object", "all"]:
centroids, scaled_centroidsX, scaled_centroidsY = get_centroids(segmentation, pixel_id, y_scale, x_scale, object_cutoff)
if method in ["per_pixel", "all"]:
Expand Down
4 changes: 3 additions & 1 deletion testOOP.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
import os

os.chdir("..")


pnt = PyNutil(settings_file=r"PyNutil/test/test10_PyNutil_web.json")

##Use flat can be set to True if you want to use the flat file
# instead of the visualign json (this is only useful for testing and will be removed)
pnt.get_coordinates(object_cutoff=0, use_flat=False)
pnt.get_coordinates(object_cutoff=0, method="per_pixel")

pnt.quantify_coordinates()

Expand Down

0 comments on commit 012c860

Please sign in to comment.