Skip to content

Commit

Permalink
Issue #58
Browse files Browse the repository at this point in the history
  • Loading branch information
KorenMary committed Mar 17, 2024
1 parent 773df7e commit 9a67bea
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
31 changes: 31 additions & 0 deletions src/client/dcp_client/gui/napari_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,37 @@ def __init__(self, app: Application) -> None:

self.setLayout(layout)

remove_from_dataset_button = QPushButton('Remove from dataset')
remove_from_dataset_button.setStyleSheet(
"""QPushButton
{
background-color: #0064A8;
font-size: 12px;
font-weight: bold;
color: #D1D2D4;
border-radius: 5px;
padding: 8px 16px; }"""
"QPushButton:hover { background-color: #006FBA; }"
"QPushButton:pressed { background-color: #006FBA; }"

)
layout.addWidget(remove_from_dataset_button, 3, 0, 1, 4)
remove_from_dataset_button.clicked.connect(self.on_remove_from_dataset_button_clicked)

def on_remove_from_dataset_button_clicked(self) -> None:
"""
Defines what happens when the "Remove from dataset" button is clicked.
"""
seg_name_to_remove = self.viewer.layers.selection.active.name
if seg_name_to_remove:
# Delete the image and corresponding masks from the dataset
image_name = self.app.cur_selected_img
seg_files_to_remove = [seg_name_to_remove + '.tiff']
self.app.delete_images([image_name] + seg_files_to_remove)

self.viewer.close()
self.close()

def set_editable_mask(self) -> None:
"""
This function is not implemented. In theory the use can choose between which mask to edit.
Expand Down
3 changes: 1 addition & 2 deletions src/client/dcp_client/gui/welcome_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,7 @@ def eventFilter(self, obj, event):


def browse_inprogr_clicked(self):
'''
Activates when the user clicks the button to choose the curation in progress directory (QFileDialog) and
"""Activates when the user clicks the button to choose the curation in progress directory (QFileDialog) and
displays the name of the evaluation directory chosen in the validation textbox line (QLineEdit).
"""

Expand Down

0 comments on commit 9a67bea

Please sign in to comment.