Git Product home page Git Product logo

adinstruments_sdk_matlab's People

Contributors

cutiger avatar greggoldman avatar jimhokanson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

adinstruments_sdk_matlab's Issues

Create a comment migrator

Sometimes we break our files up into small chunks and add comments. I'd like to be able to move those comments back to the original file. This should be possible as every sample is time referenced absolutely (or can be resolved absolutely).

warning message when removing adi from path

Hi

I always get this error message:

Warning: The following error was caught while executing 'adi.file_handle' class destructor:
Method 'delete' is not defined for class 'adi.file_handle' or is removed from MATLAB's search path. 

when I do this:

function [data] = load_file(datafile)
addpath('adi');
data = adi.readFile(datafile);
...
rmpath('adi');

Is there a way to clean up before removing the path in order to avoid the error message?

best
Tobias

Implement conditional comment handle delete

If the mex file is cleared, trying to delete an old comment handle will crash Matlab. This is lower priority than the file handle since there is really no use in persisting the comment handle, but it should be fixed eventually.

Improve fix for mex clearing to handle quick loads and unloads

The current fix to handling clearing mex and having invalid file handles is to check the time. This is currently using a second timer which means that it if you do:
open file
clear all (clears mex, calls delete on invalid pointer)

within the same second, you'll crash Matlab.

Implement return of multiple time ranges of data from adi.channel

Currently, data can be retrieved in a time range, but you can only specify a single start and stop time. It would be useful to be able to return a single sci.time_series.data class which contains data from multiple ranges.

adinstruments_dsk_matlab+adi@channel\channel.m

if isempty(in.time_range)
%We populate this for comment retrieval
in.time_range = (in.data_range-1)/obj.fs(record_id);
else
in.data_range(1) = floor(in.time_range(1)*obj.fs(record_id))+1;
in.data_range(2) = ceil(in.time_range(2)*obj.fs(record_id))+1;
end

linux

is it possible to have this on linux?

adi.convert() option to use raw data

adi.convert() was very helpful to successfully converted hundreds of .adicht files into .mat and thus make them readable in R. However the way the signals look, they seem to have been written with LabChart's filter settings. As far as I know, the signals are stored in raw form, and filtering is always post-processing. Is there an option/argument in the adi.convert() function that would allow us to export the raw data? Thanks.

How to set matlab version when running adi.convert in matlab?

Hi Jim,

first of all thanks a ton for sharing this code, which already works fantastic!

However, using R.matlab package in R I ran into an issue. The package wants v6 .mat files but your code is generating v7 .mat files. According to the R error message below one should use save -V6 (or probably use an older Matlab version). I looked into your code but since I am not very proficient in Matlab, I don't know where to set the parameter. Maybe you could help?

Cheers

> R.matlab::readMat('foo.mat')
Error in readMat5(con, firstFourBytes = firstFourBytes, maxLength = maxLength) : 
  Reading of MAT v7.3 files is not supported. If possible, save the data in MATLAB using 'save -V6'.

Problem to add path in Matlab on Linux

Hello,

This is a cool toolbox. I am trying to use it in Matlab on Linux, but it seems I cannot add '.../adinstruments_sdk_matlab/+adi/' into pathes. Should I remove '+'?

Many thanks!

Matlab Crashes while Writing

Hello,
i want to write long eeg recordings to a .adidat file. However, it crashes during the stopRecording command. You can find the code I'm using below (it generates example data, but the same happens with the acutal data):

      file_path = 'path_to_\test.adidat';
      fw = adi.createFile(file_path);
      fs1 = 250;
      chan = 1;
      pres_chan = fw.addChannel(chan,'pressure',fs1,'cmH20');
      fs2 = 250;
      chan = 2;
      pres2_chan = fw.addChannel(chan,'emg',fs2,'mV');
      fw.startRecord();
      y1(1:65000000) = 1.23456789;
      pres_chan.addSamples(y1);
      y2(1:65000000) = 1.23456789;
      pres2_chan.addSamples(y2);
     fw.stopRecord(); %<-- here it crashes

If I am writing the same (or twice) the number of datapoints into one channel, everything works fine. I attached the Matlab crash report. Do you have any idea what might cause the crash?

crashlog.txt

Thanks a lot for your amazing work!
Best, Patrick

Shift to 1 based numbering

Working with 0 based numbering in Matlab is very confusing. Shift everything to use 1 based numbering on the Matlab side, and then fix this in the SDK so that the dll calls get the 0 based numbering.

Create File - old version issue

Hi, I want to create "adicht" file in Matlab and import it for our medical students to Labstation. However, Labstation supports file versions LabChart 8 or newer. Is there a chance to upgrade the code to save in such file format?
Thank you Jakub

Nothing returned

UsingMATLAB R2020b on 64bit Windows 10 Enterprise.
Set up the sdk with ''addpath("...XXX....\adinstruments_sdk_matlab");', then tried to run 'f = adi.readFile("testData.adicht")' and there was no error, but there was also no 'f' object created. What could be going wrong?

Warnings because of sequence of chars %#

On Matlab 2020b, loading the class generates some warnings:

Warning: File: file.m Line: 25 Column: 20
Unrecognized pragma "%# of channels in the file (across all records). This may". 
Warning: File: file.m Line: 150 Column: 13
Unrecognized pragma "%# of comments". 
Warning: File: record.m Line: 13 Column: 19
Unrecognized pragma "%# of samples of highest sampling rate channel". 

You could just add a space between to two characters ("% #" to avoid the Matlab parser trying to interpret it.

Problem with mex file on linux

Hi Jim,
If I try to run the sdk on linux I run into this error:
Sensorprams=adi.readFile(sensordata_path)
Unrecognized function or variable 'sdk_mex'.

Error in adi/sdk/openFile (line 156)
[result_code,pointer_value] = sdk_mex(0,h__toWChar(file_path));

Error in adi/readFile (line 68)
file_h = sdk.openFile(file_path);

I think there is an issue with mex on linux.
Any Idea how to fix this?

Best regards,
Thomas

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.