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
We have developed a pyintan class that parses RHS (not RHD for now but the extension should be straightforward, you probably just need to remove the stimulation part).
We haven't converted it to neo directly because we wanted to keep it more flexible.
Anyways the conversion should be easy as we have neo-like classes such as Analogsignals, DigitalSignals, etc..
thank you for sharing your code. To read rhd files there is also a script provided on the intan website.
I will also look into your code to see which one may be easier to convert to neo.
I am still in the stage of understanding the neo interface and in particular the baseio to do this properly. I looked into both the python script from intan as well as Alessio's solution. Both do a fine job at loading files and it would be fairly straight forward to transform the result into neo objects. Implementing the lazy and cascade options however, would require a lot more effort from what I can tell. I think fully implementing a workaround that depends on another io should of course work but is not a good idea in the neo framework. I am still looking into it.
We have developed a pyintan class that parses RHS (not RHD for now but the extension should be straightforward, you probably just need to remove the stimulation part).
We haven't converted it to neo directly because we wanted to keep it more flexible.
Anyways the conversion should be easy as we have neo-like classes such as Analogsignals, DigitalSignals, etc..
Hi Alessio,
Im trying to read intan rhs files, but I cant work it out (new to Python). I have no idea how to implement your script you generously provided. Would you mind giving me some instructions on how to use your code to extract data from an Intan .rhs file? I'd be super grateful!!
Cheers
Jason
Hi Alessio,
Im trying to read intan rhs files, but I cant work it out (new to Python). I have no idea how to implement your script you generously provided. Would you mind giving me some instructions on how to use your code to extract data from an Intan .rhs file? I'd be super grateful!!
Cheers
Jason
Thanks Alessio,
I wrote to Intan after my message to you and they have just submitted files for reading rhs files! I am yet to work out how to implement it, but the timing is hilarious!
Hi Alessio,
I am looking for the sampling frequency, is must be there somewhere because
it generates this value as it converts it. Any easy way to call it?
cheers
Jason
I plan to read both RHD and RHS in the same IO wich is a bit chalenge but there is a strong overlap between the 2 file format.
pyintan deal only with rhs.
With official code provide by intan, there are 2 different zip archive (one for each format) whihch have a very string overlap. Bad pratice!! The official code provide by intan is not efficient at all. They don't use memmap and preallocate everything.
This version should be faster and **do not pre allocate any array. Chunk are read on demand.
Done:
read header for rhs
read signal by time slice
read signal channel slice
To be done:
deal with units/gain/offset: should be easy
deal with digital port : (make them as event ???)
do the RDH header wich have 3 diffrents version (1.0, to 1.3)
do the neo.io class : easy.
@alejoe91 I have a strong problem with the only file I tested bipolarstim_5uA_170418_192008.rhs. They is some a gap in timestamp which means that there is probably a data packet lost.
In short the timestamp vector is not continuous.
How are you dealing with this in pyintan ?
See line 60 in my code. If you uncomment it you raise error.
Also, not sure why, but I couldn't get your first script to work properly because I wasn't specifying the right channel indexes (and I didnt know what they were supposed to be). Not sure if that's helpful info or not!)
I am trying to use this reader (neo.io.IntanIO) to read output from an RHD2164 in the "one channel per file" format but I see zero time points. The output is in a folder with several .dat files and an info.rhd file. I am guessing I get zero time-points because only the .rhd file is read and the .dat files are left out. Am I right? Is there some sort of an option to read this "one channel per file" format ?
Activity
apdavison commentedon Apr 3, 2017
Not to my knowledge.
alejoe91 commentedon May 5, 2017
Hi,
We have developed a pyintan class that parses RHS (not RHD for now but the extension should be straightforward, you probably just need to remove the stimulation part).
We haven't converted it to neo directly because we wanted to keep it more flexible.
Anyways the conversion should be easy as we have neo-like classes such as Analogsignals, DigitalSignals, etc..
The code is here:
https://github.com/CINPLA/expipe-io-neuro/blob/dev/expipe_io_neuro/intan/pyintan.py
I hope this helps!
Alessio
danielmk commentedon May 5, 2017
Hey Alessio,
thank you for sharing your code. To read rhd files there is also a script provided on the intan website.
I will also look into your code to see which one may be easier to convert to neo.
johntukker commentedon Jun 30, 2017
hi Daniel, I'm also interested in this, currently trying a 'workaround' which is to use the intan converter to NeuroExplorer format (available at http://intantech.com/downloads.html), and then using the NeuroExplorerIO. I just tried this today, still having some trouble with the NeuroExplorer IO possibly related to Python version, so cannot say yet that it's a good idea, but maybe worth considering (perhaps you have more luck/Python skills). cheers, John
danielmk commentedon Jul 6, 2017
Hello John,
I am still in the stage of understanding the neo interface and in particular the baseio to do this properly. I looked into both the python script from intan as well as Alessio's solution. Both do a fine job at loading files and it would be fairly straight forward to transform the result into neo objects. Implementing the lazy and cascade options however, would require a lot more effort from what I can tell. I think fully implementing a workaround that depends on another io should of course work but is not a good idea in the neo framework. I am still looking into it.
Best,
Daniel
samuelgarcia commentedon Jul 6, 2017
I am refactoring neo.io into neo.rawio.
This is work in progress but I guess that writting an IO with this new low level API is much simpler for a dev.
If you code something in neo.rawio the neo.io is automatic and there are no need to code lazy and cascade stuff!
Have a look here #355 and #354.
bionicinnovations commentedon Oct 25, 2018
Hi Alessio,
Im trying to read intan rhs files, but I cant work it out (new to Python). I have no idea how to implement your script you generously provided. Would you mind giving me some instructions on how to use your code to extract data from an Intan .rhs file? I'd be super grateful!!
Cheers
Jason
samuelgarcia commentedon Oct 25, 2018
I will have a look at this code to write the neo.rawio.intrawio.
For the moment I need a file to start the work.
alejoe91 commentedon Oct 25, 2018
Hi @bionicinnovations !
I setup a python package to quickly load intan files. You can find it here: https://github.com/alejoe91/pyintan
It's not tested, but it gives quick access to the recordings.
@samuelgarcia I have some .rhs files that I could share them with you. If you are interested write me an email: [email protected]
Cheers,
Alessio
bionicinnovations commentedon Oct 25, 2018
Thanks Alessio,
I wrote to Intan after my message to you and they have just submitted files for reading rhs files! I am yet to work out how to implement it, but the timing is hilarious!
http://www.intantech.com/files/load_intan_rhs_format.zip
If I can't work out what to do next, I'll send you an email. Thanks again!!
Cheers
Jason
samuelgarcia commentedon Oct 26, 2018
I was aware of theses intan script. You can have them here.
I still plan to implement intan in neo.rawio. This will be uselfull for people who want to sort spikes with tridesclous.
bionicinnovations commentedon Oct 29, 2018
Thanks Alessio, pyintan works great!! ;-)
bionicinnovations commentedon Oct 29, 2018
samuelgarcia commentedon Nov 5, 2018
@bionicinnovations @alejoe91 @johntukker @danielmuellernai
I have done more or less the base for the new intanIO.
See here: https://github.com/samuelgarcia/python-neo/tree/intanrawio
I plan to read both RHD and RHS in the same IO wich is a bit chalenge but there is a strong overlap between the 2 file format.
pyintan deal only with rhs.
With official code provide by intan, there are 2 different zip archive (one for each format) whihch have a very string overlap. Bad pratice!! The official code provide by intan is not efficient at all. They don't use memmap and preallocate everything.
This version should be faster and **do not pre allocate any array. Chunk are read on demand.
Done:
To be done:
@alejoe91 I have a strong problem with the only file I tested bipolarstim_5uA_170418_192008.rhs. They is some a gap in timestamp which means that there is probably a data packet lost.
In short the timestamp vector is not continuous.
How are you dealing with this in pyintan ?
See line 60 in my code. If you uncomment it you raise error.
In any case I strongly need a rhd file for starting continuing the job.
Does anyone have this ?
If anyone have time to test it : install the working branch and do this:
samuelgarcia commentedon Nov 6, 2018
@alejoe91 do take in account previous comment about timestamp. It was a bug in previous comit.
samuelgarcia commentedon Nov 7, 2018
Implemented in #593
Need rdh and rhs files at gnode for CI before merging.
samuelgarcia commentedon Nov 7, 2018
The latest commit:
@bionicinnovations : could you confirm that this figure for first channel on file bipolarstim_5uA_170418_192008.rhs looks OK:
bionicinnovations commentedon Nov 8, 2018
Hi Samuel, I don't have bipolarstim_5uA_170418_192008.rhs so I can't test it.
The file I sent you was called: pul04_180727_163010.rhs, there is the link to that file:
https://drive.google.com/file/d/1w7big3U3Xxbt-88B0tFhR_fOITIXKGxp/view?usp=sharing
when I use my file and substitute sig as follows:
sig = seg.analogsignals[1].magnitude[:, 0] # I use the second channel [1], not the first [0], I get this output:
bionicinnovations commentedon Nov 8, 2018
I also get this output which I think reflects my Intan hardware:
Channel bundle (B-000,B-001,B-002,B-003,B-004,B-005,B-006,B-007,B-008,B-009,B-010,B-011,B-012,B-013,B-014,B-015,B-016,B-017,B-018,B-019,B-020,B-021,B-022,B-023,B-024,B-025,B-026,B-027,B-028,B-029,B-030,B-031) (517120, 32) 1.0 uV
['B-000' 'B-001' 'B-002' 'B-003' 'B-004' 'B-005' 'B-006' 'B-007' 'B-008'
'B-009' 'B-010' 'B-011' 'B-012' 'B-013' 'B-014' 'B-015' 'B-016' 'B-017'
'B-018' 'B-019' 'B-020' 'B-021' 'B-022' 'B-023' 'B-024' 'B-025' 'B-026'
'B-027' 'B-028' 'B-029' 'B-030' 'B-031']
Channel bundle (ANALOG-IN-1,ANALOG-IN-2,ANALOG-IN-3) (517120, 3) 1.0 V
['ANALOG-IN-1' 'ANALOG-IN-2' 'ANALOG-IN-3']
Channel bundle (ANALOG-OUT-1,ANALOG-OUT-4) (517120, 2) 1.0 V
['ANALOG-OUT-1' 'ANALOG-OUT-4']
Channel bundle (B-000_STIM,B-001_STIM,B-002_STIM,B-003_STIM,B-004_STIM,B-005_STIM,B-006_STIM,B-007_STIM,B-008_STIM,B-009_STIM,B-010_STIM,B-011_STIM,B-012_STIM,B-013_STIM,B-014_STIM,B-015_STIM,B-016_STIM,B-017_STIM,B-018_STIM,B-019_STIM,B-020_STIM,B-021_STIM,B-022_STIM,B-023_STIM,B-024_STIM,B-025_STIM,B-026_STIM,B-027_STIM,B-028_STIM,B-029_STIM,B-030_STIM,B-031_STIM) (517120, 32) 1.0 dimensionless
['B-000_STIM' 'B-001_STIM' 'B-002_STIM' 'B-003_STIM' 'B-004_STIM'
'B-005_STIM' 'B-006_STIM' 'B-007_STIM' 'B-008_STIM' 'B-009_STIM'
'B-010_STIM' 'B-011_STIM' 'B-012_STIM' 'B-013_STIM' 'B-014_STIM'
'B-015_STIM' 'B-016_STIM' 'B-017_STIM' 'B-018_STIM' 'B-019_STIM'
'B-020_STIM' 'B-021_STIM' 'B-022_STIM' 'B-023_STIM' 'B-024_STIM'
'B-025_STIM' 'B-026_STIM' 'B-027_STIM' 'B-028_STIM' 'B-029_STIM'
'B-030_STIM' 'B-031_STIM']
It took me a while how to install the package etc, I am new at all this, but I got it to work (and learned lots along the way!)
bionicinnovations commentedon Nov 8, 2018
Also, not sure why, but I couldn't get your first script to work properly because I wasn't specifying the right channel indexes (and I didnt know what they were supposed to be). Not sure if that's helpful info or not!)
Thanks for your hard work!
samuelgarcia commentedon Nov 22, 2018
Close by #593
ChauhanT commentedon Sep 22, 2023
Hi,
I am trying to use this reader (neo.io.IntanIO) to read output from an RHD2164 in the "one channel per file" format but I see zero time points. The output is in a folder with several .dat files and an info.rhd file. I am guessing I get zero time-points because only the .rhd file is read and the .dat files are left out. Am I right? Is there some sort of an option to read this "one channel per file" format ?
Thank you!