Skip to content

Commit 604d4d0

Browse files
committed
Correct logic for 180-degree projection handling in _post_filter method
1 parent 5e6fadf commit 604d4d0

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2222: Monitor normalisation: RuntimeError: No logfile available for this stack.

mantidimaging/core/operations/base_filter.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class BaseFilter:
2828
link_histograms = False
2929
show_negative_overlay = True
3030
operate_on_sinograms = False
31+
allow_for_180_projection = True
3132

3233
SINOGRAM_FILTER_INFO = "This filter will work on a\nsinogram view of the data."
3334

mantidimaging/core/operations/monitor_normalisation/monitor_normalisation.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class MonitorNormalisation(BaseFilter):
3131
"""
3232
filter_name = "Monitor Normalisation"
3333
link_histograms = True
34+
allow_for_180_projection = False
3435

3536
@staticmethod
3637
def filter_func(images: ImageStack, progress=None) -> ImageStack:

mantidimaging/gui/windows/operations/presenter.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -275,12 +275,15 @@ def _post_filter(self, updated_stacks: list[ImageStack], task):
275275
# otherwise check with user which one to keep
276276
if self.view.safeApply.isChecked():
277277
use_new_data = self._wait_for_stack_choice(stack, stack.id)
278-
# if the stack that was kept happened to have a proj180 stack - then apply the filter to that too
279-
if stack.has_proj180deg() and use_new_data and not self.applying_to_all:
280-
# Apply to proj180 synchronously - this function is already running async
281-
# and running another async instance causes a race condition in the parallel module
282-
# where the shared data can be removed in the middle of the operation of another operation
283-
self._do_apply_filter_sync([stack.proj180deg])
278+
# if the stack that was kept happened to have a proj180 stack - apply the filter to that too
279+
if self.model.selected_filter.allow_for_180_projection:
280+
# Apply to proj180 synchronously if necessary
281+
if use_new_data and not self.applying_to_all and stack.has_proj180deg():
282+
# Apply to proj180 synchronously - this function is already running async
283+
# and running another async instance causes a race condition in the parallel module
284+
# where the shared data can be removed in middle of the operation of another operation
285+
self._do_apply_filter_sync([stack.proj180deg])
286+
284287
if np.any(stack.data < 0):
285288
negative_stacks.append(stack)
286289

0 commit comments

Comments
 (0)