Skip to content

Commit

Permalink
Merge 56e167a into 4d2ef3e
Browse files Browse the repository at this point in the history
  • Loading branch information
JackEAllen committed May 29, 2024
2 parents 4d2ef3e + 56e167a commit 437bcf2
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
1 change: 1 addition & 0 deletions docs/release_notes/next/feature-2206-recon_file_naming
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#2206: Improve output naming for reconstructed slices and volumes
2 changes: 1 addition & 1 deletion mantidimaging/core/reconstruct/cil_recon.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,6 @@ def full(images: ImageStack,

def allowed_recon_kwargs() -> dict[str, list[str]]:
return {
'CIL: PDHG-TV':
'CIL_PDHG-TV':
['alpha', 'num_iter', 'non_negative', 'stochastic', 'projections_per_subset', 'regularisation_percent']
}
9 changes: 7 additions & 2 deletions mantidimaging/gui/windows/recon/presenter.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,10 @@ def _on_stack_reconstruct_slice_done(self, task: TaskWorkerThread):
slice_idx = self._get_slice_index(None)
if images is not None:
assert self.model.images is not None
images.name = "Recon"
filter_name = self.view.recon_params().filter_name
algorithm_name = self.view.recon_params().algorithm
images.name = f"Recon_Slice_{algorithm_name}"
images.name = f"{images.name}_{filter_name}" if filter_name else images.name
self._replace_inf_nan(images) # pyqtgraph workaround
self.view.show_recon_volume(images, self.model.stack_id)
images.record_operation('AstraRecon.single_sino',
Expand Down Expand Up @@ -349,7 +352,9 @@ def _on_volume_recon_done(self, task) -> None:
try:
self._replace_inf_nan(task.result) # pyqtgraph workaround
assert self.model.images is not None
task.result.name = "Recon"
filter_name = self.view.recon_params().filter_name
task.result.name = f"Recon_Vol{self.view.recon_params().algorithm}"
task.result.name = f"{task.result.name}_{filter_name}" if filter_name else task.result.name
self.view.show_recon_volume(task.result, self.model.stack_id)
finally:
self.view.set_recon_buttons_enabled(True)
Expand Down
8 changes: 6 additions & 2 deletions mantidimaging/gui/windows/recon/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def __init__(self, main_window: MainWindowView):

self.algorithmName.insertItem(1, "FBP_CUDA")
self.algorithmName.insertItem(2, "SIRT_CUDA")
self.algorithmName.insertItem(3, "CIL: PDHG-TV")
self.algorithmName.insertItem(3, "CIL_PDHG-TV")
self.algorithmName.setCurrentIndex(1)
if not CudaChecker().cuda_is_present():
self.algorithmName.model().item(1).setEnabled(False)
Expand Down Expand Up @@ -388,7 +388,11 @@ def algorithm_name(self) -> str:

@property
def filter_name(self) -> str:
return self.filterName.currentText()
if not self.filterName.isEnabled():
self.filterName.currenText = ""
return self.filterName.currentText()
else:
return self.filterName.currentText()

@property
def num_iter(self) -> int:
Expand Down

0 comments on commit 437bcf2

Please sign in to comment.