Skip to content

Commit

Permalink
Fix critical issue in scaling coordinates in 2d tables
Browse files Browse the repository at this point in the history
  • Loading branch information
constantinpape committed Nov 7, 2022
1 parent 144b4fc commit edb2d9e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions mobie/htm/table_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ def compute_table(input_file, table_path, key, resolution):
props = regionprops(seg)
tab = np.array([
[p.label]
+ [ce / res for ce, res in zip(centers[p.label], resolution)]
+ [float(bb) / res for bb, res in zip(p.bbox[:ndim], resolution)]
+ [float(bb) / res for bb, res in zip(p.bbox[ndim:], resolution)]
+ [ce * res for ce, res in zip(centers[p.label], resolution)]
+ [float(bb) * res for bb, res in zip(p.bbox[:ndim], resolution)]
+ [float(bb) * res for bb, res in zip(p.bbox[ndim:], resolution)]
+ [p.area]
for p in props
])
Expand Down
6 changes: 3 additions & 3 deletions mobie/tables/default_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ def _compute_table_2d(seg_path, seg_key, resolution):
props = regionprops(seg)
tab = np.array([
[p.label]
+ [ce / res for ce, res in zip(centers[p.label], resolution)]
+ [float(bb) / res for bb, res in zip(p.bbox[:ndim], resolution)]
+ [float(bb) / res for bb, res in zip(p.bbox[ndim:], resolution)]
+ [ce * res for ce, res in zip(centers[p.label], resolution)]
+ [float(bb) * res for bb, res in zip(p.bbox[:ndim], resolution)]
+ [float(bb) * res for bb, res in zip(p.bbox[ndim:], resolution)]
+ [p.area]
for p in props
])
Expand Down
2 changes: 1 addition & 1 deletion mobie/validation/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def _dynamic_view_source_validation(view, sources, displays, assert_true):
if isinstance(display_sources, dict):
display_sources = [source for this_sources in display_sources.values() for source in this_sources]
wrong_sources = list(set(display_sources) - valid_sources)
msg = f"Found wrong sources {wrong_sources} in sourceDisplay"
msg = f"Found wrong sources {wrong_sources} in sourceDisplay: {display_metadata['name']}"
assert_true(len(wrong_sources) == 0, msg)


Expand Down

0 comments on commit edb2d9e

Please sign in to comment.