Hi all
I am working with neo for some time, but recently only updated it.
So I am trying to save a preprocessed signal, neo object, and load it later with a different python script.
I was using hdf5, but I see now that saving is not supported by neo.
I am in a point that I cant save my segment/analog signal with annotations, and later load it.
Earlier it was easy:
iom = neo.io.hdf5IO(filename)
iom.save(segment)
iom.close()
iom2 = neo.io.hdf5IO(filename)
loaded = iom2.get()
iom2.close()
Right now I tried:
iom = neo.io.PickleIO(filename)
block = neo.block.Block(segment)
block.annotations= segment.annotations #all segment, block and analogsignal have those annotations
iom.write_block(block) #I tried with segment also
iom2 = neo.io.PickleIO(filename)
loaded = iom2.read_block()
#block = iom2.read()
iom2.close()
Here the signal was properly printed, with annotations, but the 'loaded' variable is not defined. In one or two loading functions, it was 'None'
iom =
neo.io.
NeoMatlabIO(filename+'.mat')
block = neo.block.Block(segment)
block.annotations= segment.annotations #all segment, block and analogsignal have those annotations
iom.write_block(block) #I tried with segment also
iom2 =
neo.io.
NeoMatlabIO(filename+'.mat')
segment = iom2.read()
iom2.close()
With matlab (I dont want to use matlab fileformat in python because of speed) I was finnaly able to load the signal, but without the annotations. Which is a pity, not to have channel indexes etc.
Is it a bug, or am I using a wrong IO/ using it incorrect?
Is there a way to do this other than saving the signal and the annotations independently?
Michal Czerwinski