-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #143 from nkinsky/main
Merge Nat fork
- Loading branch information
Showing
8 changed files
with
131 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
from pathlib import Path | ||
|
||
from neuropy.io.neuroscopeio import NeuroscopeIO | ||
from neuropy.io.binarysignalio import BinarysignalIO | ||
|
||
|
||
class ProcessData: | ||
def __init__(self, basepath): | ||
basepath = Path(basepath) | ||
self.basepath = basepath | ||
xml_files = sorted(basepath.glob("*.xml")) | ||
assert len(xml_files) == 1, "Found more than one .xml file" | ||
|
||
fp = xml_files[0].with_suffix("") | ||
self.filePrefix = fp | ||
|
||
self.recinfo = NeuroscopeIO(xml_files[0]) | ||
eegfiles = sorted(basepath.glob("*.eeg")) | ||
assert len(eegfiles) == 1, "Fewer/more than one .eeg file detected" | ||
self.eegfile = BinarysignalIO( | ||
eegfiles[0], | ||
n_channels=self.recinfo.n_channels, | ||
sampling_rate=self.recinfo.eeg_sampling_rate, | ||
) | ||
try: | ||
self.datfile = BinarysignalIO( | ||
eegfiles[0].with_suffix(".dat"), | ||
n_channels=self.recinfo.n_channels, | ||
sampling_rate=self.recinfo.dat_sampling_rate, | ||
) | ||
except FileNotFoundError: | ||
print("No dat file found, not loading") | ||
|
||
def __repr__(self) -> str: | ||
return f"{self.__class__.__name__}({self.recinfo.source_file.name})" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters