openep / openep-core

Core OpenEP code - Matlab implementation
Apache License 2.0
9 stars 6 forks source link

Data not reading correctly from Brigham and Women's #39

Open drsewilliams opened 3 years ago

drsewilliams commented 3 years ago
Warning: IMPORTCARTO_MEM: Conflict between electrode names
identified by read_positions_on_annotation_v2.m and read_ecgfile_v4_header.m
using electrode names from read_ecgfile_v4_header.m
See
https://bitbucket.org/Cardiac_Software_Partners/cartodatareader/issues/3/incorrect-electrode-assignment-from
> In importcarto_mem (line 425)
Unable to perform assignment because the size of the left side is 1-by-2500 and the size of the right
side is 2500-by-0.

Error in importcarto_mem (line 514)
                        egm(iPoint,:) = voltages(:,kMap_bip);
rguntrip commented 3 years ago

Hi Dr. Williams

My name is Riley - I'm Markus Sikkel's research coordinator.

We had this same error message when importing our CARTO cases.

Not sure if this is an actual fix of the issue or just something that ended up working for us but we were able to successfully import after erasing line 431 - electrodeNames_bip{iPoint} = electrodeNamesCheck_bip;

Would that work for this scenario? Also not sure if erasing that line has any implications on import accuracy, etc.

Riley Guntrip Victoria Cardiac Arrhythmia Trials rguntrip@catrials.org

drsewilliams commented 3 years ago

Hi Riley, thank you for your message. So, interestingly I think that change would also have fixed this issue. The problem is that it removes the cross-checking of electrode names, however, and if the ordering of electrograms has changed (as it did here) then you will not know that you do not have the correct data.

The underlying issue is the parsing of electrode names using the read_ecgfile_v4.m and read_ecgfile_v4_header.m functions. We had handled a lot of different combinations but we continue to find new set ups / combinations in labs round the world!

I would be interested if you could check if the hotfix v1.0.04 I pushed last night also fixed your issue?

rguntrip commented 3 years ago

Thank you for the explanation! After looking through a bit of one of our imports - it seems like in the P#_ECG_Export files on line 3 the unipolar mapping channel fluctuates between a variety of options, some I've noticed being: M1 (bipolar M1-M2), 20A_1 (bipolar 20A1-2), + a bunch of different 20A# options. Line 4 always starts with M1. Is that were the issue originated for ours?

hotfix v1.0.04 works perfectly to import our cases & fixes the issue. Thank you!

drsewilliams commented 3 years ago

Hi Riley, yes, that would be the issue and the idea behind this part of the code is that it reconciles these different orders (where it can) and gives a warning (or an error if it can't).

That's great that v1.0.04 works for you. We have a bit more testing to do with the original (reported) source of this error and then we will move to merge the hotfix.