You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, all. I have never used neo directly before, so I apologize if this is just user error. But I have read through docs and code, and I think what I'm seeing is unexpected behavior.
I have a TDT tank containing a single TDT block using SEV (rather than TEV) format. I can successfully create a TdtIO object, read the .Tbk and .tsq files, which seem to reflect the right streams, with the right names, and the right numbers of channels. But it seems as if these header files are not being parsed properly, because the AnalogSignal objects that I get have incorrect sampling rates (1.0 Hz, vs the actual ~610Hz), incorrect durations (0.0s vs several hours), and no actual data (e.g. anasig.shape is (0, 4) for a 4 channel signal). I notice that the TdtIO._sigs_lengths dict is {0: {0: 0, 1: 0}}, which it seems should reflect the size of the data. But there doesn't at first glance appear to be anything wrong with the '.Tbk' and '.tsq' parsing, so perhaps the issue lies somewhere in between.
Here's a demonstration: read_tdt_using_neo.pdf. The data are ~800MB. Let me know if you'd like a copy in order to reproduce the issue.
Hhi Graham,
I did this reader very long time ago.
I don't remember any detail. @JuliaSprenger : have refactor a bit recently. Maybe she will be able to help.
Hi @grahamfindlay, thanks for reporting this. My first suspicion would be that the .sev files are not detected by the io, as they are containing an additional _EEGf identifier in the filename, that is not present for the other files. Could you try renaming some of your sev files to just FCSV_EEG-220215-173221_Paul-220607-102425_Ch{1..4}.sev?
Thanks, both. 4 of the .sev files have _EEGf identifiers, and 4 have _EEGr identifiers. If I were to delete these identifiers from both sets of files, then the two sets would have identical filenames (i.e. the filenames are identical apart from these identifiers), so I can't do that. What I did instead, was:
Delete the _EEGf identifiers, and leave the _EEGr identifiers in place. This was unsuccessful (Sorry for the ugly pandoc/nbconvert formatting >.<) attempt1.pdf
Delete the _EEGf identifiers, and delete the _EEGr files entirely. This was also unsuccessful. attempt2.pdf
Perhaps it would be possible to use TDT's Python package to handle ingest of their data & headers/metadata, and massage this into the standardized neo format?
The "EEGr" and "EEGf" identifiers correspond to stream names, and are set by the user. In my case they are abbreviations for "EEG raw" and "EEG filtered", but likely ever user has their own stream identifiers based on how they've configured their recording project. So it will be necessary to accept arbitrary identifiers.
I have tried to reverse engineer TDT file formats before, and they can be quite complicated. There are really several different formats depending on recording software / hardware version, user choices, etc. That's why using their python package may save a lot of time, if possible.
@JuliaSprenger One of my colleagues is also not able to load his TDT data using v0.10.2 because of another issue:
Neo assumes that the path to the .Tbk file will be of the form <tank>/<block>/<tank>_<block>.Tbk, when apparently it is common practice to rename the tank and block directories after recording, because TDT adds timestamps to these names that make them very long. Apparently the TDT python package has no issue with this directory structure, and only cares that there is a .Tbk file at the block path that you provide it with.
Example: /Volumes/opto_loc/Data/ACR_exp/ACR_9/ACR_exp-220614-083228_ACR_9-220617-083308.Tbk'
At the time of recording, the user requested the tank name "ACR_exp" and the block name was "ACR_9". Then TDT added the time and datestamps when saving to disk, and the user subsequently stripped them from from the directory names.
At first I thought that it doesn't make sense to expect support for post-recording modification of the tank and block names, but given that these are the names the user actually requests from the software, and the timestamped versions do not appear anywhere else in the file metadata, and TDT's own python package has no issue with this, and it seems to be common behavior, perhaps it would make sense to follow their lead and not check .Tbk filename against the parent and grandparent directory names.
@M-Hisham, if you're willing to share small files we could try to work on this more to update our reader. We always need test data to reverse engineer file formats.
@zm711 Having once gone through the nightmare of trying to reverse-engineer the many undocumented flavors of file format that TDT has, I strongly suggest just using their tdt package to read what's needed by neo. It seems like there's already precedent for this, e.g. using pynwb to read NWB, or using igor2 to read IGOR files. And as with those, it could be an extra, if you're worried about dependency bloat.
Thanks Graham. We've gone back and forth. There is some desire to remove all external package dependencies and reverse-engineer everything and some desire to use open source tools. I'll read up on the package and bring it up at our maintenance meeting and see what people think.
It's a bit weird, both their matlab and python repo's have GNU licenses, but it looks like the source code is closed source (which isn't compatible). Maybe I could download the tdt package and see what license is included in the package. I think for something that is (closed?) source I would probably lean toward not being dependent on something we don't fully know.
But like I said I will bring this up since I don't think we have the maintainer time right now to fully work on tdt.
@M-Hisham, if you're willing to share small files we could try to work on this more to update our reader. We always need test data to reverse engineer file formats.
Hello I have shared some files in the original TDT format here
the sev files stream is named as "RSn1"
The main data we are interested in is in the SEV files, each file contain the data stream for one channel.
The folder size is around 1GB, sorry for that, but I wasn't sure if loading the data correctly would still work with less channels.
@M-Hisham thanks. I take Graham's point seriously. I'll take a look in the next couple weeks, but no guarantee if the format is too complicated. We have a group meeting in a couple weeks so if I can't get something working I'll bring it up with the group then.
Activity
[-]Issues reading analog signals from TDT SEV[/-][+]Analog signal data not read from TDT SEV[/+]samuelgarcia commentedon Jun 16, 2022
Hhi Graham,
I did this reader very long time ago.
I don't remember any detail.
@JuliaSprenger : have refactor a bit recently. Maybe she will be able to help.
JuliaSprenger commentedon Jun 16, 2022
Hi @grahamfindlay, thanks for reporting this. My first suspicion would be that the
.sevfiles are not detected by the io, as they are containing an additional_EEGfidentifier in the filename, that is not present for the other files. Could you try renaming some of your sev files to justFCSV_EEG-220215-173221_Paul-220607-102425_Ch{1..4}.sev?grahamfindlay commentedon Jun 16, 2022
Thanks, both. 4 of the
.sevfiles have_EEGfidentifiers, and 4 have_EEGridentifiers. If I were to delete these identifiers from both sets of files, then the two sets would have identical filenames (i.e. the filenames are identical apart from these identifiers), so I can't do that. What I did instead, was:Delete the
_EEGfidentifiers, and leave the_EEGridentifiers in place. This was unsuccessful (Sorry for the ugly pandoc/nbconvert formatting >.<)attempt1.pdf
Delete the
_EEGfidentifiers, and delete the_EEGrfiles entirely. This was also unsuccessful.attempt2.pdf
Perhaps it would be possible to use TDT's Python package to handle ingest of their data & headers/metadata, and massage this into the standardized neo format?
JuliaSprenger commentedon Jun 23, 2022
I will extend the TDTIO to include also the
_EEGfand_EEGrtype postfixes in the internal channel identifiers.grahamfindlay commentedon Jun 23, 2022
The "EEGr" and "EEGf" identifiers correspond to stream names, and are set by the user. In my case they are abbreviations for "EEG raw" and "EEG filtered", but likely ever user has their own stream identifiers based on how they've configured their recording project. So it will be necessary to accept arbitrary identifiers.
I have tried to reverse engineer TDT file formats before, and they can be quite complicated. There are really several different formats depending on recording software / hardware version, user choices, etc. That's why using their python package may save a lot of time, if possible.
grahamfindlay commentedon Aug 2, 2022
@JuliaSprenger One of my colleagues is also not able to load his TDT data using v0.10.2 because of another issue:
Neo assumes that the path to the
.Tbkfile will be of the form<tank>/<block>/<tank>_<block>.Tbk, when apparently it is common practice to rename the tank and block directories after recording, because TDT adds timestamps to these names that make them very long. Apparently the TDT python package has no issue with this directory structure, and only cares that there is a.Tbkfile at the block path that you provide it with.Example:
/Volumes/opto_loc/Data/ACR_exp/ACR_9/ACR_exp-220614-083228_ACR_9-220617-083308.Tbk'At the time of recording, the user requested the tank name "ACR_exp" and the block name was "ACR_9". Then TDT added the time and datestamps when saving to disk, and the user subsequently stripped them from from the directory names.
At first I thought that it doesn't make sense to expect support for post-recording modification of the tank and block names, but given that these are the names the user actually requests from the software, and the timestamped versions do not appear anywhere else in the file metadata, and TDT's own python package has no issue with this, and it seems to be common behavior, perhaps it would make sense to follow their lead and not check
.Tbkfilename against the parent and grandparent directory names.grahamfindlay commentedon Aug 5, 2022
Update: Found another person with this same issue involving .Tbk naming.
2 remaining items
M-Hisham commentedon Mar 13, 2025
I have similar experience too. I wish we can depend on the official TDT lib to handle this.
SpikeInterface/spikeinterface#1882 (comment)
zm711 commentedon Mar 18, 2025
@M-Hisham, if you're willing to share small files we could try to work on this more to update our reader. We always need test data to reverse engineer file formats.
grahamfindlay commentedon Mar 18, 2025
@zm711 Having once gone through the nightmare of trying to reverse-engineer the many undocumented flavors of file format that TDT has, I strongly suggest just using their
tdtpackage to read what's needed byneo. It seems like there's already precedent for this, e.g. usingpynwbto read NWB, or usingigor2to read IGOR files. And as with those, it could be an extra, if you're worried about dependency bloat.zm711 commentedon Mar 18, 2025
Thanks Graham. We've gone back and forth. There is some desire to remove all external package dependencies and reverse-engineer everything and some desire to use open source tools. I'll read up on the package and bring it up at our maintenance meeting and see what people think.
It's a bit weird, both their matlab and python repo's have GNU licenses, but it looks like the source code is closed source (which isn't compatible). Maybe I could download the tdt package and see what license is included in the package. I think for something that is (closed?) source I would probably lean toward not being dependent on something we don't fully know.
But like I said I will bring this up since I don't think we have the maintainer time right now to fully work on tdt.
M-Hisham commentedon Mar 20, 2025
Hello I have shared some files in the original TDT format here
the sev files stream is named as "RSn1"
The main data we are interested in is in the SEV files, each file contain the data stream for one channel.
The folder size is around 1GB, sorry for that, but I wasn't sure if loading the data correctly would still work with less channels.
zm711 commentedon Mar 21, 2025
@M-Hisham thanks. I take Graham's point seriously. I'll take a look in the next couple weeks, but no guarantee if the format is too complicated. We have a group meeting in a couple weeks so if I can't get something working I'll bring it up with the group then.