Code Monkey home page Code Monkey logo

Comments (4)

dpodvyaznikov avatar dpodvyaznikov commented on June 11, 2024 2

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.

from cardio.

dpodvyaznikov avatar dpodvyaznikov commented on June 11, 2024 2

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.

from cardio.

gsm2055 avatar gsm2055 commented on June 11, 2024

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)`

from cardio.

gsm2055 avatar gsm2055 commented on June 11, 2024

from cardio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.