X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=common%2FclitkImageCommon.txx;h=ca8206e4085ec4ac8e841057f137ca5b62541656;hb=c7f6f682ddc01d2a41740bbdb806f9ef967b57d5;hp=7b6badf48d1286e87a40ba07e4a2023f285cde52;hpb=83de28515d7bbb3898d5adee7a900146c2c15d89;p=clitk.git diff --git a/common/clitkImageCommon.txx b/common/clitkImageCommon.txx index 7b6badf..ca8206e 100644 --- a/common/clitkImageCommon.txx +++ b/common/clitkImageCommon.txx @@ -319,7 +319,7 @@ void ComputeWeightsOfEachClasses(const typename InputImageType::Pointer & input, //-------------------------------------------------------------------- template -bool HasSameSizeAndSpacing(typename ImageType1::ConstPointer A, +bool HaveSameSizeAndSpacing(typename ImageType1::ConstPointer A, typename ImageType2::ConstPointer B) { if (A->GetImageDimension() != B->GetImageDimension()) return false; @@ -333,7 +333,7 @@ bool HasSameSizeAndSpacing(typename ImageType1::ConstPointer A, //-------------------------------------------------------------------- template -bool HasSameSizeAndSpacing(typename ImageType1::Pointer A, +bool HaveSameSizeAndSpacing(typename ImageType1::Pointer A, typename ImageType2::Pointer B) { if (A->GetImageDimension() != B->GetImageDimension()) return false; @@ -345,5 +345,31 @@ bool HasSameSizeAndSpacing(typename ImageType1::Pointer A, } //-------------------------------------------------------------------- +//-------------------------------------------------------------------- +template +bool HaveSameSpacing(typename ImageType1::ConstPointer A, + typename ImageType2::ConstPointer B) +{ + if (A->GetImageDimension() != B->GetImageDimension()) return false; + for(unsigned int i=0; iGetImageDimension(); i++) { + if (A->GetSpacing()[i] != B->GetSpacing()[i]) return false; + } + return true; +} +//-------------------------------------------------------------------- + +//-------------------------------------------------------------------- +template +bool HaveSameSpacing(typename ImageType1::Pointer A, + typename ImageType2::Pointer B) +{ + if (A->GetImageDimension() != B->GetImageDimension()) return false; + for(unsigned int i=0; iGetImageDimension(); i++) { + if (A->GetSpacing()[i] != B->GetSpacing()[i]) return false; + } + return true; +} +//-------------------------------------------------------------------- + #endif /* end #define CLITKIMAGECOMMON_TXX */