mne-tools / mne-python

MNE: Magnetoencephalography (MEG) and Electroencephalography (EEG) in Python
https://mne.tools
BSD 3-Clause "New" or "Revised" License
2.7k stars 1.31k forks source link

BUG: ICA info['chs'] elements are different when loading from saved ICA file #1659

Closed fraimondo closed 8 years ago

fraimondo commented 9 years ago

ica_1 is the computed ICA solution.ica_2 is the same solution reloaded from a file. Check the eeg_loc and coord_frame values.

In [6]: ica_1.info['chs'][0]
Out[6]: 
{'cal': 1.0,
 'ch_name': 'E6',
 'coil_trans': None,
 'coil_type': 0,
 'coord_frame': 0,
 'eeg_loc': array([[ 6.96223,  0.     ],
        [ 5.38242,  0.     ],
        [-2.19061,  0.     ]]),
 'kind': 2,
 'loc': array([ 6.96223,  5.38242, -2.19061,  0.     ,  0.     ,  0.     ,
         0.     ,  0.     ,  0.     ,  0.     ,  0.     ,  0.     ]),
 'logno': 1,
 'range': 1.0,
 'scanno': 1,
 'unit': 107,
 'unit_mul': 0}
In [7]: ica_2.info['chs'][0]
Out[7]: 
{'cal': 1.0,
 'ch_name': 'E6',
 'coil_trans': None,
 'coil_type': 0,
 'coord_frame': 4,
 'eeg_loc': array([[ 6.96223021],
        [ 5.38242006],
        [-2.19060993]]),
 'kind': 2,
 'loc': array([ 6.96223021,  5.38242006, -2.19060993,  0.        ,  0.        ,
         0.        ,  0.        ,  0.        ,  0.        ,  0.        ,
         0.        ,  0.        ], dtype=float32),
 'logno': 1,
 'range': 1.0,
 'scanno': 1,
 'unit': 107,
 'unit_mul': 0}
dengemann commented 9 years ago

... and some more stuff preventing the hashing from working

agramfort commented 9 years ago

PR very welcome :)

dengemann commented 9 years ago

@agramfort yes. Someone, somewhen. We put it here to remind us of it. Patching it dynamically for the use case we have ....

larsoner commented 8 years ago

Is this still occurring? eeg_loc doesn't exist anymore so that should be fixed, but the coord_frame thing is unsettling. If you can reproduce with a minimal example from sample or testing datasets I'm happy to fix it.

larsoner commented 8 years ago

I just tried adding a check for this in our mne/preprocessing/tests/test_ica.py (even though it should probably be part of mne/io/tests/test_meas_info.py or so) and it passed, so I suspect this has been fixed. I'm going to close, but please check and reopen if it's not fixed @fraimondo @dengemann