[Insight-users] ImageRegionType not an Object?

Luis Ibanez luis.ibanez at kitware.com
Wed, 24 Dec 2003 09:22:16 -0500


Hi Samson,

There are basically two types of classes in ITK:

A) Those that are reference counted
B) Those that are not

Classes in (A) use SmartPointers and are created
with the operator New(). All classes in this group
derive directly or indirectly from the itk::Object.

Classes in (B) are just like any typical C++ class.

Examples of ITK classes in (A) are

  - Image
  - ImageToImageFilter
  - ImageRegistrationMethod
  - Transforms
  - ImageMetrics

Examples of ITK classes in (B) are

  - Point
  - Vector
  - Index
  - Size
  - Array
  - Spacing
  - Origin
  - ImageRegion


There was a very pragmatic approach in the way
classes were selected to be put in (A) or (B).
Typically classes in (B) are relatively small
(in their size in bytes) and simple to construct.
In those cases the overload of using reference
counting and SmartPointers was an overkill.
For example, we definitely don't want to have
reference counting in the itk::Point class, since
we anticipate to create thousands or millions of
them in order to represent anatomical shapes.

Images and filters on the other hand are fairly
large objects and we don't expect to have hundreds
of them in a single application.


Please let us know if you have further questions,



Thanks


     Luis


------------------------------------
Samson Timoner wrote:

> In ImageToImageMetric.h, FixedImageRegion uses a SetMacro
> rather than a SetObjectMacro:
> 
>   /** Set the region over which the metric will be computed */
>   itkSetMacro( FixedImageRegion, FixedImageRegionType );
> 
>   /** Get the region over which the metric will be computed */
>   itkGetConstMacro( FixedImageRegion, FixedImageRegionType );
> 
> I would have expected it to use a SetObjectMacro. Every other object around
> it in ImageToImageMetric uses a SetObjectMacro.  Is there some reason an
> ImageRegionType does not? Are ImageRegionType's not itkObjects?
> 
> Admittedly, it makes little different as in itkMacro.h, SetMacro and
> SetObjectMacro appear to be identical. But, I do not understand why every
> other Get/Set in ItkImageToImageMetric.h using Get/SetObject except that
> one.
> 
>  Thanks in advance,
> 
>  Happy Holidays,
> 
> -- Samson
> 
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk . org
> http://www . itk . org/mailman/listinfo/insight-users
>