ITK/Examples/Instructions/ForDevelopers
The success of the ITK Wiki Examples depends on the contributions from the ITK user community. If you wish to contribute to this valuable resource, please follow these guidelines. If you are a Wiki Example User, go here or a Wiki Example Administrator go here.
Create an Example
C++, Tcl, Python and Java examples are welcome. Examples should illustrate a single concept.
Follow the Coding Guidelines
When you write an example, please follow the coding guidelines. Create the example on your local system, compile and run it before you store it on the wiki.
Choose a Topic
The examples are organized by topic. Current topics include etc.
Create a Wiki Page
- If you don't already have a account, create an account or login to an existing account.
- Go to the page for the language of the example
- Click "Edit" in the topic section where you want to add an example.
- Create a new page and a link to the new page by adding:
What you want to display as the link
- When you save these changes, there be a red link. When you click this link, it immediately brings you to the "Edit" page of the new page.
- Add the content and save it.
- The link automatically turns blue (so it now goes to the "page" page instead of the "edit" page).
- Precede the code with a heading defines the filename of the example. Ensure there are no spaces between the == and the filename. The name is important!. When the example is stored in the Wiki Examples source code repository, it will have this filename and reside in the Topic directory.
==MyExample.cxx==
- Wrap code in tags for the language used in the example (cpp,tcl,py,java).
<source lang="cpp"> // your code here </source>
- Please add your name to the comments of the source code.
- Always also post a CMakeLists.txt file so that other users will know which libraries are required.
There are two templates available that will generate proper CmakeLists.txt files. Place one of these at the bottom of the wiki page.
- Examples that only contain ITK classes.
{{ITKCMakeLists|MyExample}}
- Examples that use ITK and VTK classes.
{{ITKVTKCMakeLists|MyExample|Additional Libraries}}
- The "Show preview" button at the bottom next to "Save page" is a good idea - it will let you play around with things and see what they look like without actually uploading them to the wiki. When you are satisfied, you can then click "Save page".
- Look at one of the existing example pages for guidance.
Check the Nightly Dashboard
If the example is a C++ program, the example should show up on the Nightly Dashboard the morning after you edit the wiki page..