Skip to content

Commit 7928e11

Browse files
Provide Additional User Context
Now it should be more obvious when the MIP display is not enabled, who to use it.
1 parent 3f205db commit 7928e11

File tree

2 files changed

+27
-6
lines changed

2 files changed

+27
-6
lines changed

src/navigate/controller/sub_controllers/camera_view.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1647,7 +1647,8 @@ def try_to_display_image(self, image: np.ndarray) -> None:
16471647
if self.image_mode in ["live", "single"]:
16481648
return
16491649

1650-
if self.display_enabled.get() is False:
1650+
if not self.display_enabled.get():
1651+
self._clear_mip()
16511652
return
16521653

16531654
# Orthogonal maximum intensity projections.
@@ -1661,6 +1662,20 @@ def try_to_display_image(self, image: np.ndarray) -> None:
16611662

16621663
super().try_to_display_image(image)
16631664

1665+
def _clear_mip(self) -> None:
1666+
"""Clear the mip but keep canvas interactive."""
1667+
self.canvas.delete("all")
1668+
self.tk_image = None
1669+
self.canvas.create_text(
1670+
self.canvas_width // 2,
1671+
self.canvas_height // 2,
1672+
text="Maximum Intensity Projection Disabled\nRight Click to Enable",
1673+
font=("Arial", 14, "italic"),
1674+
fill="gray",
1675+
anchor="center",
1676+
justify="center",
1677+
)
1678+
16641679
def display_image(self, image: np.ndarray) -> None:
16651680
"""Display an image using the LUT specified in the View.
16661681

src/navigate/controller/sub_controllers/histogram.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ def __init__(self, histogram: HistogramFrame, parent_controller: Any) -> None:
160160
def update_experiment(self) -> None:
161161
"""Update the experiment.yaml file. Also communicate any changes to the menu
162162
controller."""
163-
print("histogram controller updated the experiment.yaml file")
164163
# Get the state of the histogram enabled variable.
165164
histogram_state = self.histogram_enabled.get()
166165

@@ -268,12 +267,19 @@ def _clear_histogram(self) -> None:
268267
"""Clear the histogram but keep canvas interactive."""
269268
self.ax.cla()
270269
self.ax.text(
271-
0.5,
272-
0.5,
273-
"Histogram Disabled\nRight Click to Enable",
274-
fontstyle="italic",
270+
x=0.5,
271+
y=0.5,
272+
s="Intensity Histogram Disabled\nRight Click to Enable",
273+
fontdict={
274+
"family": "Arial",
275+
"size": 10,
276+
"style": "italic",
277+
"color": "gray",
278+
},
279+
# fontstyle="italic",
275280
ha="center",
276281
va="center",
282+
bbox=dict(facecolor="white", edgecolor="none", boxstyle="round,pad=0.5"),
277283
transform=self.ax.transAxes,
278284
)
279285
self.ax.set_xticks([])

0 commit comments

Comments
 (0)