Skip to content

Commit

Permalink
Studio: Create dataset ROI folder during export if it does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesdolezal committed Jan 24, 2024
1 parent b9982f4 commit 326cc59
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions slideflow/studio/widgets/roi.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import imgui
import numpy as np
import glfw
from os.path import join
import os
from os.path import join, exists
from shapely.geometry import Point
from shapely.geometry import Polygon
from tkinter.filedialog import askopenfilename
Expand Down Expand Up @@ -503,7 +504,10 @@ def draw_options(self):

# Save button.
if viz.sidebar.large_image_button('floppy', size=viz.font_size*3):
dest = viz.wsi.export_rois(self.get_roi_dest(viz.wsi.name))
roi_folder = self.get_roi_dest(viz.wsi.name)
if not exists(roi_folder):
os.makedirs(roi_folder)
dest = viz.wsi.export_rois()
viz.create_toast(f'ROIs saved to {dest}', icon='success')
self.reset_edit_state()
if imgui.is_item_hovered():
Expand Down

0 comments on commit 326cc59

Please sign in to comment.