Guidelines for developers

From elastix
Jump to: navigation, search

This page contains information for elastix-developers.

The SVN repository

The elastix source code is stored in a subversion (SVN) repository. See the SVN book for information on SVN. Currently, there are only a few people who have write access to the SVN repository of elastix. You need a username and password to login to the repository.

Repository URL:

https://svn.bigr.nl/elastix/

The repository has a slightly different directory-naming scheme than most svn repositories:

   trunkpublic/
   tagspublic/
   branches/

The trunkpublic folder contains the most up-to-date 'working' version of elastix. The tagspublic folder contains releases. Both trunkpublic and tagspublic can be read by everyone. The branches folder can only be read (and modified) by developers and contains new experimental code.

To access the trunkpublic folder use the following command:

   svn co --username elastixguest --password elastixguest https://svn.bigr.nl/elastix/trunkpublic <your-elastix-dir>

To download a tagged release version, use the following command:

   svn co --username elastixguest --password elastixguest https://svn.bigr.nl/elastix/tagspublic/elastix_XX_X <your-elastix-dir>

Where XX_X is the version number. The first two digits are the major version number and the last one is the minor version number. For example, version 4.5 become 04_5.

You can also use your browser to inspect the code. Go to https://svn.bigr.nl/elastix/trunkpublic or https://svn.bigr.nl/elastix/tagspublic.

Committing changes

All text files that are checked in should have set the following svn property:

svn:eol-style native

This makes sure that if you check out elastix on a unix-based platform, the text files are converted to unix text format, and if you check out elastix on a windows-based platform, the text files are converted to dos text format. Using command-line SVN, you can set/get/list the svn properties of a file using the following commands, respectively:

   svn propset <key> <value> <filename>
   svn propget <key> <filename>
   svn proplist -v <filename>

Using Tortoise SVN it's also possible. First add a file to the repository, then select TortoiseSVN->Properties->New->Property name = svn:eol-style, and enter native in the Property value box.

When you commit something, add a text message describing clearly what you changed and why. The following example explains the tags that we use, and illustrates the general layout of a commit message:

   -ADD: mention files that you added to the repository
   -DEL: mention files that you deleted from the repository.
   -ENH: mention functional enhancements of the code.
   -BUG: mention bugfixes.
   -DOC: mention modifications of documentation (comments in the code, changes to the manual)
   -STY: mention changes in the layout style of the code.
   -VER: if you increased the elastix version (defined in elxBaseComponent.h), mention it here.
   -TAG: if you generated a tag, by copying the trunk folder to a subfolder of the tags folder, mention it here.

Coding style

Some rules:

  • Expand tabs to spaces before you commit your changes. This ensures a consistent layout of the code on different text editors.
  • Use /** ... */ style documentation.
  • Member variables of classes should start their name with m_. For example: m_NumberOfIterations.
  • Type definitions should start with a capital. ImageType for example, instead of imageType.
Personal tools