Skip to content

Conversation

@neurosignal
Copy link
Contributor

Due to the changes in digitization from point to string for extra points, it was noticed at MEGIN that MNE left out the new digitization points. So it was required to make changes to support the new digitization type.
Changes were made to fiff_read_meas_info.m and fiff_read_tag.m and tested with the appropriate dataset. Backward compatibility was also tested.

@neurosignal
Copy link
Contributor Author

image

%% reading info with mne
[fid, tree, dir] = fiff_open(fname);
[info, meas] = fiff_read_meas_info(fid, tree);
disp(info.dig)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this test would pass on main and on this branch. It would be better to have the test fail on main but pass on this PR. So instead of just a disp, could you use a suitable assert or similar that would fail on main but pass here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you are right!
In both fail and pass cases, it would just display the info.dig. One way to verify if we exclusively know the correct number of total digitization points, but that is file specific. For example, in a test case, I had 332 points in total. The main detected only 73 (no extra) points but this branch found 332.
Is this sufficient to just add assert(length(info.dig)==332, 'failed') as this is file specific?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that would work

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Done it!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh I see what you mean by "file specific". We'll want the unit test to pass for CIs and any devs running the test. Can you create as small a file as possible for this test and add it to this repo data/raw_data_tsss_mc.fif (or whatever you want to name it)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a 1-second-long test file test/data/string_digi_test_data_1s.fif and tested with main and the current branch. With main it gave 73 points, while 332 with the current branch.

@@ -0,0 +1,10 @@

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be formatted similarly to other test files, see this boilerplate in all our test_* functions (this file should also conform to this naming convention)

function test_suite=test_fiff_make_dir_tree
try test_functions=localfunctions(); catch
end
initTestSuite;
function test_fiff_make_dir_tree_()
% Test fiff_make_dir_tree.m

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have formatted it as you suggested; hopefully it works now.

@larsoner larsoner merged commit 0f463c5 into mne-tools:master Aug 5, 2025
1 check passed
@larsoner
Copy link
Member

larsoner commented Aug 5, 2025

Thanks @neurosignal !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants