schnitzer-lab / EXTRACT-public

EXTRACT is a tractable and robust automated cell extraction tool for calcium imaging, which extracts the activities of cells as time series from both one-photon and two-photon calcium imaging movies.
MIT License
62 stars 16 forks source link

Loading HDF5 files #10

Closed milesOIST closed 2 years ago

milesOIST commented 3 years ago

Apologies, I have a very basic question. I am trying to load a HDF5 file. But I cannot really understand what this means: "filepath:dataset (for example: 'example.h5:/data')." The file is called "compensated_ch1.HDF5", the path is "C:\Users\NAME\Desktop\Current Data"

I have tried: M = 'compensated_ch1.HDF5:\Users\NAME\Desktop\Current Data'; M = 'compensated_ch1.HDF5:/data'; M = '\Users\NAME\Desktop\Current Data:compensated_ch1.HDF5'; M = 'C:\Users\NAME\Desktop\Current Data:compensated_ch1.HDF5';

But none of these worked. I am running from the folder with the file, soh5disp('compensated_ch1.HDF5') works.

I genreally get the error

Error using parse_movie_name (line 4) Movie string must be in the format "filepath:dataset"

or

Error using h5infoc Unable to open '\Users\NAME\Desktop\Current Data'. File or folder not found.

fatihdinc commented 3 years ago

Data are stored inside hdf5 files in distinct datasets. In this context, dataset refers to the name of the data you are trying to access inside "compensated_ch1.hdf5". The path of the hdf5 file is not really relevant, you just have to make sure that this file is on the Matlab path. Otherwise, 'filepath' part of the input is just 'compensated_ch1.hdf5'.

You can check the name of the dataset using h5info function, i.e. movie_info=h5info('compensated_ch1.hdf5'). Search through the structure to find under which name the movie is stored. I suggest using a uniform name convention throughout, I simply call them '/data'. Hope this helps!