[Insight-developers] itk::Image updates && SmartPointers == NULL
Luis Ibanez
ibanez@choroid.cs.unc.edu
Tue, 6 Nov 2001 08:40:59 -0500 (EST)
Damion,
Smart Pointers are constructed by default using internal 0x0000
values, so you are not required to initialize them with NULL.
This is one of the many nice features of SmartPointers.
the itk::SmartPointer implementation also allows to test for
initialization by using a C-like style:
SmartPointer<myType> pointer;
if( pointer ) { // the pointer is initialized }
if( !pointer ) { // the pointer is not initialized }
The tests for NULL in itkImage.txx were replaced by short
if( !pointer ) tests. If you have a chance, please check
that this produce the results that you want with your
code.
Thanks
Luis
----------------------------------
On Mon, 5 Nov 2001, Damion Shelton wrote:
> Wilson and I made the changes to itk::Image discussed earlier (as a
> temporary solution until a stable TransformBase exists). A few pieces of
> additional info:
>
> GetIndexToPhysicalTransform and GetPhysicalToIndexTransform are no longer
> const functions. They now have the ability to create transforms (stored as
> private members of the class) if none exist when a transform is requested.
> If a transform pointer exists when the function is called, it is not
> modified.
>
> TransformPhysicalPointToContinuousIndex and
> TransformContinuousIndexToPhysicalPoint now rely on cached values of the
> transforms, rather than recomputing the transform each time. Additionally,
> I had some problems with the existing version of this function, due to the
> constructor of AffineTransform being protected (a normal instance of the
> transform was created rather than ::New() ). This is now resolved, since
> the transforms are stored as pointers.
>
> We are also thinking of adding the following functions:
>
> TransformPhysicalPointToDiscreteIndex
> TransformDiscreteIndexToPhysicalPoint
>
> which would allow you to use normal indices rather than continuous indices.
> I am currently truncating continuous indices to obtain normal ones in
> external code, which tends to look the same every time points are
> transformed. Any suggestions on whether or not the above two functions
> would be useful are welcome.
>
> Finally, I did a complete build of all tests and things seem to be fine,
> but let me know if there are any problems.
>
> -Damion-
>
>
>
>
> _______________________________________________
> Insight-developers mailing list
> Insight-developers@public.kitware.com
> http://public.kitware.com/mailman/listinfo/insight-developers
>
--
Luis Ibanez CB#: 7060
Research Assistan Professor phone: (919) 843 5436
Division of Neurosurgery fax: (919) 966 6627
University of North Carolina at Chapel Hill email: ibanez@cs.unc.edu
Chapel Hill, NC 27599-7060 http://www.cs.unc.edu/~ibanez