Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

what is difference A00001~A08528 microsoft Access Table Shortcut and sel30~selxx #30

Closed
gsm2055 opened this issue Aug 30, 2019 · 4 comments
Assignees

Comments

@gsm2055
Copy link

gsm2055 commented Aug 30, 2019

there is item in " ..\cardio\cardio\tests\data " A0001~A00013 .hea and Microsoft Access Table Shortcut.

but there isn't in qt-database-1.0.0 Microsoft Access Table Shortcut.

what's the difference. and how can i read in qt-database-1.0.0?

using qt-database-1.0.0 i can train HMM algorithm. but i can't find the midium result..

@gsm2055
Copy link
Author

gsm2055 commented Aug 30, 2019

i get this error

File "", line 4, in
batch_with_data.show_ecg('A00008', start=30, end=35)

File "D:\anaconda3\lib\site-packages\cardio-0.3.0-py3.7.egg\cardio\core\ecg_batch.py", line 390, in show_ecg
i = 0 if index is None else self.get_pos(None, "signal", index)

File "D:\anaconda3\lib\site-packages\cardio-0.3.0-py3.7.egg\cardio\batchflow\batch.py", line 334, in get_pos
pos = self.index.get_pos(index)

File "D:\anaconda3\lib\site-packages\cardio-0.3.0-py3.7.egg\cardio\batchflow\dsindex.py", line 148, in get_pos
pos = self._pos[index]

`import os
import sys
sys.path.append("..")

import cardio.batchflow as bf
from cardio import EcgBatch
from cardio.models.metrics import classification_report

import tensorflow as tf

index = bf.FilesIndex(path="C:/Users/gsm20/Downloads/TestData/A*.hea", no_ext=True, sort=True)

print(index.indices)
#%%
eds = bf.Dataset(index, batch_class=EcgBatch)
batch = eds.next_batch(batch_size=2)
batch_with_data = batch.load(fmt="wfdb", components=["signal", "meta"])
batch_with_data.show_ecg('A00008', start=30, end=35)`

@dpodvyaznikov
Copy link
Member

Hi, @gsm2055!

Those files are not Microsoft Access Table files. In wfdb format data files can have different extensions: mat, dat, etc. So you should read those files as usual with load(fmt='wfdb', ...) method.
Please, refer to WFDB Guide for more information.

Regarding your second message: it is most likely that there is no element with index A00008 in batch. Try printing batch.indices, and use one of those indices in show_ecg.

@gsm2055
Copy link
Author

gsm2055 commented Aug 30, 2019 via email

@dpodvyaznikov
Copy link
Member

CardIO uses wfdb library to read data in wfdb format. You can use this library independently from CardIO. Please, read the documentation and go through demo notebook. wfdb has a built-in function to display signals.

Also, to display signal with CardIO, you can refer to tutorials/III. Models.ipynb, section CardIO segmentation models. First code chunk shows how to create EcgDataset object with QT data. Then you can generate new batch and use load and show_ecg methods as usual.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants