-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Codes for Tutorial 03.Developer Foci, Neat Blanks & GUI Hello World
- Loading branch information
Showing
13 changed files
with
449 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
## <a href="./" style="text-decoration:none">Step 02: Interact, Debug & Pipeline</a> | ||
|
||
<img src="SL__Summary.png" alt="isolated" width="1080"/> | ||
<img src="sl_02__Summary.png" alt="isolated" width="1080"/> |
File renamed without changes
27 changes: 27 additions & 0 deletions
27
03__DeveloperFoci_NeatBlanks_&_GUI_HelloWorld/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
cmake_minimum_required(VERSION 3.16.3...3.19.7 FATAL_ERROR) | ||
|
||
project(SL_Tutorials) | ||
|
||
#----------------------------------------------------------------------------- | ||
# Extension meta-information | ||
set(EXTENSION_HOMEPAGE "https://www.slicer.org/wiki/Documentation/Nightly/Extensions/SL_Tutorials") | ||
set(EXTENSION_CATEGORY "Tutorials") | ||
set(EXTENSION_CONTRIBUTORS "Sen Li (ETS)") | ||
set(EXTENSION_DESCRIPTION "This is a series of tutorial for 3D Slicer Extension module development.") | ||
set(EXTENSION_ICONURL "https://www.example.com/Slicer/Extensions/SL_Tutorials.png") | ||
set(EXTENSION_SCREENSHOTURLS "https://www.example.com/Slicer/Extensions/SL_Tutorials/Screenshots/1.png") | ||
set(EXTENSION_DEPENDS "NA") # Specified as a list or "NA" if no dependencies | ||
|
||
#----------------------------------------------------------------------------- | ||
# Extension dependencies | ||
find_package(Slicer REQUIRED) | ||
include(${Slicer_USE_FILE}) | ||
|
||
#----------------------------------------------------------------------------- | ||
# Extension modules | ||
add_subdirectory(sl__GUI_HelloWorld) | ||
## NEXT_MODULE | ||
|
||
#----------------------------------------------------------------------------- | ||
include(${Slicer_EXTENSION_GENERATE_CONFIG}) | ||
include(${Slicer_EXTENSION_CPACK}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
## <a href="./" style="text-decoration:none">Step 03: Developer Foci, Neat Blanks & GUI Hello World</a> | ||
|
||
<img src="sl_03__Summary.png" alt="isolated" width="1080"/> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions
31
03__DeveloperFoci_NeatBlanks_&_GUI_HelloWorld/sl__GUI_HelloWorld/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#----------------------------------------------------------------------------- | ||
set(MODULE_NAME sl__GUI_HelloWorld) | ||
|
||
#----------------------------------------------------------------------------- | ||
set(MODULE_PYTHON_SCRIPTS | ||
${MODULE_NAME}.py | ||
) | ||
|
||
set(MODULE_PYTHON_RESOURCES | ||
Resources/Icons/${MODULE_NAME}.png | ||
Resources/UI/${MODULE_NAME}.ui | ||
) | ||
|
||
#----------------------------------------------------------------------------- | ||
slicerMacroBuildScriptedModule( | ||
NAME ${MODULE_NAME} | ||
SCRIPTS ${MODULE_PYTHON_SCRIPTS} | ||
RESOURCES ${MODULE_PYTHON_RESOURCES} | ||
WITH_GENERIC_TESTS | ||
) | ||
|
||
#----------------------------------------------------------------------------- | ||
if(BUILD_TESTING) | ||
|
||
# Register the unittest subclass in the main script as a ctest. | ||
# Note that the test will also be available at runtime. | ||
slicer_add_python_unittest(SCRIPT ${MODULE_NAME}.py) | ||
|
||
# Additional build-time testing | ||
add_subdirectory(Testing) | ||
endif() |
Binary file added
BIN
+4.75 KB
...anks_&_GUI_HelloWorld/sl__GUI_HelloWorld/Resources/Icons/sl__GUI_HelloWorld.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
90 changes: 90 additions & 0 deletions
90
...perFoci_NeatBlanks_&_GUI_HelloWorld/sl__GUI_HelloWorld/Resources/UI/sl__GUI_HelloWorld.ui
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>t_ApplyThreshold</class> | ||
<widget class="qMRMLWidget" name="t_ApplyThreshold"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>314</width> | ||
<height>331</height> | ||
</rect> | ||
</property> | ||
<layout class="QVBoxLayout" name="verticalLayout"> | ||
<item> | ||
<widget class="QPushButton" name="pushButton_HelloWorld"> | ||
<property name="styleSheet"> | ||
<string notr="true">QPushButton#pushButton_HelloWorld { | ||
background-color: none; | ||
border-style: outset; | ||
border-width: 1.2px; | ||
border-radius: 10px; | ||
border-color: black; | ||
font: bold; | ||
min-width: 8em; | ||
padding: 3px; | ||
} | ||
QPushButton#pushButton_HelloWorld:pressed { | ||
background-color: rgb(110, 125, 0); | ||
border-style: outset; | ||
border-width: 1.2px; | ||
border-radius: 10px; | ||
border-color: black; | ||
font: bold; | ||
min-width: 8em; | ||
padding: 3px; | ||
} | ||
QPushButton#pushButton_HelloWorld:hover { | ||
background-color: rgb(225, 255, 0); | ||
border-style: outset; | ||
border-width: 1.2px; | ||
border-radius: 10px; | ||
border-color: black; | ||
font: bold; | ||
min-width: 8em; | ||
padding: 3px; | ||
} | ||
|
||
QPushButton#pushButton_HelloWorld:hover:pressed{ | ||
background-color: rgb(110, 125, 0); | ||
border-style: outset; | ||
border-width: 1.2px; | ||
border-radius: 10px; | ||
border-color: black; | ||
font: bold; | ||
min-width: 8em; | ||
padding: 3px; | ||
} | ||
</string> | ||
</property> | ||
<property name="text"> | ||
<string>Say hello by clicking QPushButton</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<spacer name="verticalSpacer"> | ||
<property name="orientation"> | ||
<enum>Qt::Vertical</enum> | ||
</property> | ||
<property name="sizeHint" stdset="0"> | ||
<size> | ||
<width>20</width> | ||
<height>40</height> | ||
</size> | ||
</property> | ||
</spacer> | ||
</item> | ||
</layout> | ||
</widget> | ||
<customwidgets> | ||
<customwidget> | ||
<class>qMRMLWidget</class> | ||
<extends>QWidget</extends> | ||
<header>qMRMLWidget.h</header> | ||
<container>1</container> | ||
</customwidget> | ||
</customwidgets> | ||
<resources/> | ||
<connections/> | ||
</ui> |
1 change: 1 addition & 0 deletions
1
03__DeveloperFoci_NeatBlanks_&_GUI_HelloWorld/sl__GUI_HelloWorld/Testing/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
add_subdirectory(Python) |
2 changes: 2 additions & 0 deletions
2
...eveloperFoci_NeatBlanks_&_GUI_HelloWorld/sl__GUI_HelloWorld/Testing/Python/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
#slicer_add_python_unittest(SCRIPT ${MODULE_NAME}ModuleTest.py) |
Oops, something went wrong.