[Insight-developers] Proposal: Adding ImageCheck class to Insight/Testing/Code/Common
Luis Ibanez
luis.ibanez at kitware.com
Wed Feb 11 18:34:09 EST 2009
As we discussed several weeks ago,
it would be convenient to have a set of helper classes
that validate certain conditions in commonly used ITK
classes (itkImage, itkIndex, itkRegion....)
We recently added one of such helper classes (at the end of this email)
to the test:
itkGradientMagnitudeRecursiveGaussianFilterTest.cxx
We are proposing to move this class to its own file,
to make possible for other tests to use it as well.
We also propose to expand the set of methods in it.
For example, additional methods that come to mind are
- Is image empty (as in memory not allocated)
- Is image Zero (as all pixels set to zero)
- Are direction cosines consistent
- Is spacing non-null
- Is one image inside another (image grid)
- Is one extent inside another (physical space)
The challenge here is that the class will change a lot,
and it probably shouldn't be seen as part of the ITK API,
but as part of the Testing infrastructure. (just as the
FilterWatcher).
The suggestion will be to add the class to the
Insight/Testing directory.
Please let us know what you think,
Thanks
Luis
--------------------------------------------------------------------------
template<class TImage1Type,class TImage2Type>
class ImageInformationIsEqual
{
public:
static bool Check(const TImage1Type * image1, const TImage2Type * image2)
{
if (image1->GetSpacing() != image2->GetSpacing())
{
return false;
}
if (image1->GetOrigin() != image2->GetOrigin())
{
return false;
}
if (image1->GetDirection() != image2->GetDirection())
{
return false;
}
return true;
}
};
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20090211/26ab3afc/attachment.htm>
More information about the Insight-developers
mailing list