Wiki Example Administrators have write access to the git repository. Wiki Example Developers do not need write access to the repository since the definitive copy of the source code resides on the Wiki. If you are a Wiki Example User go here or a Wiki Example Developer go here.
Wiki Example Administrators maintain the CMakeLists.txt files, example input files, example regression baseline files and synchronization scripts.
The wiki examples are stored in a git repository hosted at github. The repository contains several types of files:
<source> and </source>into a file in the proper topic subdirectory. Anyone, including users, can run this script. It updates the current directory with changes or new examples. If you run this script, be sure to re-run cmake.
(Note the git@ instead of https:// as is listed on the Users instructions page)
git clone git@github.com:InsightSoftwareConsortium/ITKWikiExamples.git
mkdir MyTopic cd MyTopic
PROJECT (MyTopic) SET(KIT MyTopic) SET(KIT_LIBS itkHybrid) IF(NOT WikiExamples_BINARY_DIR) FIND_PACKAGE(ITK REQUIRED) INCLUDE(${ITK_USE_FILE}) ENDIF(NOT WikiExamples_BINARY_DIR) # # Build all .cxx files in the directory FILE(GLOB ALL_FILES *.cxx) foreach(SOURCE_FILE ${ALL_FILES}) STRING(REPLACE ".cxx" "" TMP ${SOURCE_FILE}) STRING(REPLACE ${CMAKE_CURRENT_SOURCE_DIR}/ "" EXAMPLE ${TMP}) ADD_EXECUTABLE(${EXAMPLE} ${EXAMPLE}.cxx) TARGET_LINK_LIBRARIES(${EXAMPLE} ${KIT_LIBS}) endforeach(SOURCE_FILE) # Testing INCLUDE(${WikiExamples_SOURCE_DIR}/CMake/ExamplesTesting.cmake)
ADD_SUBDIRECTORY(MyTopic)
cd .. git add MyTopic git add MyTopic/CMakeLists.txt git commit -m "ENH: Added topic MyTopic and CMakeLists.txt file." CMakeLists.txt MyTopic/CMakeLists.txt
git push
If you get an error, you should make sure your rsa key is uploaded to github and that you have done:
git config remote.origin.pushurl git@github.com:InsightSoftwareConsortium/ITKWikiExamples.git
By default, the CMakeLists.txt in a topic directory creates a small test driver for each .cxx file it finds. Then it creates an ADD_TEST command. The default ADD_TEST command assumes that the test has no arguments.
Some tests require arguments. To prevent the ADD_TEST from being generated, add any examples that require arguments to the list NEEDS_ARGS:
SET(NEEDS_ARGS Example1 Example2 ) INCLUDE(${WikiExamples_SOURCE_DIR}/CMake/ExamplesTesting.cmake)
Then, provide an ADD_TEST for each:
ADD_TEST(${KIT}-Example1 ${EXECUTABLE_OUTPUT_PATH}/${KIT}CxxTests TestExample1 arg1 arg2) ADD_TEST(${KIT}-Example2 ${EXECUTABLE_OUTPUT_PATH}/${KIT}CxxTests TestExample2 arg1 arg2 arg3)
Any example that uses a render window interactor will expect to find a baseline image for regression testing. The first time the test for the example is run, using ctest, the test will fail and report that a baseline image could not be found.
git add Testing/Baseline/Topic/TestExampleName.png git commit -m "ENH: Added baseline for TestExampleName regression test git push
ITK_Examples_Baseline_'Folder'_Test'TestName'.png
You must add this tag to the top of the example page:
<div class="floatright">[[File:ITK_Examples_Baseline_'Folder'_Test'TestName'.png]]</div>
An example is: <div class="floatright">[[File:ITK_Examples_Baseline_Filtering_TestLandmarkTransform.png]]</div>
We like to keep the example data to a small number of small files. If you must add input data for the tests:
git add Testing/Data/MyData.whatever git commit -m "ENH: Added new example input data." Testing/Data/Mydata.whatever git push
make Experimental
make Nightly
set(CTEST_SITE "BillsBasement")
Then you should comment one of these, depending on which type of build you would like to submit.
set(DASHBOARD Nightly) set(DASHBOARD Experimental)
0 23 * * * ctest -S /home/foo/WikiExamples.ctest -V &> /home/foo/WikiExamplesNightly.log
http://www.cdash.org/CDash/index.php?project=ITKWikiExamples
To create a patch with the latest example links added in the ITK header files (which turn into links in the Doxygen), use
./InsertDoxygenLink massive-set ../../ITK