From: dsarrut Date: Fri, 18 Mar 2011 12:47:17 +0000 (+0000) Subject: Add HaveSameSizeAndSpacingThan function X-Git-Tag: v1.2.0~156 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=a2ad218b695b29d49d53c85601d1ea438528e468;p=clitk.git Add HaveSameSizeAndSpacingThan function --- 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();