Skip to content

Commit b8ac105

Browse files
Merge pull request #1110 from TheDeanLab/mip-display
Provide Additional User Context
2 parents 23e84ca + 7f95b2a commit b8ac105

File tree

2 files changed

+26
-6
lines changed

2 files changed

+26
-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
@@ -1670,7 +1670,8 @@ def try_to_display_image(self, image: np.ndarray) -> None:
16701670
if self.image_mode in ["live", "single"]:
16711671
return
16721672

1673-
if self.display_enabled.get() is False:
1673+
if not self.display_enabled.get():
1674+
self._clear_mip()
16741675
return
16751676

16761677
# Orthogonal maximum intensity projections.
@@ -1684,6 +1685,20 @@ def try_to_display_image(self, image: np.ndarray) -> None:
16841685

16851686
super().try_to_display_image(image)
16861687

1688+
def _clear_mip(self) -> None:
1689+
"""Clear the mip but keep canvas interactive."""
1690+
self.canvas.delete("all")
1691+
self.tk_image = None
1692+
self.canvas.create_text(
1693+
self.canvas_width // 2,
1694+
self.canvas_height // 2,
1695+
text="Maximum Intensity Projection Disabled\nRight Click to Enable",
1696+
font=("Arial", 14, "italic"),
1697+
fill="gray",
1698+
anchor="center",
1699+
justify="center",
1700+
)
1701+
16871702
def display_image(self, image: np.ndarray) -> None:
16881703
"""Display an image using the LUT specified in the View.
16891704

src/navigate/controller/sub_controllers/histogram.py

Lines changed: 10 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,18 @@ 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+
},
275279
ha="center",
276280
va="center",
281+
bbox=dict(facecolor="white", edgecolor="none", boxstyle="round,pad=0.5"),
277282
transform=self.ax.transAxes,
278283
)
279284
self.ax.set_xticks([])

0 commit comments

Comments
 (0)