[Insight-developers] Methods for comparing meta-data with tolerance

Bradley Lowekamp blowekamp at mail.nih.gov
Thu Jun 23 09:21:09 EDT 2011


On Jun 22, 2011, at 3:08 PM, Brad King wrote:

> On 06/22/2011 02:53 PM, Bradley Lowekamp wrote:
>> That still doesn't answer where to put almost equal vector, point,
>> and matrix... perhaps in the classes themselves?
> 
> An "almost equal" test is typically context-dependent.

The algorithm is most certainly not different for scalar (well there just may be a couple to choose from ). And ITK should have that methods implemented somewhere.

For the vector-like classes I was just thinking of doing it on a component wise basis. While different algorithms may need to perform slightly different computation to perform the "almost equals", I believe that is would be a great usefulness in many places.

I am willing to conceded that "almost equal" matrixes is perhaps much more context dependent then the others, and may not be as useful.

I think the real implementation should be a function in namespace itk::Math, and then a member function for the vector-like classes.


> 
> My understanding is that the goal of this comparison is to determine
> whether it is safe to do index-space filtering of two inputs, as in
> the "add" image filter.  Another approach is to carry some kind of
> unique meta-data tag associated with a data set when it is first read
> and propagated through filters that don't touch the meta-data (origin
> and spacing).  Index-space filters would work only if all inputs have
> the same tag.  A new filter could handle the "almost equal" test using
> application-defined parameters in order to set matching tags on
> images from different sources.

Essentially, the question is do these image represent the same grid with in some tolerance. There is also places in the IO that this needs to be used. For example, the IO issue I had, was because these attribute are stored in ITK as double, yet the IO was writing them out as text precision float and many bits were lost.

The tag is a non-starter as far as I am concerned. The "tag" will not be preserved through IO. It's nice to perform binary operations on images from different sources. However, I may be missing something in you description.



> 
>> Is this an endorsement of using an assumption that we have IEEE
>> floating point numbers, and can assume to be doing bit-wise comparisons?
> 
> It was just a link for reference.
> 
> -Brad K

========================================================
Bradley Lowekamp  
Lockheed Martin Contractor for
Office of High Performance Computing and Communications
National Library of Medicine 
blowekamp at mail.nih.gov


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20110623/bd0ab5cc/attachment.htm>


More information about the Insight-developers mailing list