Skip to content

Commit

Permalink
fix missing and unneccessary variables in neuroshareio
Browse files Browse the repository at this point in the history
  • Loading branch information
toddrjen committed Jan 7, 2014
1 parent ac09f53 commit 3f534b2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions neo/io/neuroshareio.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ def __init__(self , filename = '', dllname = '') :



def read_segment(self, import_neuroshare_segment = True):
def read_segment(self, import_neuroshare_segment = True,
lazy=False, cascade=True):
"""
Arguments:
import_neuroshare_segment: import neuroshare segment as SpikeTrain with associated waveforms or not imported at all.
Expand Down Expand Up @@ -178,7 +179,7 @@ def read_segment(self, import_neuroshare_segment = True):
else:
pdwContCount = ctypes.c_uint32(0)
pData = np.zeros( (entityInfo.dwItemCount,), dtype = 'f8')
ns_RESULT = neuroshare.ns_GetAnalogData ( hFile, dwEntityID, dwStartIndex,
neuroshare.ns_GetAnalogData ( hFile, dwEntityID, dwStartIndex,
dwIndexCount, ctypes.byref( pdwContCount) , pData.ctypes.data_as(ctypes.POINTER(ctypes.c_double)))
pszMsgBuffer = ctypes.create_string_buffer(" "*256)
neuroshare.ns_GetLastErrorMsg(ctypes.byref(pszMsgBuffer), 256)
Expand All @@ -205,7 +206,7 @@ def read_segment(self, import_neuroshare_segment = True):

pdwSegmentInfo = ns_SEGMENTINFO()

ns_RESULT = neuroshare.ns_GetSegmentInfo( hFile, dwEntityID,
neuroshare.ns_GetSegmentInfo( hFile, dwEntityID,
ctypes.byref(pdwSegmentInfo), ctypes.sizeof(pdwSegmentInfo) )
nsource = pdwSegmentInfo.dwSourceCount

Expand All @@ -232,7 +233,7 @@ def read_segment(self, import_neuroshare_segment = True):
times = np.empty( (entityInfo.dwItemCount), drtype = 'f')
waveforms = np.empty( (entityInfo.dwItemCount, nsource, nsample), drtype = 'f')
for dwIndex in range(entityInfo.dwItemCount ):
ns_RESULT = neuroshare.ns_GetSegmentData ( hFile, dwEntityID, dwIndex,
neuroshare.ns_GetSegmentData ( hFile, dwEntityID, dwIndex,
ctypes.byref(pdTimeStamp), pData.ctypes.data_as(ctypes.POINTER(ctypes.c_double)),
dwDataBufferSize * 8, ctypes.byref(pdwSampleCount),
ctypes.byref(pdwUnitID ) )
Expand Down

0 comments on commit 3f534b2

Please sign in to comment.