Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion plugins/slicer/MONAILabel/MONAILabel.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,10 +479,26 @@ def updateGUIFromParameterNode(self, caller=None, event=None):

if self.models and [k for k, v in self.models.items() if v["type"] == "segmentation"]:
self.ui.segmentationCollapsibleButton.collapsed = False
self.ui.segmentationCollapsibleButton.show()
else:
self.ui.segmentationCollapsibleButton.hide()

if self.models and [k for k, v in self.models.items() if v["type"] in ("deepgrow", "deepedit")]:
self.ui.deepgrowCollapsibleButton.collapsed = False
self.ui.deepgrowCollapsibleButton.show()
else:
self.ui.deepgrowCollapsibleButton.hide()

if self.models and [k for k, v in self.models.items() if v["type"] == "scribbles"]:
self.ui.scribblesCollapsibleButton.collapsed = False
self.ui.scribblesCollapsibleButton.show()
else:
self.ui.scribblesCollapsibleButton.hide()

if self.info.get("trainers", {}):
self.ui.aclCollapsibleButton.show()
else:
self.ui.aclCollapsibleButton.hide()
Comment on lines +498 to +501

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SachidanandAlle, we are running two segmentation apps that do not make use of any trainers.

With these code changes our workflow of using MONAILabel to segment images from scratch or to use pre-segmentations does not work any more because the buttons 'Next Sample' and 'Submit Sample' are not available any more.

I can understand the rationale behind these code changes but for our use case it doesn't work. Is it possible to discuss these code changes? Thanks.

@SachidanandAlle SachidanandAlle May 5, 2022

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are correct.. it was a bug.. we should only hide training part and not fetch/submit actions..
this PR should solve the problem.. #769

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the quick fix.


self.ui.labelComboBox.clear()
if self._segmentNode:
Expand Down Expand Up @@ -1226,7 +1242,7 @@ def onUploadImage(self, init_sample=True, session=False):
"Server Error:: Session creation Failed\nPlease upgrade to latest monailable version (> 0.2.0)",
detailedText=traceback.format_exc(),
)
self.current_sample["session_id"] = None
self.current_sample["session"] = None
else:
slicer.util.errorDisplay("Failed to upload volume to Server", detailedText=traceback.format_exc())
return False
Expand Down
6 changes: 3 additions & 3 deletions plugins/slicer/MONAILabel/Resources/UI/MONAILabel.ui
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@
<item row="0" column="0">
<widget class="QLabel" name="label_10">
<property name="text">
<string>Train:</string>
<string>Model:</string>
</property>
</widget>
</item>
Expand All @@ -237,7 +237,7 @@
<item>
<widget class="QPushButton" name="trainingButton">
<property name="text">
<string>Run</string>
<string>Train</string>
</property>
</widget>
</item>
Expand Down Expand Up @@ -365,7 +365,7 @@
<string>SmartEdit / Deepgrow</string>
</property>
<property name="collapsed">
<bool>false</bool>
<bool>true</bool>
</property>
<property name="collapsedHeight">
<number>9</number>
Expand Down