Skip to content

Commit

Permalink
Fix bug: when user views some of the orientations slice selection was…
Browse files Browse the repository at this point in the history
… incorrect
  • Loading branch information
gurayerus committed Sep 16, 2024
1 parent 7ec442e commit f5a38d7
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/NiChart_Viewer/src/pages/view_img.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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):
Expand Down

0 comments on commit f5a38d7

Please sign in to comment.