[Insight-developers] GetInverse is unusable -- patch attached

Pavel Koshevoy koshevoy at sci.utah.edu
Wed Oct 15 22:52:20 EDT 2008


I've resent the message with trasforms attached, it's waiting moderator approval
to be delivered because it exceeds 40KB e-mail size limit.  The message was 87KB
with nine c++ files attached.  If there is another way I should do this --
please direct me to it.

	Pavel.


Pavel Koshevoy wrote:
> Hi,
> 
> I've talked to my supervisors at the UofU and they agreed that I can contribute
> some of our code to ITK.
> 
> I've attached all the transforms I've mentioned earlier, except the triangle
> mesh transform -- that one will need some cleaning up and untangling from my
> helper classes.  I also have an ImageMosaicVarianceMetric for use when
> registering several images simultaneously -- there is no fixed image, all images
> are warped.  I'd be happy to contribute that as well, but right now it has
> external code dependencies which I don't want to drag along.
> 
> What is the right way to get this code contributed to ITK?  Can someone help me?
> 
> 	Pavel.
> 
> 
> Rupert Brooks wrote:
>> Hi Pavel,
>>
>> I really like the idea of having a GetInverse method at the Transform
>> Base class level.  It would also be nice to have a Compose() method
>> for similar reasons.   Its also clever to make the
>> InverseTransformType different from the current transform type
>> (obvious in retrospect... but i hadnt thought of it).
>>
>> Its of course not up to me whether this gets implemented in the main
>> trunk.  Just a quick tip though - I have similar problems with my
>> code, but rather than patching ITK which as you point out is quite
>> painful for your users, i used a Facade class.  I tucked generic
>> Compose and Inverse methods (and misc other things) in there.  Much
>> less elegant though, it ends up amounting to a bunch of switch
>> statements.  Still, it might get you around your code distribution
>> issue in the short term.
>>
>> http://en.wikipedia.org/wiki/Facade_pattern
>>
>> In my case, my facade class takes a transform in its constructor, and
>> then supplies GetInverse(), and Compose methods(), and so forth for
>> that transform.
>>
>> That being said, the transforms you have created sound extremely
>> useful - I for one would be very interested in seeing an Insight
>> journal submission or other release.  I had been considering writing
>> something similar to your NewtonMethodInverse but never found the
>> time.
>>
>> Cheers,
>> Rupert B.
>>
>>
>> On Fri, Oct 10, 2008 at 10:55 AM, Pavel Koshevoy <koshevoy at sci.utah.edu> wrote:
>>> Hi,
>>>
>>> I've been patching ITK since version 1.8.1 to provide a usable GetInverse
>>> API for transforms which don't have an analytic inverse, or have an
>>> approximate inverse transform of a different type.
>>>
>>> Requiring a patched ITK is a hurdle in the path of developers trying to
>>> build my image registration apps.  I really, really hope you merge this
>>> patch into the trunk.
>>> It's a very small change.  Basically, I define an InverseTransformPointer
>>> type and add virtual InverseTransformPointer GetInverse() const method.  The
>>> patch implements this API for itk::Transform, itk::IdentityTransform,
>>> itk::MatrixOffsetTransformBase, itk::ScaleTransform,
>>> itk::TranslationTransform.
>>> These are useful changes that make the ITK Transform classes far more
>>> useful. In my image registration apps I implement this API in my Legender
>>> Polynomial Transform, a Radial Basis Function Transform, Triangle Mesh
>>> Transform, Radial Distortion Transform, Cascaded Transform, and a generic
>>> Newtons Method Numeric Inverse Transform.
>>>
>>> I really hope someone takes a look at this short patch and adds it to the
>>> main ITK trunk.
>>>
>>> Thank you,
>>>   Pavel.
> _______________________________________________
> Insight-developers mailing list
> Insight-developers at itk.org
> http://www.itk.org/mailman/listinfo/insight-developers



More information about the Insight-developers mailing list