abrazhe / image-funcut

View, analyse and transform dynamic imaging data
11 stars 3 forks source link

Time series Export to mat #24

Closed JonasCF closed 9 years ago

JonasCF commented 9 years ago

When exporting timeseries to mat, Changsi ask if some metadata could be included and if it could be created as a 3 dimentional array instead?

File should if possible contain 7 variables;

1) ROI name = ('roi1','roi2'....'roi10') 2) ROI all (3D array) = (number of frames) x (number of channels) x (number of ROIs) 3) ROI coordinates 4) Frame rate 5) GreenCh = (number of rows) x (number of columns) x (number of frames) 6) RedCh = (number of rows) x (number of columns) x (number of frames) 7) BlueCh = (number of rows) x (number of columns) x (number of frames)

abrazhe commented 9 years ago

I'll add metadata from the frame sequence as a field, but I'll keep saving to .mat, because It's straightforward for me to do. Otherwise, it would be too many special cases in saving data.

JonasCF commented 9 years ago

It is great that you will save it as .mat, since this is what Changsi needs. When she opens the timeseries.mat in matlab it holds 1 variable for each of the ROIs, she asked for: -a structure with all ROIs in a 3D array but if it is to much work, I think that the most important improvement would be: additional variables holding -Frame rate -Coordinate of the ROI after stabilisation

point 5, 6 and 7 above is not acutely necessary, if images had not been stabilised we could get this data from the mrs files, but now when it is changes a bit, it would be useful for showing the location of signals for visual inspection.

abrazhe commented 9 years ago

Commit c66b1a42e08cb8b3ca60aadd0ff39c37c7859797 closes this issue. Meta information is now saved to .mat files.

Update with

pip install -U --no-deps https://github.com/abrazhe/image-funcut/archive/develop.zip

Usage in matlab:

%load data 
x = load('test-rois.mat');

%access time interval between frames
dt = x.meta.axes(1)

%access first (e.g.) roi properties
label = x.roi_props{1}.label
place = x.roi_props{1}.center
radius = x.roi_props{1}.radius

%access data
x.ast01

This is the same format the data is saved into other formats, e.g. pickle. And this is the simplest for me to export to, because it requires minimal massaging of data. I am sure Changsi can convert this data to a format she likes in Matlab.