[Insight-developers] PLEASE READ: Major changes to toolkit.
Brad King
brad.king at kitware.com
Wed Jun 28 10:47:42 EDT 2000
Hello Everyone,
Well, I have just finished updating the CVS repository with the new
arrangement of the toolkit. IT IS NOW OKAY to update to the
latest version and continue development. Here are the changes that have
been made:
1.) All classes have been moved into the "itk" namespace. Their names
have had the "itk" prefix removed..."itkObject" is now
"itk::Object". Remember that within the namespace, code should not use
the "itk::" prefix, so it should not be added to any code in the
toolkit. However, as shown in the test examples (Testing/Code/Common),
any code using the classes in the toolkit must use the namespace prefix.
Note also that the "itk" prefix still exists on all file names to indicate
that the classes are defined in the itk name space. Any #define'd macros
or constants also have the itk prefix in place since the pre-processor
doesn't know about namespaces.
2.) The file "itkSetGet.h" has now been renamed "itkMacro.h" because it
contains much more than the itkSetMacro and itkGetMacro. Most
importantly, it now has "itkNewMacro" which takes a class name and creates
the "static Pointer New()" method. This macro should be used in a class
definition instead of the hand-coded New() method. Note that the new
style guide includes the use of a "Self" typedef within each class
representing its own type. Therefore, all that is needed to put a
"New()" method in a class is to have the line "itkNewMacro(Self);". This
change has been made in all classes currently in the toolkit.
3.) Any template class whose members were defined in a .cxx file that was
included in the .h file inside a "#ifndef ITK_MANUAL_INSTANTIATION" block
has now had its .cxx file changed to a .txx extension. Do not worry when
your cvs update removes all those .cxx files, they are replaced with the
.txx versions. The .txx name is used because it indicates that the file
is not actually compiled to an object. Please use this convention for any
new template class defninitions.
4.) Much of the non-conforming code style has been fixed. Some classes
still need to be updated, and I would request that the original authors of
these classes read the style guide and make the updates:
itk::Registrator3D2D* (some have been done, others have not)
itk::ProcessObject (comments are not yet in doxygen style)
itk::Win32OutputWindow (comments are not yet in doxygen style)
itk::FilterImageGaussian* (comments and indentation have been mostly
fixed, but the member names must have the
m_ prefix added)
In addition to these classes, there is a more general style change that
must be made on most classes. Please read the style guide for template
classes. Make note of the use of "typename" in place of "class" in
template parameters, and the "typedef TSomeName SomeName" rule for
saving template parameters internally to each class (the typedef'd names
should be used instead of the template parameter name wherever possible).
A note about itk::Image and the new name of itk::Index: The line
typedef Index<TImageDimension> Index;
appears in the definition of the Image class. Although having the
internal name "Index" override the templated form is allowed by C++,
Microsoft Visual C++ does not behave correctly. Either the main
"Index" class (formerly "itkIndex") must be renamed, or the internal type
needs a new name.
Finally, since the tests in Testing/Code/Common do not cause 100% of the
templated code to be instantiated (and therefore compiled), I'm not
totally sure everything has been changed correctly. If anyone runs into
problems, it should be pretty clear how to remove the prefix.
Thanks for your patience,
-Brad King
More information about the Insight-developers
mailing list