[Insight-users] compare images

Gerenrot, Mikhail mikhail.gerenrot at stryker.com
Mon Aug 13 13:16:33 EDT 2012


Christina & Bill,

Thank you for your input. Yes, itk::DifferenceImageFilter does what I want, but in the same manner - looping through images with iterators. I wander if there is something more efficient, something similar to memcmp.

Thank you again,

With regards,

Your Mike.

From: insight-users-bounces at itk.org [mailto:insight-users-bounces at itk.org] On Behalf Of Chr. Rossmanith
Sent: Friday, August 10, 2012 1:16 AM
To: insight-users at itk.org
Subject: Re: [Insight-users] compare images

Hi,

maybe itk::DifferenceImageFilter is what you are looking for? AbsoluteValueDifferenceImageFilter calculates |a|-|b|.

Christina Rossmanith
--
Dept. of Neurology
University Medical Center Mannheim

Am 10.08.2012 09:13, schrieb Navneeth Subramanian:
Bill - Is it the difference image filter:
http://www.itk.org/Doxygen/html/classitk_1_1AbsoluteValueDifferenceImageFilter.html
you are referring to ?
On Sat, Aug 4, 2012 at 2:55 AM, Bill Lorensen <bill.lorensen at gmail.com<mailto:bill.lorensen at gmail.com>> wrote:
There is a similar class in ITKv3, but I can't recall the name.

bill

On Fri, Aug 3, 2012 at 5:17 PM, Gerenrot, Mikhail <mikhail.gerenrot at stryker.com<mailto:mikhail.gerenrot at stryker.com>> wrote:
Bill,

We use ITK 3.1.
I tried  to upgrade to ITK4, this turned out to be not that simple, so we decided to postpone this for now.

I appreciate you help,

Thank you.

From: Bill Lorensen [mailto:bill.lorensen at gmail.com<mailto:bill.lorensen at gmail.com>]
Sent: Friday, August 03, 2012 1:41 PM
To: Gerenrot, Mikhail
Cc: insight-users at itk.org<mailto:insight-users at itk.org>
Subject: Re: [Insight-users] compare images

If you are using itkv4, look at Modules/Core/TestKernel/include/itkTestingComparisonImageFilter.h. It's what itk uses for regression testing.
On Fri, Aug 3, 2012 at 4:21 PM, Gerenrot, Mikhail <mikhail.gerenrot at stryker.com<mailto:mikhail.gerenrot at stryker.com>> wrote:
Hi Team,

We need to check if images are equal, and we wrote a method that uses iterators and compares pixels:
bool AreImagesEqual(const ImageType::Pointer & image1, const ImageType::Pointer & image2)
{
  itk::ImageSliceConstIteratorWithIndex<ImageType> it1( image1, image1->GetRequestedRegion() );
  itk::ImageSliceConstIteratorWithIndex<ImageType> it2( image2, image2->GetRequestedRegion() );

  PixelType p1;
  PixelType p2;

// loop starts
...
  p1 = it1.Get();
  p2 = it2.Get();
  if(p1 != p2)
  {
    return false;
  }
...
// loop ends
return true;
}

Is there any better way?
Any input will be greatly appreciated.

Thank you all in advance,

Your Mike Gerenrot
Stryker Corp.


_____________________________________
Powered by www.kitware.com<http://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.php

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



--
Unpaid intern in BillsBasement at noware dot com



--
Unpaid intern in BillsBasement at noware dot com

_____________________________________
Powered by www.kitware.com<http://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.php

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<http://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.php



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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20120813/958727a0/attachment.htm>


More information about the Insight-users mailing list