Skip to content

Commit

Permalink
Add additional check for dicom cenversion and img viewer
Browse files Browse the repository at this point in the history
  • Loading branch information
gurayerus committed Dec 10, 2024
1 parent f95216d commit 34e7750
Showing 1 changed file with 22 additions and 19 deletions.
41 changes: 22 additions & 19 deletions src/viewer/pages/prep_sMRI_dicomtonifti.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,25 +328,28 @@ def panel_view() -> None:

with st.spinner("Wait for it..."):

# Prepare final 3d matrix to display
img = utilni.prep_image(st.session_state.paths["sel_img"])

# Detect mask bounds and center in each view
img_bounds = utilni.detect_img_bounds(img)

# Show images
blocks = st.columns(len(list_orient))
for i, tmp_orient in stqdm(
enumerate(list_orient),
desc="Showing images ...",
total=len(list_orient),
):
with blocks[i]:
ind_view = utilni.img_views.index(tmp_orient)
size_auto = True
utilst.show_img3D(
img, ind_view, img_bounds[ind_view, :], tmp_orient, size_auto
)
try:
# Prepare final 3d matrix to display
img = utilni.prep_image(st.session_state.paths["sel_img"])

# Detect mask bounds and center in each view
img_bounds = utilni.detect_img_bounds(img)

# Show images
blocks = st.columns(len(list_orient))
for i, tmp_orient in stqdm(
enumerate(list_orient),
desc="Showing images ...",
total=len(list_orient),
):
with blocks[i]:
ind_view = utilni.img_views.index(tmp_orient)
size_auto = True
utilst.show_img3D(
img, ind_view, img_bounds[ind_view, :], tmp_orient, size_auto
)
except:
st.warning(':material/thumb_down: Image parsing failed. Please confirm that the image file represents a 3D volume using an external tool.')

def panel_download() -> None:
"""
Expand Down

0 comments on commit 34e7750

Please sign in to comment.