Skip to content

Conversation

@wmvanvliet
Copy link
Contributor

When importing EDF/BDF files, an optional .htps file can be supplied to
provide electrode coordinates. This commit fixes the way these are
stored in the .info dictionary, so that functions such as
make_eeg_layout can use them.

When importing EDF/BDF files, an optional .htps file can be supplied to
provide electrode coordinates. This commit fixes the way these are
stored in the .info dictionary, so that functions such as
make_eeg_layout can use them.
Copy link
Member

Choose a reason for hiding this comment

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

why commented out? why point extra? if the latter is the correct one the commented line should be deleted

Copy link
Contributor Author

Choose a reason for hiding this comment

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

true, fixed in commit f9ae8fe

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fit_sphere_to_headshape expects the points to be of kind EXTRA:

# get head digization points, excluding some frontal points (nose etc.)
hsp = [p['r'] for p in info['dig'] if p['kind'] == FIFF.FIFFV_POINT_EXTRA
       and not (p['r'][2] < 0 and p['r'][1] > 0)]

Whether or not this makes any sense I don't know.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.0%) when pulling 3f2a996 on wmvanvliet:marijn-fix-edf-htps into 1145db4 on mne-tools:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.0%) when pulling f9ae8fe on wmvanvliet:marijn-fix-edf-htps into 1145db4 on mne-tools:master.

Copy link
Member

Choose a reason for hiding this comment

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

@t3on @kazemakase looks good to you? any thing we should be careful about?

Copy link
Member

Choose a reason for hiding this comment

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

I don't understand why this should relabeled. I labeled these according to the conventions listed in the mne-manual (pdf p.272): Digitization point which is a cardinal landmark aka. fiducial point.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

then we should change fit_sphere_to_headshape to look for points of type CARDINAL, at the moment it looks for points of type EXTRA. There is probably a reason for this: maybe some devices export the head digitization points as EXTRA?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, I don't know what point_dict is used for. Do these describe what the electrode positions are to MNE? In that case I don't think the positions are actually landmarks, are they?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fit_sphere_to_headshape should indeed look for 'landmark' points, which are of type CARDINAL. Only if these are not present it should look for points of type EXTRA (to retain backwards compatibility). I've reversed the changes in the EDF reader and fixed fit_sphere_to_headshape instead.

Currently, fit_sphere_to_headshape only takes digitazation points of
type 'extra' into account. It should first look for cardinal landmark
points and only if these are not found look for points of type 'extra'.
@larsoner
Copy link
Member

larsoner commented Sep 1, 2014

The fitting should probably always use cardinal and extra points. For example, our data has both the 3 cardinal landmarks, but also 100+ "extra" digitization points. These changes will make it so that our data are fit using only the 3 cardinal landmarks instead of the 100+ (!), which is quite bad from a fitting perspective.

There shouldn't be any problem with adding the cardinal points in with the extra points to do the head fitting, so I'm +1 for just adding the cardinal points to the set of points it considers when fitting.

@agramfort
Copy link
Member

can you rebase to make travis happy?

@agramfort
Copy link
Member

forget it. Works for me. Let's see if build bot is happy.

@agramfort
Copy link
Member

merged by rebase.

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.

7 participants