You are on page 1of 1

The image class is at the heart of SimpleITK.

It is the most commonly used class and has


been specially designed to provide a natural and intuitive user interface across multiple
target languages. We followed our principles for intuitive interface driven design by
writing numerous example code blocks and discussing tradeoffs with the ARB.

From an interface perspective, the handling of the life of an object, i.e., how the object is
constructed, copy and destroyed, is a key aspect of developing an intuitive interface.
Because we chose not to expose smart pointers, we use a completely different approach
from ITK's New factory method. Our approach is simple and translates to other
languages seamlessly. We simply directly expose the Image class's constructors and
destructor without the restrictions applied in ITK. The reasons ITK uses the New factory
method include: adding flexibility to override a class' implementation and enforcing
smart pointers use by preventing stack based allocation. Our approach to the SimpleITK
interface does not allow our classes to be directly overridden but still allows ITK class
overrides to occur internally. As we encourage the direct use of our Image class, the
smart pointer motivation is moot as well. An Image is able to be default constructed, as
an image of size zero. An image of any dimension or pixel type is considered to be empty
if its size is zero. The common constructor methods take parameters for the size of the
image along with the pixel type and support the option for the number of components
per pixel. The dimension of the image is determined by the number of components used
for size. How Images are copied is closely related to their constructors, but the
relationship between the SimpleITK interface and ITK objects needs to be described
first.

You might also like