+bool isLineToIgnore(const std::string line){
+ if(std::string::npos == line.find_first_of("ITK_InputFilterName")){
+ return true;
+ }
+ return false;
+}
+bool mhdCmp(const std::string &file, const std::string &refFile){
+ bool sameFiles = true;
+ std::ifstream in(file.c_str());
+ std::ifstream ref(file.c_str());
+ std::string line;
+ std::string refLine;
+ while ( in.good() && ref.good()){
+ getline (in,line);
+ //does the line begins by an attribute to ignore
+ if(isLineToIgnore(line)){
+ continue;
+ }
+
+ getline(ref,refLine);
+ while(isLineToIgnore(refLine)){
+ getline(ref,refLine);
+ }
+ if(line!=refLine){
+ sameFiles = false;
+ break;
+ }
+ }
+ in.close();
+ ref.close();
+ //check files same length
+ return sameFiles;
+}