From a2ad218b695b29d49d53c85601d1ea438528e468 Mon Sep 17 00:00:00 2001 From: dsarrut Date: Fri, 18 Mar 2011 12:47:17 +0000 Subject: [PATCH] Add HaveSameSizeAndSpacingThan function --- common/vvImage.cxx | 15 +++++++++++++++ common/vvImage.h | 1 + 2 files changed, 16 insertions(+) diff --git a/common/vvImage.cxx b/common/vvImage.cxx index 1f51168..2db040b 100644 --- a/common/vvImage.cxx +++ b/common/vvImage.cxx @@ -249,6 +249,7 @@ vtkSmartPointer vvImage::GetTransform() } //-------------------------------------------------------------------- + //-------------------------------------------------------------------- void vvImage::UpdateReslice() { @@ -258,4 +259,18 @@ void vvImage::UpdateReslice() } //-------------------------------------------------------------------- + +//-------------------------------------------------------------------- +bool vvImage::HaveSameSizeAndSpacingThan(vvImage * other) +{ + bool same = true; + for(int i=0; iGetSize()[i]) same = false; + if ( GetSpacing()[i] != other->GetSpacing()[i]) same = false; + } + return same; +} +//-------------------------------------------------------------------- + + #endif // VVIMAGE_CXX diff --git a/common/vvImage.h b/common/vvImage.h index 5c38f31..37fa547 100644 --- a/common/vvImage.h +++ b/common/vvImage.h @@ -61,6 +61,7 @@ public : void SetTimeSpacing(double s) { mTimeSpacing = s; } void SetTimeOrigin(double o) { mTimeOrigin = o; } void UpdateReslice(); + bool HaveSameSizeAndSpacingThan(vvImage * other); private: vvImage(); -- 2.47.1