Rigid3DTransform make error

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Rigid3DTransform make error

smrolfe
Hello,

I'd like to use the Rigid3DTransform but I'm getting an error when I try to create a new instance.  I commented out all the lines of my code expect for:

typedef itk::Rigid3DTransform<double> TransformType;
TransformType::Pointer  transform = TransformType::New(); 

The second line results in the following error:

/Users/smrolfe/build/LandmarkRegistration.cxx:132: error: conversion from ‘itk::SmartPointer<itk::MatrixOffsetTransformBase<double, 3u, 3u> >’ to non-scalar type ‘itk::SmartPointer<itk::Rigid3DTransform<double> >’ requested

It seems strange that just declaring a new instance of the filter would cause this error.  I've tried substituting in the Rigid2DTransform and that works just fine.  Please let me know if you have any ideas.

Thanks,
Sara


_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.html

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-users
Reply | Threaded
Open this post in threaded view
|

Re: Rigid3DTransform make error

David Doria-2
On Fri, Jan 6, 2012 at 5:47 PM, Sara Rolfe <[hidden email]> wrote:

> Hello,
>
> I'd like to use the Rigid3DTransform but I'm getting an error when I try to
> create a new instance.  I commented out all the lines of my code expect for:
>
> typedef itk::Rigid3DTransform<double> TransformType;
> TransformType::Pointer  transform = TransformType::New();
>
> The second line results in the following error:
>
> /Users/smrolfe/build/LandmarkRegistration.cxx:132: error: conversion from
> ‘itk::SmartPointer<itk::MatrixOffsetTransformBase<double, 3u, 3u> >’ to
> non-scalar type ‘itk::SmartPointer<itk::Rigid3DTransform<double> >’
> requested
>
> It seems strange that just declaring a new instance of the filter would
> cause this error.  I've tried substituting in the Rigid2DTransform and that
> works just fine.  Please let me know if you have any ideas.
>
> Thanks,
> Sara

I looked in
Modules/Core/Transform/test/itkRigid3DTransformTest.cxx

and saw Rigid3DTransformSurrogate defined and then used.

I don't know why that is necessary, but maybe it'll get you going?

If someone knows why this is necessary, it might be nice to add a
comment in the test near the Surrogate definition.

David
_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.html

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-users
Reply | Threaded
Open this post in threaded view
|

Re: Rigid3DTransform make error

smrolfe
I've discovered that this was probably related to a problem in ITK  
3.18.  I just switched to a machine with ITK 3.20 and it compiled with  
no errors.

Thanks,
Sara


On Jan 6, 2012, at 3:18 PM, David Doria wrote:

> On Fri, Jan 6, 2012 at 5:47 PM, Sara Rolfe  
> <[hidden email]> wrote:
>> Hello,
>>
>> I'd like to use the Rigid3DTransform but I'm getting an error when  
>> I try to
>> create a new instance.  I commented out all the lines of my code  
>> expect for:
>>
>> typedef itk::Rigid3DTransform<double> TransformType;
>> TransformType::Pointer  transform = TransformType::New();
>>
>> The second line results in the following error:
>>
>> /Users/smrolfe/build/LandmarkRegistration.cxx:132: error:  
>> conversion from
>> ‘itk::SmartPointer<itk::MatrixOffsetTransformBase<double, 3u, 3u>  
>> >’ to
>> non-scalar type ‘itk::SmartPointer<itk::Rigid3DTransform<double> >’
>> requested
>>
>> It seems strange that just declaring a new instance of the filter  
>> would
>> cause this error.  I've tried substituting in the Rigid2DTransform  
>> and that
>> works just fine.  Please let me know if you have any ideas.
>>
>> Thanks,
>> Sara
>
> I looked in
> Modules/Core/Transform/test/itkRigid3DTransformTest.cxx
>
> and saw Rigid3DTransformSurrogate defined and then used.
>
> I don't know why that is necessary, but maybe it'll get you going?
>
> If someone knows why this is necessary, it might be nice to add a
> comment in the test near the Surrogate definition.
>
> David

_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.html

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-users
Reply | Threaded
Open this post in threaded view
|

Re: Rigid3DTransform make error

brian avants
In reply to this post by David Doria-2
hi sara

we will typically use the itkEuler3DTransform.h ,
itkVersorRigid3DTransform.h or the itkQuaternionRigidTransform.h for
3d rigid mappings.   the Rigid3D transform is not ideal b/c it
directly uses a matrix representation.   perhaps that is not the
answer you were looking for but hope it helps anyway,

brian





On Fri, Jan 6, 2012 at 6:18 PM, David Doria <[hidden email]> wrote:

> On Fri, Jan 6, 2012 at 5:47 PM, Sara Rolfe <[hidden email]> wrote:
>> Hello,
>>
>> I'd like to use the Rigid3DTransform but I'm getting an error when I try to
>> create a new instance.  I commented out all the lines of my code expect for:
>>
>> typedef itk::Rigid3DTransform<double> TransformType;
>> TransformType::Pointer  transform = TransformType::New();
>>
>> The second line results in the following error:
>>
>> /Users/smrolfe/build/LandmarkRegistration.cxx:132: error: conversion from
>> ‘itk::SmartPointer<itk::MatrixOffsetTransformBase<double, 3u, 3u> >’ to
>> non-scalar type ‘itk::SmartPointer<itk::Rigid3DTransform<double> >’
>> requested
>>
>> It seems strange that just declaring a new instance of the filter would
>> cause this error.  I've tried substituting in the Rigid2DTransform and that
>> works just fine.  Please let me know if you have any ideas.
>>
>> Thanks,
>> Sara
>
> I looked in
> Modules/Core/Transform/test/itkRigid3DTransformTest.cxx
>
> and saw Rigid3DTransformSurrogate defined and then used.
>
> I don't know why that is necessary, but maybe it'll get you going?
>
> If someone knows why this is necessary, it might be nice to add a
> comment in the test near the Surrogate definition.
>
> David
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.html

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-users
Reply | Threaded
Open this post in threaded view
|

Re: Rigid3DTransform make error

David Doria-2
In reply to this post by smrolfe
On Fri, Jan 6, 2012 at 8:28 PM, Sara Rolfe <[hidden email]> wrote:
> I've discovered that this was probably related to a problem in ITK 3.18.  I
> just switched to a machine with ITK 3.20 and it compiled with no errors.
>
> Thanks,
> Sara

I tried it with git master and it did not compile - the same error as
you stated originally.

David
_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.html

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-users
Reply | Threaded
Open this post in threaded view
|

Re: Rigid3DTransform make error

Nicholas Tustison
Hi all,

If you look at the itkv4 Rigid3DTransform.h file, you'll see the following
(lines 59-62):

#ifdef ITKV3_COMPATIBILITY
  /** Run-time type information (and related methods).   */
  itkNewMacro(Self);
#endif

I'm guessing what happened is that going from itkv3 to itkv4 caused the
powers-that-be to remove this transform from possible conventional use
(similar to MatrixOffsetTransformBase) as Sara found and for the reasons
that Brian gave.  So when people switch from ITKv3 to ITKv4, they should
keep this in mind.  I'm sure there's a migration document somewhere but
I'm too lazy to look for it.

Nick


On Jan 7, 2012, at 8:28 AM, David Doria wrote:

> On Fri, Jan 6, 2012 at 8:28 PM, Sara Rolfe <[hidden email]> wrote:
>> I've discovered that this was probably related to a problem in ITK 3.18.  I
>> just switched to a machine with ITK 3.20 and it compiled with no errors.
>>
>> Thanks,
>> Sara
>
> I tried it with git master and it did not compile - the same error as
> you stated originally.
>
> David
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users

_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.html

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-users
Reply | Threaded
Open this post in threaded view
|

Re: Rigid3DTransform make error

Johnson, Hans J
The Rigid3DTransform has the right general purpose name for the
functionality that most people want to accomplish, but the implementation
of the base class is not stable or optimal or suitable for many real world
problems.

This was a common reoccurring problem over the years with end user
confusion.

As Brian alluded to, the itkEuler3DTransform.h
,itkVersorRigid3DTransform.h or the itkQuaternionRigidTransform.h are all
specific variants of Rigid transformations that are much more appropriate
for accomplishing rigid transformations.

My personal favorite is the itkVersorRigid3DTransform, it is robust, and
has a good well tuned optimizer.  I also use the Euler3DTransform when I
know that I need specific constraints on which angles should be more
constrained.

It is not too hard to convert from one to the other.

Hans

On 1/7/12 9:06 AM, "Nicholas Tustison" <[hidden email]> wrote:

>Hi all,
>
>If you look at the itkv4 Rigid3DTransform.h file, you'll see the following
>(lines 59-62):
>
>#ifdef ITKV3_COMPATIBILITY
>  /** Run-time type information (and related methods).   */
>  itkNewMacro(Self);
>#endif
>
>I'm guessing what happened is that going from itkv3 to itkv4 caused the
>powers-that-be to remove this transform from possible conventional use
>(similar to MatrixOffsetTransformBase) as Sara found and for the reasons
>that Brian gave.  So when people switch from ITKv3 to ITKv4, they should
>keep this in mind.  I'm sure there's a migration document somewhere but
>I'm too lazy to look for it.
>
>Nick
>
>
>On Jan 7, 2012, at 8:28 AM, David Doria wrote:
>
>> On Fri, Jan 6, 2012 at 8:28 PM, Sara Rolfe <[hidden email]>
>>wrote:
>>> I've discovered that this was probably related to a problem in ITK
>>>3.18.  I
>>> just switched to a machine with ITK 3.20 and it compiled with no
>>>errors.
>>>
>>> Thanks,
>>> Sara
>>
>> I tried it with git master and it did not compile - the same error as
>> you stated originally.
>>
>> David
>> _____________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Kitware offers ITK Training Courses, for more information visit:
>> http://www.kitware.com/products/protraining.html
>>
>> Please keep messages on-topic and check the ITK FAQ at:
>> http://www.itk.org/Wiki/ITK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.itk.org/mailman/listinfo/insight-users
>
>_____________________________________
>Powered by www.kitware.com
>
>Visit other Kitware open-source projects at
>http://www.kitware.com/opensource/opensource.html
>
>Kitware offers ITK Training Courses, for more information visit:
>http://www.kitware.com/products/protraining.html
>
>Please keep messages on-topic and check the ITK FAQ at:
>http://www.itk.org/Wiki/ITK_FAQ
>
>Follow this link to subscribe/unsubscribe:
>http://www.itk.org/mailman/listinfo/insight-users



________________________________
Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged.  If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited.  Please reply to the sender that you have received the message in error, then delete it.  Thank you.
________________________________
_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.html

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-users
Reply | Threaded
Open this post in threaded view
|

Re: Rigid3DTransform make error

yagoDiez
Some more information on this:

The details mentioned by  Nicholas Tustison are here:

http://mitk.org/wiki/ITK_v4_Migration_Guide

I encountered a similar problem to the one originating the thread (just migrated to itk 4.7). I solved it by using the itkv3 rigid transformation class.

http://www.itk.org/Doxygen43/html/classitkv3_1_1Rigid3DTransform.html

So, all you would need to do is change the typedef to

typedef itkv3::Rigid3DTransform<double>  TransformType;

and

include the following file.

#include <itkv3Rigid3DTransform.h>

Probably just using the itk 3 compatibility flag would also work.

In my case, I used this solution because I needed to use the setmatrix (with orthogonality tolerance) function with a previously computed rotation matrix. I don't feel too happy about it but I did not see a direct way to use the versor3D class (which I do use for my "normal" rigid registrations and encourage others to use). Will post again if I get a better solution.