Closed sami10007 closed 8 years ago
sig=rdsamp(strcat(database,num2str(patient)),channel);
Does this not work?
I'm using the latest github development version although rdsamp hasn't been changed since June 2015 so 0-9-10 should have the same rdsamp as the one I'm using.
sig=rdsamp('nsrdb/16265');
Gives me
-0.165000000000000 -0.325000000000000
-0.155000000000000 -0.325000000000000
-0.195000000000000 -0.305000000000000
-0.205000000000000 -0.305000000000000
...
sig=rdsamp('nsrdb/16265', 1);
Gives me
-0.165000000000000
-0.155000000000000
-0.195000000000000
-0.205000000000000
...
Can you try that command and tell me what it gives you, or try 0-9-10?
sig=rdsamp('16265'); size(sig)
ans =
11730944 2
Quite a large signal. The file is downloaded and cached in the database
directory before it is read. Perhaps your connection to PhysioNet was slow, If you manually download the file (or use rsync) and then call rdsamp on it, how long does it take? Also the java wrapper via rdsamp is rather slow when reading large arrays into memory but that shouldn't be the rate determining step.
>> tic;sig=rdsamp('16265');toc;
Elapsed time is 1.465067 seconds.
On my 2GHz computer.
Hi Sami Can you paste your WFDB configuration for both systems:
[~,config]=wfdbloadlib
@cx1111 @ikarosilva Can you please read the body. I have to get this issue solved as fast as possible.
Error using rdsamp (line 203)
Could not find record: NSRDB/16272. Search path is set to: '.
/home/masi/Documents/DI/wfdb-app-toolbox/mcode/../database/ http://physionet.org/physiobank/database/'
Error in vertaa (line 165)
[~, cSignals{cIndex}]=rdsamp(strcat(database,num2str(patient)),channel); % plot(tm,sig);
... implies that it can't find the data on your path. Have you edited the WFDB_PATH variable in wfdbloadlib.m to include /home/masi/Documents/DI/
?
Please reproduce exactly the script and the error.
On Nov 8, 2016 10:38 AM, "Masi" notifications@github.com wrote:
I tried this WFDB_PATH=['/home/masi/Documents/DI/']; at the beginning of the script but I keep getting the errors. I also tried it in the workaround. Can you please propose how to do it correctly?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ikarosilva/wfdb-app-toolbox/issues/133#issuecomment-259170233, or mute the thread https://github.com/notifications/unsubscribe-auth/ABOSdKXySlDcFrWytj4uo-B8OKPWoCgYks5q8JdvgaJpZM4KkLRs .
The config from your workaround does not reflect a change of WFDB_PATH to my recommendation. Is that the output after changing the WFDB_PATH to '/home/masi/Documents/DI/'
? Perhaps you have two folders with the toolbox?
Your WFDB_PATH variable still does not seem updated. If you update it in wfdbloadlib.m, it should take on that value. It should not be the default. A workaround for this is to work in the same directory as the data - so work in /home/masi/Documents/DI/NSRDB/
and call [~, cSignal] = rdsamp(num2str(patient),channel)
.
Edit the file and change the WFDB_PATH variable to the location of your data (line 50). By default in the file it is initialized to an empty array.
On Wed, Nov 9, 2016 at 12:09 AM, Masi notifications@github.com wrote:
@alistairewj https://github.com/alistairewj
How can you change wfdbloadlib.m?
Mine is
function [varargout]=wfdbloadlib(varargin) % % [isloaded,config]=wfdbloadlib(debugLevel,networkWaitTime) % % Loads the WDFDB libarary if it has not been loaded already into the % MATLAB classpath. And optionally prints configuration environment and debug information % regarding the settings used by the classes in the JAR file. % % Inputs: % % debugLevel % (Optional) 1x1 integer between 0 and 5 represeting the level of debug information to output from % Java class when output configuration information. Level 0 (no debug information), % level =5 is maximum level of information output by the class (logger set to finest). Default is level 0. % % networkWaitTime % (Optional) 1x1 integer representing the longest time in % milliseconds for which the JVM should wait for a data stream from % PhysioNet (default is =1000 , ie one second). If you need to change this time to a % longer value across the entire toolbox, it is better modify to default value in the source % code below and restart MATLAB. % % % Written by Ikaro Silva, 2013 % Last Modified: April 7, 2015 % Since 0.0.1 % %
I will try the workaround because I just need the data.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ikarosilva/wfdb-app-toolbox/issues/133#issuecomment-259335126, or mute the thread https://github.com/notifications/unsubscribe-auth/ABOSdDDoxeu7KD96XiIKTu_HyZJZXd4jks5q8VV5gaJpZM4KkLRs .
I don't believe you have done what I asked you to try. You stated that you added the variable at the top of the script you are running - but I asked you to change the variable set at line 50 of the wfdbloadlib.m file. Can you confirm that?
On Nov 9, 2016 12:42 AM, "Masi" notifications@github.com wrote:
@alistairewj https://github.com/alistairewj Please, see the body. First proposal fails.
Let's try the differential solution because I just need the data [5,30] min channel 1 as fast as possible. I duplicate everything to the data directory, see Workaround 2 with the minimal script, but it fails. Do you know why?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ikarosilva/wfdb-app-toolbox/issues/133#issuecomment-259338045, or mute the thread https://github.com/notifications/unsubscribe-auth/ABOSdCsRUDZuEHgpk1ua08xnTZTFTgiCks5q8V0xgaJpZM4KkLRs .
@alistairewj I did it already, please see the beginning of the body. Here also the reproduction of the thing
root@masiAsus:/home/masi/Documents/DI/wfdb-app-toolbox/mcode# cat wfdbloadlib.m | grep WFDB_PATH
%WFDB_PATH: If empty, will use the default given config.WFDB_PATH
WFDB_PATH=['/home/masi/Documents/DI/'];
CACHE_SOURCE=[]; %If empty, defaults to last element of WFDB_PATH
if(isempty(WFDB_PATH))
WFDB_PATH=['. ' tmpCache ' http://physionet.org/physiobank/database/'];
config.WFDB_PATH=WFDB_PATH;
ind=strfind(config.WFDB_PATH,'http');
CACHE_SOURCE=config.WFDB_PATH(ind:end);
setenv('WFDB',config.WFDB_PATH);
MATLAB premium service correction in the permission of pathdef.m to 666/644 solves one problem. All configs changed more logical now but there is some problem with WFDB finding the data in /home/masi/Documents/DI/NSRDB/
.
Why WFDB does not use the local data at /home/masi/Documents/DI/NSRDB/
?
It's really confusing that you delete your posts and edit your first post. It's hard to see what you have tried and what you haven't tried. In the future, with issues, I would recommend just posting new comments when you try something new. Note that for setup 2, you need to load in just the record name (16265), not the database name and the record name.
As an alternative workaround, you can install the WFDB toolbox (https://physionet.org/physiotools/wfdb-darwin-quick-start.shtml) and use the shell commands to export the data as text or in .mat format: https://physionet.org/tutorials/physiobank-text.shtml
It seems that this is a very specific issue to your setup and not a general issue with the toolbox since no one else can reproduce it - @cx1111 this issue should probably be closed. @sami10007 - maybe you can find someone at your local institution who can provide you with technical advice in person - unfortunately first-line support is not something we can provide to the users of the toolbox.
Not an issue with the toolbox. Personal environment troubleshooting.
Solved!
#!/bin/bash
ids=("16272" "16273" "16420" "16483" "16539" "16773" "16786" "16795" "17052" "17453" "18177" "18184" "19088" "19090" "19093" "19140" "19830")
for id in ${ids[@]}
do
rdsamp -r nsrdb/"$id" > /tmp/"$id".txt
done
I am trying to use the local data of Physionet MIT-BIH NSRDB at
/home/masi/Documents/DI/NSRDB/
with WFDB 0-9-10 installed in/home/masi/Documents/DI/wfdb-app-toolbox/
which tree is here. I downloaded NSRDB datafiles into/home/masi/Documents/DI/NSRDB/
directory which I would like to use with WFDB so saving in the internet connection.Permission corrections and verified by MATLAB premium service
chmod 666 /usr/local/MATLAB/R2016b/toolbox/local/pathdef.m
before installing the toolboxchmod 644 /usr/local/MATLAB/R2016b/toolbox/local/pathdef.m
after installing the toolboxI edited the file and change the WFDB_PATH variable to the location of your data (line 50) in
/home/masi/Documents/DI/mcode/wfdbloadlib.m
. By default in the file it is initialized to an empty array. Relevant part of the codeDirectory content in
/home/masi/Documents/DI/NSRDB/
I am trying to run wfdb
rdsamp
on those files, just to get the ECG signal for 25 minutes. I tried to access the data similarly as with MIT-BIH Arrhythmia database but unsuccessfully. CodeErrors
In some temporal successful attempts earlier, the output of
tic; sig=rdsamp('16272'); toc;
has been more than 170 seconds when the data locates locally in my machine. This indicates that something has been wrong in my settings so I started everything again now, see Setup 1 and Workaroud, where neither one works.Setup 1
In Terminal
In MATLAB
I want to run a script now. It asks me to change the location. I change it. I run the script and get the error
Configs after running the script
Configs before running the script is the same as after running the script now after pathdef.m permission change
Workaround
Run the following line before each script in MATLAB
Output unsuccessful
Configs after running the script
Workaround 2
By Alistair recommendation, I duplicate all scripts to
/home/masi/Documents/DI/NSRDB/
and simplify the main scriptComplete Script
Output
File tree in
/home/masi/Documents/NSRDB/
Configs
OS: Debian 8.5 64 bit
Linux kernel: 4.6 backports
WFDB: 0-9-10
MATLAB: 2016b
Related: http://biology.stackexchange.com/q/52955/86 Hardware: Asus Zenbook UX303UA i7 CPU, 12 GB RAM, 35 GB Swap, integrated Intel graphics
Window manager: Gnome 3.14
Related thread in MATLAB Ask: https://se.mathworks.com/matlabcentral/answers/310851-set-path-won-t-save-on-debian-8-5
MATLAB Service Request about the
pathdef.m
issue: #02259304