Skip to content

Commit

Permalink
Add Codes for Tutorial 03.Developer Foci, Neat Blanks & GUI Hello World
Browse files Browse the repository at this point in the history
  • Loading branch information
SenonETS committed Oct 4, 2022
1 parent 1b5b2f6 commit 60719e6
Show file tree
Hide file tree
Showing 13 changed files with 449 additions and 2 deletions.
2 changes: 1 addition & 1 deletion 02__Interact_Debug_&_Pipeline/README.md
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"/>
27 changes: 27 additions & 0 deletions 03__DeveloperFoci_NeatBlanks_&_GUI_HelloWorld/CMakeLists.txt
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})
3 changes: 3 additions & 0 deletions 03__DeveloperFoci_NeatBlanks_&_GUI_HelloWorld/README.md
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.
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()
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
add_subdirectory(Python)
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

#slicer_add_python_unittest(SCRIPT ${MODULE_NAME}ModuleTest.py)
Loading

0 comments on commit 60719e6

Please sign in to comment.