]> Creatis software - clitk.git/commitdiff
Add HaveSameSizeAndSpacingThan function
authordsarrut <dsarrut>
Fri, 18 Mar 2011 12:47:17 +0000 (12:47 +0000)
committerdsarrut <dsarrut>
Fri, 18 Mar 2011 12:47:17 +0000 (12:47 +0000)
common/vvImage.cxx
common/vvImage.h

index 1f5116849cb711a73cc80cfa19954c1bcfd7c6ab..2db040b4bb89969e7cfac3b5c5079ff74e0eba53 100644 (file)
@@ -249,6 +249,7 @@ vtkSmartPointer<vtkTransform> vvImage::GetTransform()
 }
 //--------------------------------------------------------------------
 
+
 //--------------------------------------------------------------------
 void vvImage::UpdateReslice()
 {
@@ -258,4 +259,18 @@ void vvImage::UpdateReslice()
 }
 //--------------------------------------------------------------------
 
+
+//--------------------------------------------------------------------
+bool vvImage::HaveSameSizeAndSpacingThan(vvImage * other)
+{
+  bool same = true;
+  for(int i=0; i<GetNumberOfDimensions(); i++) {
+    if ( GetSize()[i] != other->GetSize()[i]) same = false;
+    if ( GetSpacing()[i] != other->GetSpacing()[i]) same = false;
+  }
+  return same;
+}
+//--------------------------------------------------------------------
+
+
 #endif // VVIMAGE_CXX
index 5c38f31089e554844536385b45c112854899b5a5..37fa547cf163b6dcae1e0f0a9c8e4383bcd10270 100644 (file)
@@ -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();