Errors when converting from bci2000 dat format to table form

Forum for software developers to discuss BCI2000 software development
Locked
trevora
Posts: 10
Joined: 29 Apr 2014, 20:13

Errors when converting from bci2000 dat format to table form

Post by trevora » 30 Apr 2014, 01:47

Ran into the following errors when executing the command

Code: Select all

bci_dat2stream < myfile | bci_stream2table --output=mynewfile 
on some bci2000 files.

Code: Select all

subject4/EEG/subjectTM_4/TMsubject04S001R06.tsv
Runtime Error: Unhandled exception of type std::out_of_range: vector::_M_range_check
Aborting bci_stream2table
Also, is there any particular reason why bci_stream2table appends a hash (#) character to the header row and tab stops to the beginning of each line? This is kind of confusing.


For reference, here is the complete script that searches for .dat files in all subdirectories and converts them to tab-separated value files with the same name. Requires the fish shell and sponge.

Code: Select all

#!/usr/bin/fish

set filelist (ls **.dat)
# echo $filelist[1]


for infile in $filelist
	set outfile (basename $infile .dat)
	# echo $outfile".tsv"
	# echo (dirname $infile)"/$outfile".tsv
	set savefile (dirname $infile)"/$outfile".tsv
	echo $savefile
	bci_dat2stream < $infile | bci_stream2table --output=$savefile
	
	# Remove single hash character from file start
	# sed '1s/^.//' $savefile >> $savefile
	# better method
	tail -c +2 $savefile | sponge $savefile

	# remove first character from each line
	sed 's/^.//g' $savefile | sponge $savefile
end

heathj
Posts: 1
Joined: 07 Oct 2014, 08:47

Re: Errors when converting from bci2000 dat format to table

Post by heathj » 07 Oct 2014, 15:41

I am having the same issue. I am running the following command

Code: Select all

$ bci_dat2stream.exe < testS001R01.dat | bci_stream2table.exe
and getting the following result

Code: Select all

#       PhaseInSequence Recording       Running SelectedStimulus        SourceTime      StimulusBegin   StimulusCode    StimulusCodeRes StimulusTime    StimulusType    StimulusTypeRes      Signal(1,1)     Signal(1,1)     Signal(1,1)     Signal(1,1)     Signal(1,1)     Signal(1,1)     Signal(1,1)     Signal(1,1)     Signal(2,2)     Signal(2,2)     Signal(2,2) Signal(2,2)      Signal(2,2)     Signal(2,2)     Signal(2,2)     Signal(2,2)     Signal(3,3)     Signal(3,3)     Signal(3,3)     Signal(3,3)     Signal(3,3)     Signal(3,3)     Signal(3,3)  Signal(3,3)     Signal(4,4)     Signal(4,4)     Signal(4,4)     Signal(4,4)     Signal(4,4)     Signal(4,4)     Signal(4,4)     Signal(4,4)     Signal(5,5)     Signal(5,5) Signal(5,5)      Signal(5,5)     Signal(5,5)     Signal(5,5)     Signal(5,5)     Signal(5,5)     Signal(6,6)     Signal(6,6)     Signal(6,6)     Signal(6,6)     Signal(6,6)     Signal(6,6)  Signal(6,6)     Signal(6,6)     Signal(7,7)     Signal(7,7)     Signal(7,7)     Signal(7,7)     Signal(7,7)     Signal(7,7)     Signal(7,7)     Signal(7,7)     Signal(8,8) Signal(8,8)      Signal(8,8)     Signal(8,8)     Signal(8,8)     Signal(8,8)     Signal(8,8)     Signal(8,8)Runtime Error: Unhandled exception of type std::out_of_range: invalid vector<T> subscript
Aborting bci_stream2table

Error writing to standard output
Anyone have any suggestions?

Locked

Who is online

Users browsing this forum: No registered users and 0 guests