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

Luis Ibanez luis.ibanez at kitware.com
Wed Apr 8 12:53:20 EDT 2009


Paul,

Thanks for the clarification...

It seems that were are mixing patches here.

My comments relate to the file

file icon itk-getinverse.patch

that Tom attached to bug:
http://www.kwwidgets.org/Bug/bug_view_advanced_page.php?bug_id=7876


Tom:

   Where did you take this patch file from ?

   Is it supposed to be equivalent to the one that Paul just posted ?



Paul:

   Regarding the objection. I failed to indicate that the objection
   is not about the Self type but about the use of a raw pointer.
   I'm suggesting to use a SmartPointer as argument so that we can
   allocate (construct) the transform if necessary.

   I agree with you that the "Self" type should be replaced with a
   TransformBase type.



---



Tom,

let's make sure that we take the proper version of the patch...



    Luis




--------------------
Paul Koshevoy wrote:
> Luis Ibanez wrote:
> 
>> Hi Tom,
>>
>> Here are some observations about the patch: itk-getinverse.patch
>>
>> ----
>>
>> In line 184:
>>
>> CenteredRigid2DTransform<TScalarType>::
>> +GetInverse( Self* inverse) const
>> +{
>> +  if(!inverse)
>> +    {
>> +    return false;
>> +    }
>>
>>
>> It is tempting to use a SmartPointer as argument
>> so that we can do:
>>
>> +GetInverse( Self::Pointer inverse) const
>> +{
>> +  if( inverse.IsNull() )
>> +    {
>> +    inverse = Self::New();
>> +    }
>>
>>   
> 
> 
> 
> Hi Luis,
> 
> It seems the code you are objecting to is the existing ITK code.  
> Passing a Self pointer (smart or not) restricts the inverse transform 
> type to be the same type as the forward transform.  That is broken, 
> because only a few transforms have an analytic inverse of the same 
> type.  This is not what my patch does, although I have followed the 
> style and implemented GetInverse() inline in the .h file.
> 
> My current patch doesn't have the changes you are referring to:
> https://code.sci.utah.edu/svn/ImageReconstruction/trunk/code/itk-patch/InsightToolkit-3.12.0-GetInverse.patch 
> 
> 
>    Pavel.
> 
> 


More information about the Insight-developers mailing list