Scheduled service maintenance on November 22


On Friday, November 22, 2024, between 06:00 CET and 18:00 CET, GIN services will undergo planned maintenance. Extended service interruptions should be expected. We will try to keep downtimes to a minimum, but recommend that users avoid critical tasks, large data uploads, or DOI requests during this time.

We apologize for any inconvenience.

Coord2Arff.m 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. % function Coord2Arff:
  2. i%
  3. % Converts coord files to ARFF files. The created file has the same name
  4. % with .arff extension.
  5. %
  6. % input:
  7. % coordFile - .coord file
  8. % storeAtSource - 1 to store .arff at the same position as .coord. 0 to store at current directory
  9. function Coord2Arff(coordFile, storeAtSource)
  10. % check input arguments
  11. if (nargin <2)
  12. storeAtSource = 0;
  13. end
  14. % get part of input file
  15. [dir, basename, ext] = fileparts(coordFile);
  16. % load data from coord file
  17. [data, pixelX, pixelY, width, height, distance, conf] = LoadCoordAndConf(coordFile);
  18. arffFile = [basename '.arff'];
  19. if (length(dir) > 0)
  20. dir = [dir '/'];
  21. end
  22. if (storeAtSource == 1)
  23. arffFile = [dir arffFile];
  24. end
  25. fid = fopen(arffFile, 'w+');
  26. % print experiment parameters
  27. fprintf(fid, '@RELATION gaze_labels\n\n');
  28. fprintf(fid, '%%@METADATA width_px %d\n', pixelX);
  29. fprintf(fid, '%%@METADATA height_px %d\n', pixelY);
  30. fprintf(fid, '%%@METADATA distance_mm %.2f\n', distance*1000);
  31. fprintf(fid, '%%@METADATA width_mm %.2f\n', width*1000);
  32. fprintf(fid, '%%@METADATA height_mm %.2f\n\n', height*1000);
  33. fprintf(fid, '@ATTRIBUTE time INTEGER\n');
  34. fprintf(fid, '@ATTRIBUTE x NUMERIC\n');
  35. fprintf(fid, '@ATTRIBUTE y NUMERIC\n');
  36. fprintf(fid, '@ATTRIBUTE confidence NUMERIC\n\n');
  37. fprintf(fid, '@DATA\n');
  38. for i=1:size(data,1)
  39. fprintf(fid, '%d,', data(i,1));
  40. fprintf(fid, '%.2f,', data(i,2:3));
  41. fprintf(fid, '%.2f\n', conf(i));
  42. end
  43. fclose(fid);
  44. end