Problems loading g.tec .hdf5 file

Thank you for the files.
In these new examples, the event ID of Trigger1 is “0”, and this was not expected in the code I wrote previously.
I fixed it. Update Brainstorm again an you should now see your Trigger1 events.
Francois

I am having a similar problem to Hisato.
Can you tell me or point me in direction how to make channel names, and if possible how to do this for all the hdf5 because all the data is stored that way and I will probably have to do the same thing for each file. I tried to have the file converted to .mat format, but that still does not load to brainstorm with a different error. The HDF5 error is copied below:
I think the brackets are blank to de-identify subject, but is causing error, did you just fill w a character so has any item to load/import.

Thanks!

Error in in_fopen_gtec

Line 59: in_fopen_gtec
Invalid g.tec HDF5 file: Missing dataset "RawData/AcquisitionTaskDescription".


Call stack:

in_fopen_gtec.m at 59
in_fopen.m at 115
in_data.m at 106
import_data.m at 200
bst_call.m at 28
tree_callbacks.m>@(h,ev)bst_call(@import_data,,,,iStudy,iSubject) at 700

Thanks!

I tried simply putting in ['a'] to not leave empty channel names or channel types and still getting another error, I thought may be related to where the file was stored separate from brainstorm, but not helping. Any input, thanks.:


** Error: Line 229: in_fopen
** Cannot open data file:
** C: ... brainstorm3\11CCf2.mat
**
** Call stack:
** >in_fopen.m at 229
** >in_data.m at 518
** >import_data.m at 200
** >bst_call.m at 28
** >tree_callbacks.m>@(h,ev)bst_call(@import_data,[],[],[],iStudy,iSubject) at 700
**


Hi,

These three [] are used to indicate that the user will use a [File Chooser] to indicate the file. They are not related to the error you're seeing. Do not modify these, as it will seriously damage the way Braisntorm operates.

Was your file created with the g.Recorder software?
Could you send an example data file so we can have a look at it?
Upload the file somewhere and post the download link here. Thanks

Regarding your data location, put them anywhere you want but not in any of the Brainstorm folders.
This will cause many troubles, as indicated in the Tutorial 1 Create a new protocol of the Get started tutorials

https://duke.box.com/s/q6ucobtkfs224501sbt3jg8y30elxwcy the file is close to 1GB. This is .mat file exported or converted from hdf5 file. this was recorded on g.HIamp 256-channel amplifier device; so I think it is g.recorder, but not sure. I did not aquire the data.
Let me know if box link does not work. Thanks for the help. I only manipulated a copy of the original file, so it is not ruined, this file should be unaltered from recording besides that it is matlab format.

I will try to share next the HDFD5 file and decryption file for hdf5, ghdf5import.m, but the hdf5 is even larger than exported .mat file.

I am a clinical neurophys fellow, but know nearly nothing for Matlab I'm mostly interested to use Matlab to open brainstorm to analyze SEEG data in a GUI compatible with these odd formats.
I put a screenshot of the file channel name area that seemed to be a problem for the other user in the past, but I see your comments not to touch it.

https://duke.box.com/s/w5icafjfvemvb2kijp3im1cwstkevh9c this is an hdf5 file of same or similar data from before.
https://duke.box.com/s/448r08pp901lxumgkexib7rv90k7cm6s is the hdf5 read.m file
again all was recorded on g.HIamp 256-channel amplifier device
Any help, much obliged.

There seems to be a problem with the access to the files. I get the error:

  This shared file or folder link has been removed or is unavailable to you
  Screenshot:

image

https://drive.google.com/drive/folders/1oDzzFiLtD9CbsG46hspgBoackDE1r72X?usp=sharing I tried a different way to share I put all files in this folder. Thanks.

@corymy,

I was able to open the shared HDF5 file in Brainstorm without any problem.
How are you trying to open the file?

Regarding the .mat file. It contains the same data that the HDF5 file.
However, at this moment Brainstorm does not read .mat files created with the script ghdf5read.m

I am opening by subject then physiologic data tab, either left click on subject name header or implantation, right clicking> import MEG/EEG, then File name to hdf5 file; I still get error.


Would you be able to zoom some time to see how I'm doing?

Thanks!

I tested this on my computer as well, and confirms that the g.tec reader can import your file correctly.
If you have errors on your end, this is most likely due to issues on your computer.

  • First make sure you don't have any program that interferes with Brainstorm on your computer:
    • Close Brainstorm
    • Edit the Matlab path, remove all the folder that are not strictly related with the installation of MATLAB
    • Close and restart Matlab, try again
  • What version of Matlab are you using?
  • If the Matlab version is the issue (older than 2020a), you can try with the compiled version of Brainstorm:
    https://neuroimage.usc.edu/brainstorm/Installation
  • Try executing the following commands in the Matlab command window, after selecting the folder containing the HDF5 file - copy-paste the output here:
    AcqXml = hdf5read('R03_11CC2021.11.09_09.48.05.hdf5', 'RawData/AcquisitionTaskDescription')
    sAcqXml = in_xml(AcqXml.Data)
    

I updated my brainstorm application and it is no longer opening the files that were opening before the update. I'm getting a new error:

BST> Warning: Downsampling signals for display (keeping 1 value every 43)
Unrecognized function or variable 'ICON_Y_UP'.

Error in figure_timeseries>CreateScaleButtons (line 4008)
iconFlipY = IconLoader.ICON_Y_UP;

Error in figure_timeseries>PlotFigure (line 3193)
CreateScaleButtons(iDS, iFig);

Error in figure_timeseries (line 41)
eval(macro_method);

Error in view_timeseries (line 273)
isOk = figure_timeseries('PlotFigure', iDS, iFig);

Error in tree_callbacks>@(h,ev)view_timeseries(filenameRelative,AllMod{iMod},,'NewFigure') (line 1375)
gui_component('MenuItem', jMenuModality, , 'Display time series', IconLoader.ICON_TS_DISPLAY, , @(h,ev)view_timeseries(filenameRelative, AllMod{iMod}, , 'NewFigure'));

Do you have any advice to overcome the error? Thanks.

Just restart Matlab.
If it doesn't work, something went wrong in the update: delete the brainstorm3 folder from your computer and download a new one from the website.

I realized that there was a problem in the update mechanism when there are changes to brainstorm.jar. Frequently, the brainstorm.jar cannot not be replaced automatically with the newer version.

I fixed this in this commit (forcing downloading a new .jar at startup after an update):

@corymy If you haven't done anything yet: simply update Brainstorm again.

Hi François,

I just ran into this issue as well (ICON_Y_UP error), which persists after both a Git update, and a Brainstorm update (where it did download something and restarted Matlab). I was trying to run through the tutorial_introduction script and this happens at line 117: view_timeseries.

Looking on my hard drive, I noticed a new brainstorm3 folder was created next to where my Brainstorm was installed, a folder called "Brainstorm". Does the update force this folder name?

Thanks,
Marc

Does the update force this folder name?

Yes, Brainstorm gets only updated into brainstorm3...
I was not far from starting working on this this afternoon. I'll change this soon.

@Marc.Lalancette
It is now possible to update from another folder than brainstorm3:
https://github.com/brainstorm-tools/brainstorm3/commit/f7a682c2724401545fb8940e740db8f7a9940d32

2 Likes

Hi everyone!

I am using g.tec .hdf5 files as well and I have issues with the trigger codes. The number of triggers is correct but all of them have been assigned the same name, e.g., "HA-2020.05.01 (combined)". The correct trigger codes should be: HA-2020.05.01 (combined) followed by numbers like 21-22-31-32 etc.

I attach a .hdf5 file of an ECG recording in which there are 12 triggers with the same name: https://drive.google.com/drive/folders/1GzaJ7Jayh86hlRg07MZY6zVeEIg0u0gt?usp=sharing

Could you please help me with this issue?
Thank you!

Best regards,
Giorgia

The HDF5 file you shared contains only one type of event, which is labelled 'HA-2020.05.01 (combined)':
/AsynchronData/TypeID = [44 44 44 44 44 44 44 44 44 44 44 44]

If you know the extra information you expect is available in this HDF5 file, then we need your help to find it.
Open file in_fopen_gtec.m in the Matlab editor, put a breakpoint at line 83, run the import.
When the debugger stops, you can explore the variables and try to get other fields from the HDF5 files (other than /AsynchronData/TypeID) and adjust the code of the reader to get info you need.

If you find a solution, please post it here.

Hi Francois

Thank you for your reply!
I explored the file by means of the ghdf5read function and I noticed that the trigger codes are not in the field typeID (datastruct.AsynchronData.TypeID) but in the field Value (datastruct.AsynchronData.Value), and they are correct.

Here the code I used:

DataFile='C:\Users\user\Downloads\RecordSession_HCT_P2F2023.02.13_23.16.49.hdf5'
datastruct = ghdf5read(DataFile);
trigger_time= datastruct.AsynchronData.Time;
trigger_ID=datastruct.AsynchronData.TypeID;
trigger_value=datastruct.AsynchronData.Value

trigger_value =

1×12 int32 row vector

11    12    31    32    61    62   101   102    41    42    21    22