Clear all

Error converting .nirs to .snirf

8 Posts
7 Users
Posts: 4
Topic starter
Active Member
Joined: 2 years ago

I am trying to convert some .nirs files I have to the .snirf format. I had previously done this without any issues automatically through the Homer3 GUI - it would ask if I'd like to convert the .nirs files into the .snirf format and Homer3 handled it without issue. However, now when I attempt to do this I get an error ("ERROR: The class of input data must be integer instead of int32 when the HDF5 class is H5T_STD_U64LE."). I've attached a screenshot of the top of the error as well. I am working on a Mac running MATLAB 2017b and upgraded to the latest Homer 3 version today (1.80.2). 

Upon trying to manually convert and save the .nirs file to a Snirf object it appears this error comes up when trying to save the Snirf object; I have no issue loading the .nirs using SnirfObj=SnirfClass(load('TEST.nirs','-mat')), but running SnirfObj.Save() elicits the same error.

My apologies in advance if I am missing something very obvious, but I've never encountered this issue before and haven't found any similar errors documented anywhere!

7 Replies
Meryem Yücel
Posts: 191
Joined: 3 years ago

Hi Emma,


ARe you still having the same issue? I have tested nirs->snirf conversion on v1.80.2 master  and .4 development, and did not have any issue during conversion.



Posts: 7
Active Member
Joined: 1 year ago

Hi Meryem, 

I am having the same issue! I hadn't used my Homer3 for a while (maybe eight months?) and then updated today. I am using a MAC. 

Please let me know if you have an ideas.

Error code is attached below:

Converting /Users/katherineboere/Documents/MATLAB/nBack/nBack_01/NIRS-2023-01-24_006.nirs to /Users/katherineboere/Documents/MATLAB/nBack/nBack_01/NIRS-2023-01-24_006.snirf
ERROR: The class of input data must be integer instead of int32 when the HDF5 class is H5T_STD_U64LE.
Current Folder : /Users/katherineboere/Documents/MATLAB/nBack/nBack_01/
Call stack:
Error in write.m > write (line 100)
Error in hdf5write_safe.m > write_integer (line 101)
Error in hdf5write_safe.m > hdf5write_safe (line 52)
Error in MeasListClass.m > MeasListClass.SaveHdf5 (line 171)
Error in DataClass.m > DataClass.SaveHdf5 (line 248)
Error in SnirfClass.m > SnirfClass.SaveData (line 672)
Error in SnirfClass.m > SnirfClass.SaveHdf5 (line 742)
Error in FileLoadSaveClass.m > FileLoadSaveClass.Save (line 78)
Error in Nirs2Snirf.m > Nirs2Snirf (line 65)
Error in FindFiles.m > FindFiles (line 84)
Error in DataTreeClass.m > DataTreeClass.FindAndLoadGroups (line 268)
Error in DataTreeClass.m > DataTreeClass.DataTreeClass (line 98)
Error in LoadDataTree.m > LoadDataTree (line 50)
Error in MainGUI.m > MainGUI_OpeningFcn (line 256)
Error in gui_mainfcn.m > gui_mainfcn (line 220)
Error in MainGUI.m > MainGUI (line 19)
Error in Homer3.m > Homer3 (line 58)

Error using hdf5lib2
The class of input data must be integer instead of int32 when the HDF5 class is

Error in H5D.write (line 100)
H5ML.hdf5lib2('H5Dwrite', varargin{:});

Error in hdf5write_safe>write_integer (line 101)
H5D.write(dsid, tid, 'H5S_ALL', 'H5S_ALL', 'H5P_DEFAULT', int32(val));

Error in hdf5write_safe (line 52)
write_integer(fid, name, val);

Error in MeasListClass/SaveHdf5 (line 171)
hdf5write_safe(fid, [location, '/sourceIndex'], uint64(obj.sourceIndex));

Error in DataClass/SaveHdf5 (line 248)
obj.measurementList(ii).SaveHdf5(fid, [location, '/measurementList', num2str(ii)]);

Error in SnirfClass/SaveData (line 672), [obj.location, '/data', num2str(ii)]);

Error in SnirfClass/SaveHdf5 (line 742)

Error in FileLoadSaveClass/Save (line 78)
obj.SaveHdf5(filename, params);

Error in Nirs2Snirf (line 65)

Error in FindFiles (line 84)
Nirs2Snirf(dirnameGroup, filesSrc.files(~found));

Error in DataTreeClass/FindAndLoadGroups (line 268)
dataInit = FindFiles(obj.dirnameGroups{kk}, fmt, options);

Error in DataTreeClass (line 98)
obj.FindAndLoadGroups(groupDirs, fmt, procStreamCfgFile, options);

Error in LoadDataTree (line 50)
dataTree = DataTreeClass(groupDirs, fmt, procStreamCfgFile);

Error in MainGUI>MainGUI_OpeningFcn (line 256)
maingui.dataTree = LoadDataTree(maingui.groupDirs, maingui.format, procStreamFile);

Error in gui_mainfcn (line 220)
feval(gui_State.gui_OpeningFcn, gui_hFigure, [], guidata(gui_hFigure), varargin{:});

Error in MainGUI (line 19)
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});

Error in Homer3 (line 58)
unitTest = MainGUI(groupDirs, inputFileFormat, unitTest, 'userargs');

>> H5D.write
Error using hdf5lib2
Wrong number of input arguments.

Error in H5D.write (line 100)
H5ML.hdf5lib2('H5Dwrite', varargin{:});

Posts: 7
Active Member
Joined: 2 years ago

Hello all,

I am having the same problem as well. I had no problem loading and converting the file before (months ago) but since the update, I could not load the .nirs files. Please let me know if this can be solved. 


Thank you!

Posts: 1
New Member
Joined: 2 years ago

Hi everyone,

I just wanted to note that I am having the exact same issue as the other members. I had to revert back to version Homer3 v1.71.1 for this issue to be solved. 



Page 1 / 2