From f5a38d7c38069e358c94bf6ad3674deaec46d742 Mon Sep 17 00:00:00 2001 From: gurayerus Date: Mon, 16 Sep 2024 09:41:44 -0400 Subject: [PATCH] Fix bug: when user views some of the orientations slice selection was incorrect --- src/NiChart_Viewer/src/pages/view_img.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/NiChart_Viewer/src/pages/view_img.py b/src/NiChart_Viewer/src/pages/view_img.py index f57d411f..0353ee07 100644 --- a/src/NiChart_Viewer/src/pages/view_img.py +++ b/src/NiChart_Viewer/src/pages/view_img.py @@ -225,10 +225,6 @@ def prep_images(f_img, f_mask, sel_roi_ind, dict_derived): # View hide overlay is_show_overlay = st.checkbox('Show overlay', True) - # Print the selected options (optional) - if list_orient: - st.write("Selected options:", list_orient) - # Select roi index sel_roi_ind = dict_roi[sel_roi] @@ -250,10 +246,11 @@ def prep_images(f_img, f_mask, sel_roi_ind, dict_derived): blocks = st.columns(len(list_orient)) for i, tmp_orient in enumerate(list_orient): with blocks[i]: + ind_view = VIEWS.index(tmp_orient) if is_show_overlay == False: - show_nifti(img, tmp_orient, mask_bounds[i,:]) + show_nifti(img, tmp_orient, mask_bounds[ind_view,:]) else: - show_nifti(img_masked, tmp_orient, mask_bounds[i,:]) + show_nifti(img_masked, tmp_orient, mask_bounds[ind_view,:]) else: if not os.path.exists(f_img):