SwatPhonLab / UltraTrace

A Free/Open-Source tool for manual annotation of Ultrasound Tongue Imaging data.
GNU General Public License v3.0
10 stars 5 forks source link

sometimes path of TextGrid is absolute instead of relative #156

Open jonorthwash opened 3 years ago

jonorthwash commented 3 years ago
      {
         "_prev": "File050",
         "offset": null,
         "_next": "File052",
         "processed": null,
         ".txt": "File051.txt",
         ".wav": "File051_Track0.wav",
         "US.txt": "File051US.txt",
         ".ult": "File051.ult",
         "name": "File051",
         ".TextGrid": "/data/Documents/Research/PhonLab/ultrasound-data-RussianPalatals-202012/File051.TextGrid",
         "NumberOfFrames": 574
      },

This seems to happen only sometimes. I'm thinking it has something to do with where UltraTrace is started from?

mr-martian commented 3 years ago

Presumably this is only for generated textgrids?

jonorthwash commented 3 years ago

Aha, that would explain the distribution well in this case. And also helps identify where the bug might be in the code.

jonorthwash commented 3 years ago

Hm, nope, we seem to be getting this for pre-existing TextGrids that were modified and then reloaded. It's only changing paths for TextGrids that we reloaded in UltraTrace, and not ones we didn't. (For ultrasound files loaded for the first time, it's identifying the corresponding TextGrid and saving the paths this way too.)

Part of a diff from a recent commit—a file that was newly opened in UltraTrace:

         ".wav": "File032_Track2.wav",
         "name": "File032_Track2",
-         ".TextGrid": "../ultrasound-data-TatarKQ-191001/File032_Track2.TextGrid",
+         ".TextGrid": "/home/[user]/Documents/ultrasound-data-TatarKQ-191001/File032_Track2.TextGrid",
         "NumberOfFrames": 1
      },

(Of course, this is a _Track2 file, which I think is just the frame pulse data.)

From the same commit—a file that was opened for the first time in UltraTrace (but whose TextGrid had existed previously, just not detected/loaded in UltraTrace):

         ".wav": "File040_Track0.wav",
         "US.txt": "File040US.txt",
-         "name": "File040"
+         "name": "File040",
+         ".TextGrid": "/home/[user]/Documents/ultrasound-data-TatarKQ-191001/File040.TextGrid",
+         "NumberOfFrames": 178
      },