JaneliaSciComp / G4_Display_Tools

Collection of tools for the G4 LED arena displays.
Creative Commons Attribution 4.0 International
2 stars 2 forks source link

Read columns from TDMS files by name, not index #73

Closed floesche closed 4 months ago

floesche commented 1 year ago

The structure of logged data has changed between different versions of the G4 Host. The name of the "column" stayed the same, but it's position changed. Specifically #52 seems to have added a "class" column before "data". folder2struct reads the data by index and therefore gets an empty data structure:

https://github.com/JaneliaSciComp/G4_Display_Tools/blob/42bf6fb1f663068011af528ad72d30fc6798afee/G4_Data_Analysis/data%20processing/G4_TDMS_folder2struct.m#LL117C1-L117C73

A temporary fix for newer G4 Hosts is changing the index in line 117 from 3 to 4, but this will break compatibility with older G4 Hosts.

taylorlm88 commented 9 months ago

I updated this file a while back with an easier fix but perhaps not as robust as reading columns by name. Currently, it checks the third channel in the data to see what it's datatype is. "Class" is a cell array of doubles, and "Data" is a cell array of strings. This required a lot less code than restructuring the file to access and use column names, but I'm leaving this issue open in case there are ever issues with it in the future and we want to go ahead and do this.

floesche commented 4 months ago

Looks like this is fixed (slightly different) now.