open-ephys / open-ephys-matlab-tools

Matlab code for interacting with the Open Ephys GUI
MIT License
11 stars 8 forks source link

Running into errors when running "session" #8

Open crewl2 opened 1 year ago

crewl2 commented 1 year ago

I'm running into errors trying to run the session command. I need some guidance to learn how to use this matlab package. Any help would be appreciated.

crewl2 commented 1 year ago

I'm frustrated that no one has helped me with this. I cannot get it to run, and I have hundreds of binary files that I would like to read and open in Matlab. Please assist! Thank you..

medengineer commented 1 year ago

Hi,

Can you please post the Matlab commands you are using to load your files using the latest v1.3.0 of matlab-tools along with any error output?

Thanks!

crewl2 commented 1 year ago

Thank you so much, I've been trying to figure this out on my own, but I just don't have enough expertise in this area to work through it.

directory = '/Volumes/SHUGGIE/2023-08-14_14-56-28_TouchScreenTTLTest' % for example

session = Session(directory)

session = Session(directory) [DEBUG] Searching directory: /Volumes/SHUGGIE/2023-08-14_14-56-28_TouchScreenTTLTest [DEBUG] Found recording format: Binary Intermediate brace '{}' indexing produced a comma-separated list with 0 values, but it must produce a single value when followed by subsequent indexing operations.

Error in BinaryRecording/loadSyncMessages (line 211) nodename = strjoin({strjoin(message(4:(idx-4)),''),message{idx-3}(2:end-1)},'-');

Error in BinaryRecording/loadContinuous (line 50) syncMessages = self.loadSyncMessages();

Error in BinaryRecording (line 40) self = self.loadContinuous();

Error in BinaryRecording.detectRecordings (line 254) recordings{end+1} = BinaryRecording(recordingDirectories{recIdx}, expIdx, recIdx);

Error in RecordNode/detectRecordings (line 95) self.recordings = BinaryRecording.detectRecordings(self.directory);

Error in RecordNode (line 71) self.detectRecordings();

Error in Session/detectRecordNodes (line 70) self.recordNodes{end+1} = RecordNode(paths{i});

Error in Session (line 61) self.detectRecordNodes();

Related documentation

medengineer commented 1 year ago

The error message suggests you are using an older version of matlab-tools that uses the loadSyncMessages() function which is causing the crash.

The latest version 1.3.0 released ~2 months ago no longer uses this function. Can you confirm you are using the latest version on the Releases page?

crewl2 commented 1 year ago

I updated matlab-tools and I am now getting this error:

File not found: /Volumes/SHUGGIE/2023-08-14_14-56-28_TouchScreenTTLTest/Record Node 102/experiment1/recording1/continuous/Rhythm_FPGA-100.0/sample_numbers.npy

Error in readNPY (line 9) [shape, dataType, fortranOrder, littleEndian, totalHeaderLength, ~] = readNPYheader(filename);

Error in BinaryRecording/loadContinuous (line 73) stream.sampleNumbers = readNPY(fullfile(directory, 'sample_numbers.npy'));

Error in BinaryRecording (line 40) self = self.loadContinuous();

Error in BinaryRecording.detectRecordings (line 240) recordings{end+1} = BinaryRecording(recordingDirectories{recIdx}, expIdx, recIdx);

Error in RecordNode/detectRecordings (line 95) self.recordings = BinaryRecording.detectRecordings(self.directory);

Error in RecordNode (line 71) self.detectRecordings();

Error in Session/detectRecordNodes (line 70) self.recordNodes{end+1} = RecordNode(paths{i});

Error in Session (line 61) self.detectRecordNodes();

crewl2 commented 1 year ago

Which is one of the original errors I was getting. I'm not sure where sample_numbers.npy is supposed to be located as I don't have that in my files.

medengineer commented 1 year ago

Missing sample_numbers.npy suggests your recordings are from an older version of OpenEphys GUI.

If you can post here the GUI version number of your recordings, (it can be found in the settings.xml file), I can apply the patch to the proper version of matlab tools and you will be able to load your recordings.

crewl2 commented 1 year ago
0.5.4

Is this correct?

medengineer commented 1 year ago

Yes, version 0.5.4 did not have sample_numbers.npy yet.

Can you try loading your session using the version linked below and post any error output if it still doesn't work?

https://www.dropbox.com/scl/fi/z32aw9x8dasnt8jdat6js/matlab-tools-0.5.4.zip?rlkey=rkkz08rpyes61ji08nqp2m1ks&dl=0

medengineer commented 1 year ago

This older version of Matlab tools does not have the Utils package.

Are you able to run the following commands using your own data path?

session = Session( '/home/open-ephys/2021-03-24_15-17-19' ) session.show()

On Aug 29, 2023, at 3:15 PM, crewl2 @.***> wrote:

Okay, I did everything you mentioned. However, trying to run the example script, I'm now having issues with Utils.getLatestRecordings. I'm not sure if this is something stupid, but if you could help me with this that would be great. Thank you.

— Reply to this email directly, view it on GitHubhttps://github.com/open-ephys/open-ephys-matlab-tools/issues/8#issuecomment-1698216802, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACOMURFFM2CZHNUSLH3GE73XXZSZHANCNFSM6AAAAAAY454WBI. You are receiving this because you were assigned.Message ID: @.***>