Example on SPM Faces dataset - 2 questions

Dear MNE users,

I have two different questions about the example plot_spm_faces_dataset.py.

1) If I run the code and I try to plot the ICA components on time

    >>> show_picks = numpy.abs(eog_scores).argsort()[::-1][:5]
    >>> fig1=ica.plot_sources(raw, show_picks, exclude=eog_inds)

    I obtain the figure u find in attachment.
    My question is: why do I see the ref channels?

    In the old mne-python version I had a different layout, as that
    shown in plot_ica_from_raw.py.

    What's wrong?

2) I tried to co-register using mne.gui.coregistration()

    I load the spm sbj and the raw file SPM_CTF_MEG_example_faces1_3D_raw.fif.
    Does this file contain only the fiducial points?

    If yes, when I load the raw file I can't see the fiducials in the gui.

    Where I'm making a mistake?

THKS A LOT for help me.

Best regards,
Annalisa

hi Annalisa,

I have two different questions about the example plot_spm_faces_dataset.py.

1) If I run the code and I try to plot the ICA components on time

   >>> show_picks = numpy.abs(eog_scores).argsort()[::-1][:5]
   >>> fig1=ica.plot_sources(raw, show_picks, exclude=eog_inds)

   I obtain the figure u find in attachment.
   My question is: why do I see the ref channels?

   In the old mne-python version I had a different layout, as that
   shown in plot_ica_from_raw.py.

   What's wrong?

we improved the layout. But indeed there is no point is showing the
meg reference channels.

We'll fix it this week.

2) I tried to co-register using mne.gui.coregistration()

   I load the spm sbj and the raw file
SPM_CTF_MEG_example_faces1_3D_raw.fif.
   Does this file contain only the fiducial points?

yes

   If yes, when I load the raw file I can't see the fiducials in the gui.

maybe Christian knows. Do you see them with mne_analyze?

   Where I'm making a mistake?

I don't think you do :slight_smile:

Best,
Alex

first problem solved.

https://github.com/mne-tools/mne-python/pull/2513

best,
A

Looking at the spm-faces raw info:

In [3]: raw.info['dig']
Out[3]:
[{'coord_frame': 4,
  'ident': 3,
  'kind': 2,
  'r': array([ 4.30736691e-09, 9.82968360e-02, 0.00000000e+00], dtype=float32)},
{'coord_frame': 4,
  'ident': 1,
  'kind': 2,
  'r': array([ -7.32455477e-02, -3.20142135e-09, 0.00000000e+00], dtype=float32)},
{'coord_frame': 4,
  'ident': 2,
  'kind': 2,
  'r': array([ 7.07898811e-02, 2.96859071e-09, 0.00000000e+00], dtype=float32)}]

but in the GUI we are selecting fiducial points with

d['kind'] == FIFF.FIFFV_POINT_CARDINAL
and

In [8]: FIFF.FIFFV_POINT_CARDINAL
Out[8]: 1
In [12]: FIFF.FIFFV_POINT_HPI
Out[12]: 2

so, is there something wrong with the spm-faces file (Fiducials stored as HPI)? Or are fiducials sometimes identical with HPI and the GUI should use them as such?

The latter would actually cause a conflict with our KIT files, because HPI points and fiducials which are not identical have the same ?ident?:

In [16]: [d for d in kraw.info['dig'] if d['kind'] < 3]
Out[16]:
[{'coord_frame': 4,
  'ident': 2,
  'kind': 1,
  'r': array([ 0.00000000e+00, 1.07987508e-01, -1.38777878e-17], dtype=float32)},
{'coord_frame': 4,
  'ident': 1,
  'kind': 1,
  'r': array([ -7.57353827e-02, 1.04083409e-17, 1.38777878e-17], dtype=float32)},
{'coord_frame': 4,
  'ident': 3,
  'kind': 1,
  'r': array([ 6.99156001e-02, 0.00000000e+00, 1.38777878e-17], dtype=float32)},
{'coord_frame': 4,
  'ident': 0,
  'kind': 2,
  'r': array([-0.07321275, 0.0070182 , -0.00094954], dtype=float32)},
{'coord_frame': 4,
  'ident': 1,
  'kind': 2,
  'r': array([ 0.06706881, 0.01023183, -0.00318275], dtype=float32)},
{'coord_frame': 4,
  'ident': 2,
  'kind': 2,
  'r': array([ 0.00344993, 0.11684198, 0.02777481], dtype=float32)},
{'coord_frame': 4,
  'ident': 3,
  'kind': 2,
  'r': array([-0.03729108, 0.1059907 , 0.03130391], dtype=float32)},
{'coord_frame': 4,
  'ident': 4,
  'kind': 2,
  'r': array([ 0.0470689 , 0.09996997, 0.03072358], dtype=float32)}]

Although a potential solution could use HPI only if no Cardinal points are present?

could be a bug in the CTF converter in the C code.

@mshamalainen any thought?

what does the MNE doc say about the kind of dig ?

could this be seen as a ?feature?, insofar as (I believe) CTF logic is to treat the three HPI coils as cardinal points?? /Chris

indeed.

Matti is the behavior of the C code to use the HPI coils as fidiucial
if a CTF system is detected?

Alex

Hi Alex,

thks!

kind regards,
Annalisa

I'm reading the discussion about the fiducials.

I'll answer in the other mail.

Alexandre Gramfort <alexandre.gramfort at telecom-paristech.fr> ha scritto:

Hi all,

thks for the discussion. So if I understood well,
in the case of CTF data, if there are only the
3 fiducials points, these are recognized by the code
as HPI points and the GUI don't show it.

I have to try with mne_analyze.

Thks!
best,
Annalisa

Alexandre Gramfort <alexandre.gramfort at telecom-paristech.fr> ha scritto: