Doxygen
Basics
This page is for notes on using Doxygen to document the Freesurfer source code.
Doxygen, http://www.stack.nl/~dimitri/doxygen/index.html, is a documentation system for C++, C, Java, and some other weird languages. It can generate html docs documenting a projects source code, by either extracting special tags from the source code (put there by people wanting to make use of doxygen), or doxygen attempts to build documentation from existing source.
Doxygen seems to be installed on the NMR systems, type:
doxygen --version
Step 1 in using doxygen is the creation of a config file. A default is created by typing:
doxygen -g
which creates a file called Doxygen.
For Freesurfer, a config file called Doxygen has been created and commited to CVS, and appears at the root directory after a CVS update.
The defaults that have been changed are the following:
20c20 < PROJECT_NAME = FreeSurfer --- > PROJECT_NAME = 33c33 < OUTPUT_DIRECTORY = ./doxygen --- > OUTPUT_DIRECTORY = 189c189 < OPTIMIZE_OUTPUT_FOR_C = YES --- > OPTIMIZE_OUTPUT_FOR_C = NO 462c462 < INPUT = utils --- > INPUT = 471c471 < FILE_PATTERNS = *.c *.cpp *.h --- > FILE_PATTERNS = 477c477 < RECURSIVE = YES --- > RECURSIVE = NO 489c489 < EXCLUDE_SYMLINKS = YES --- > EXCLUDE_SYMLINKS = NO
These changes are preliminary. Notice just the utils directory is marked to be processed. Because virtually none of the freesurfer source files have any doxygen tags, the html output produced by doxygen is mostly useless junk, or missing vast numbers of file.
To generate the html and latex docs, where $FSDEV is your CVS dev dir, type:
cd $FSDEV doxygen
The docs are put in the ./doxygen directory. See ./doxygen/html/index.html
Default file header
header could/should contain:
- filename
- module (see next section)
- brief description
- original author, or file owner (to contact in case of need for major changes)
- last edit author
- open-source license blrub with link
- ?
- ?
Modules
doxygen supports grouping things together: http://www.stack.nl/~dimitri/doxygen/grouping.html
what modules should be created for freesurfer? group by utility type? ie volume, surface, display
Comments and Suggestions
- Doesnt seem to allow documenting csh scripts
What special commands, http://www.stack.nl/~dimitri/doxygen/commands.html, are useful?
- \file
- \addtogroup
- Support for open-source community: example of well-documented source (using doxygen) that community can follow if they want to document the source (not making code changes)
- best approach is probably to build one file at a time, not try to 'auto-document' the whole code-base (resulting in useless documentation). start with, say, utils.h and the mri struct.
Status
- 8 March 2006 - the next step is to devise a basic header, and also to create a config file that generates docs for a few core files, with the intent to add files to be 'doygenated' as they are completed.