From: Eduardo DAVILA Date: Fri, 27 May 2016 13:28:52 +0000 (+0200) Subject: #2960 creaVtk Bug New Normal - ElementSize = ElementSpacing in MHDFileInfo box and... X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=30eda485e98dde5a44af368f356fa0bfd682eaa3;p=creaVtk.git #2960 creaVtk Bug New Normal - ElementSize = ElementSpacing in MHDFileInfo box and ReadMHDPlane box --- diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkMHDFileInfo.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkMHDFileInfo.cxx index 4ab0984..4154990 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkMHDFileInfo.cxx +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkMHDFileInfo.cxx @@ -54,7 +54,8 @@ void MHDFileInfo::Process() if (strncmp("NDims",mystring,5)==0) { sscanf(mystring,"%s %s %d" ,strTmp, strTmp, &dim); } if (strncmp("DimSize",mystring,6)==0) { sscanf(mystring,"%s %s %d %d %d" ,strTmp, strTmp, &dimX, &dimY,&dimZ); } if (strncmp("ElementType",mystring,11)==0) { sscanf(mystring,"%s %s %s" ,strTmp, strTmp, strTmp2); formattype=strTmp2; } - if (strncmp("ElementSpacing",mystring,11)==0) { sscanf(mystring,"%s %s %f %f %f" ,strTmp, strTmp, &spcX,&spcY,&spcZ); } + if (strncmp("ElementSpacing",mystring,14)==0) { sscanf(mystring,"%s %s %f %f %f" ,strTmp, strTmp, &spcX,&spcY,&spcZ); } + if (strncmp("ElementSize",mystring,11)==0) { sscanf(mystring,"%s %s %f %f %f" ,strTmp, strTmp, &spcX,&spcY,&spcZ); } if (strncmp("Offset",mystring,6)==0) { sscanf(mystring,"%s %s %f %f %f" ,strTmp, strTmp, &ox, &oy, &oz); } if (strncmp("HeaderSize",mystring,10)==0) { sscanf(mystring,"%s %s %ld" ,strTmp, strTmp, &headersize); } } // while diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkReadMHDPlane.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkReadMHDPlane.cxx index 0c1833c..1eb4c84 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkReadMHDPlane.cxx +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkReadMHDPlane.cxx @@ -136,7 +136,8 @@ void ReadMHDPlane::ReadNormalMHD() { strcpy(mystring,"\n"); fgets(mystring,250,ffIn); - if (strncmp("NDims",mystring,5)==0) { + if (strncmp("NDims",mystring,5)==0) + { if (width==1) { strcpy(mystring,"NDims = 2\n"); @@ -237,7 +238,8 @@ void ReadMHDPlane::Read64lseek() if (strncmp("NDims",mystring,5)==0) { sscanf(mystring,"%s %s %d" ,strTmp, strTmp, &dim); } if (strncmp("DimSize",mystring,6)==0) { sscanf(mystring,"%s %s %d %d %d" ,strTmp, strTmp, &dimX, &dimY,&dimZ); } if (strncmp("ElementType",mystring,11)==0) { sscanf(mystring,"%s %s %s" ,strTmp, strTmp, strTmp2); formattype=strTmp2; } - if (strncmp("ElementSpacing",mystring,11)==0) { sscanf(mystring,"%s %s %f %f %f" ,strTmp, strTmp, &spcX,&spcY,&spcZ); } + if (strncmp("ElementSpacing",mystring,14)==0) { sscanf(mystring,"%s %s %f %f %f" ,strTmp, strTmp, &spcX,&spcY,&spcZ); } + if (strncmp("ElementSize",mystring,11)==0) { sscanf(mystring,"%s %s %f %f %f" ,strTmp, strTmp, &spcX,&spcY,&spcZ); } if (strncmp("Offset",mystring,6)==0) { sscanf(mystring,"%s %s %f %f %f" ,strTmp, strTmp, &ox, &oy, &oz); } if (strncmp("HeaderSize",mystring,10)==0) { sscanf(mystring,"%s %s %ld" ,strTmp, strTmp, &headersize); } if (strncmp("ElementDataFile",mystring,15)==0) { sscanf(mystring,"%s %s %s" ,strTmp, strTmp, strTmp2); elementdatafile=strTmp2; }