[Insight-users] Mean Curvature Calculation in Level Set

Luis Ibanez luis . ibanez at kitware . com
Thu, 20 Nov 2003 13:54:56 -0500


Hi Sah,

The itkNotUse() macro was used to make some compilers
happy and avoid the warnings for "non used variable"
in the cases where the arguments were not used in a
method.  This typically happens in virtual functions
when in order to respect the API, a number of arguments
are present, but not used inside the method.

If your implementation of the method is actually using
the argument of the function, you must then remove the
itkNotUse() macro, otherwise the argument is not declared
at all.

The reason why there are not errors in itkLevelSetFunction
is because the argument "neighbor" is not used in the
ComputeMeanCurvature, so the signature could be as well:

    ComputeMeanCurvature( const NeighborhoodType & )



Regards,



   Luis


--------------------------------------------------------

Sah Rayman wrote:
> A related question: when I implement
> ComputeMeanCurvature() in class MyLevelSetFunction.txx
> 
> If I write as
> ComputeMeanCurvature(const NeighborhoodType
> &itkNotUse(neighborhood), ...)
> as it is in itkLevelSetFunction.txx, I will get a lot
> syntax error (VC 6.0), and I have to write as
> ComputeMeanCurvature(const NeighborhoodType
> &neighborhood, ...)
> 
> I checked the definition of itkNotUse(x), it is a
> macro to nothing, (#define itkNotUse(x) )
> 
> Then how come in itkLevelSetFunction.txx there is no
> syntax error?
> 
> 
> 
> 
> 
> 
> 
> --- Sah Rayman <sahrayman at yahoo . com> wrote:
> 
>>I am now 90% sure that this is a bug of
>>itkLevelSetFunction.txx as of ITK 1.4.
>>
>>I rewrote my ComputeMeanCurvature() in my derived
>>LevelSetFunction class, and the segmentation result
>>makes more sense. 
>>
>>My fix:
>>move line "curvature_term -= gd->m_dx[i] *
>>gd->m_dx[j]
>>* gd->m_dxy[i][j];"
>>to the inner of "if( j!=i) ".
>>
>>Author of the file, if you're interested in more
>>details, please write to me.
>>
>>
>>
>>--- Sah Rayman <sahrayman at yahoo . com> wrote:
>>
>>>I am looking at function:
>>>
>>>template <class TImageType>
>>>typename
>>>LevelSetFunction<TImageType>::ScalarValueType
>>>
>>
>>LevelSetFunction<TImageType>::ComputeMeanCurvature()
>>
>>>in itkLevelSetFunction.txx, line 158 (ITK 1.4)
>>>
>>>When I compared that to Sethian's "Level Set
>>
>>Methods
>>
>>>and Fast Marching Methods", 2ndEd, pp. 70, Eq.
>>
>>6.36,
>>
>>>I
>>>found that the C++ implementation contain some
>>
>>extra
>>
>>>terms in nominator:
>>>
>>>-dx[0]*dx[0]*dxy[0][0]-dx[1]*dx[1]*dxy[1][1]-...
>>>
>>>Can someone tell me what are these additional
>>
>>terms
>>
>>>for? Is the result still mean curvature? Any
>>>reference
>>>for that?
>>>
>>>
>>>__________________________________
>>>Do you Yahoo!?
>>>Protect your identity with Yahoo! Mail
>>
>>AddressGuard
>>
>>>http://antispam . yahoo . com/whatsnewfree
>>>_______________________________________________
>>>Insight-users mailing list
>>>Insight-users at itk . org
>>>http://www . itk . org/mailman/listinfo/insight-users
>>
>>
>>__________________________________
>>Do you Yahoo!?
>>Protect your identity with Yahoo! Mail AddressGuard
>>http://antispam . yahoo . com/whatsnewfree
>>_______________________________________________
>>Insight-users mailing list
>>Insight-users at itk . org
>>http://www . itk . org/mailman/listinfo/insight-users
> 
> 
> 
> __________________________________
> Do you Yahoo!?
> Protect your identity with Yahoo! Mail AddressGuard
> http://antispam . yahoo . com/whatsnewfree
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk . org
> http://www . itk . org/mailman/listinfo/insight-users
>