Skip to content

Commit

Permalink
Fix post-detection particle display
Browse files Browse the repository at this point in the history
Fixes particles not being displayable post-detection.
See #94.
  • Loading branch information
a-niem committed Jul 23, 2024
1 parent 1eb0404 commit 0273b46
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
8 changes: 7 additions & 1 deletion RodTracker/src/RodTracker/backend/rod_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,13 @@ def add_data(self, data: pd.DataFrame):
cols_pos_3d = [
col for col in columns if re.fullmatch(RE_3D_POS, col)
]
self.cols_2D = [*cols_pos_2d, *cols_seen, "particle", "frame"]
self.cols_2D = [
*cols_pos_2d,
*cols_seen,
"particle",
"frame",
"color",
]
self.cols_3D = [*cols_pos_3d, "particle", "frame", "color"]

# Display as a tree
Expand Down
3 changes: 2 additions & 1 deletion RodTracker/src/RodTracker/ui/rodimagewidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -1273,7 +1273,8 @@ def extract_rods(self, data: pd.DataFrame, color: str) -> None:
data = data[col_list]
except KeyError:
_logger.info(
f"Couldn't extract rods. Didn't find columns: " f"{col_list}"
f"Couldn't extract rods. Didn't find all necessary columns: "
f"{col_list}"
)
del self.rods
return
Expand Down
2 changes: 1 addition & 1 deletion RodTracker/src/RodTracker/ui/view3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def update_rods(self, data: pd.DataFrame) -> None:
*mpl_colors.to_rgba(color, alpha=1.0)
)
except ValueError as e:
_logger.error(
_logger.warning(
f"Unknown color for 3D display!\n{e.args}\n"
f"Using 'pink' instead."
)
Expand Down

0 comments on commit 0273b46

Please sign in to comment.