[Insight-users] compare images

Gerenrot, Mikhail mikhail.gerenrot at stryker.com
Fri Aug 3 17:17:54 EDT 2012


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]
Sent: Friday, August 03, 2012 1:41 PM
To: Gerenrot, Mikhail
Cc: 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20120803/cc207f2a/attachment.htm>


More information about the Insight-users mailing list