This is my memo to read the data for IEEE SciVis 2015 Contest. The file is in SDF format. There is a C/C++ library libSDF to open the files, but some instructions are unclear, especially for the porting on Windows. Also, I cannot find examples about its usage so I write one: PrerequisitesTo build libSDF for Visual Studio 2010, I use cygwin and mingw x64. The procedure to install them can be seen here: http://www.recheliu.org/memo/suggestionstoavoidarpackcompilationerrors Build libSDF for Windows x64 platform
MPMYFile *MPMY_Fopen(const char *path, int mpmy_flags)
CC=/ usr /bin/x86_64-w64-mingw32-gcc.exe
$ make libSDF.a
$ / usr /bin/x86_64-w64-mingw32-dllwrap.exe --export-all-symbols
*.o -lm --output-def libSDF_x64.def -o libSDF_x64.dll
lib.exe /machine:X64 /def: libSDF_x64.def
#define LOG_VAR(x) cout<<x<<endl; char* szSdfFilepath = "F:/data/viscontest/scivis2015/ds14_scivis_0128_e4_dt04_0.0200"; LOG_VAR(SDFissdf(szSdfFilepath)); SDF *sdf = SDFopen(szSdfFilepath, ""); SDFdebug(1); // Put it 0 to disable debug information. int64_t uNrOfRecs = SDFnrecs("x", sdf); LOG_VAR(uNrOfRecs); vector<float> vfData(uNrOfRecs); SDFrdvecs(sdf, "x", uNrOfRecs, vfData.data(), 0, NULL); SDFclose(sdf); for(size_t i = 0; i < uNrOfRecs; i++) { if( 0.0f != vfData[i] ) { LOG_VAR(vfData[i]); } } |
Memo >