Skip to content

WIP scale_source_space(): add support for vol source spaces - #1205

Closed
christianbrodbeck wants to merge 2 commits into
mne-tools:masterfrom
christianbrodbeck:scale-vol
Closed

christianbrodbeck wants to merge 2 commits into
mne-tools:masterfrom
christianbrodbeck:scale-vol

Conversation

@christianbrodbeck

Copy link
Copy Markdown
Member

Trying to adapt scale_source_space to handle volume source spaces. As far as I can tell the additional source space entries that need scaling are:

  • vox_mri_t
  • src_mri_t
  • interpolator

What exactly is the interpolator/how does it need to be scaled?

[Edit: sorry I confused the from/to tags. Is it intended that both transformation matrices have the same from tag even though they are different transformations?]

>>> pprint(vsrc['src_mri_t'])
{'from': 2001,
 'to': 5,
 'trans': array([[ 0.01,  0.  ,  0.  , -0.08],
       [ 0.  ,  0.01,  0.  , -0.12],
       [ 0.  ,  0.  ,  0.01, -0.08],
       [ 0.  ,  0.  ,  0.  ,  1.  ]])}
>>> pprint(vsrc['vox_mri_t'])
{'from': 2001,
 'to': 5,
 'trans': array([[-0.001     ,  0.        ,  0.        ,  0.12800001],
       [ 0.        ,  0.        ,  0.001     , -0.12800001],
       [ 0.        , -0.001     ,  0.        ,  0.12800001],
       [ 0.        ,  0.        ,  0.        ,  1.        ]])}

The setup_volume_source_space() documentation was not clear to me as to which MRI should be provided. I just used orig.mgz, is that right? (@mluessi?)

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.12%) when pulling 929997e on christianmbrodbeck:scale-vol into d75ce5b on mne-tools:master.

@dgwakeman

Copy link
Copy Markdown
Contributor

This may sound strange, but I would expect scale_source_space as applied to volume source spaces not actually scale, but to "shave" or "shim" the volume source space. Because a volume space has a fixed grid size, while stretching it would alter that. Why not scale the surface that the volume source space is generated from and simply recalculate the volume grid? This way you can maintain the same spacing.

@christianbrodbeck

Copy link
Copy Markdown
Member Author

@dgwakeman I think the advantage of scaling the grid is that you don't have to do any morphing for group level analysis. I admit that this perverts the meaning of the scaling parameter :) but on the other hand it maintains equal coverage of the different brains (i.e. a smaller brain does not get fewer voxels than a larger brain). As you suggested, you can always create a volume source space with exact voxel distance by applying setup_volume_source_space to a scaled subject, so there would be no need for scale_source_space for that method.

@dgwakeman

Copy link
Copy Markdown
Contributor

fair enough

@larsoner

larsoner commented Oct 2, 2014

Copy link
Copy Markdown
Member

@christianbrodbeck some of the documentation around volume source spaces has been updated in case you still need it. It is indeed the case that both of those transforms have the same from tag, even though they go to different spaces -- probably a holdover from the MNE-C code. I suspect you wouldn't have to modify the interpolator at all -- it maps from the source grid into the T1 grid, so it should still work just fine with a scaled source space.

Can you add a test for the volume source space case? There is a volume source space in the testing dataset.

@christianbrodbeck

Copy link
Copy Markdown
Member Author

I have some deadlines coming up... Will continue this afterwards

On Thu, Oct 2, 2014 at 5:22 PM, Eric Larson [email protected]
wrote:

@christianbrodbeck some of the documentation around volume source spaces has been updated in case you still need it. It is indeed the case that both of those transforms have the same from tag, even though they go to different spaces -- probably a holdover from the MNE-C code. I suspect you wouldn't have to modify the interpolator at all -- it maps from the source grid into the T1 grid, so it should still work just fine with a scaled source space.

Can you add a test for the volume source space case? There is a volume source space in the testing dataset.

Reply to this email directly or view it on GitHub:
#1205 (comment)

@larsoner

larsoner commented Oct 3, 2014

Copy link
Copy Markdown
Member

Not a problem, take your time -- just wanted to make sure you weren't waiting on feedback to continue.

@christianbrodbeck

Copy link
Copy Markdown
Member Author

well I was :) but now I will continue once I have some time, thanks!

On Oct 2, 2014, at 23:36, Eric Larson [email protected] wrote:

Not a problem, take your time -- just wanted to make sure you weren't waiting on feedback to continue.

—
Reply to this email directly or view it on GitHub.

@larsoner

Copy link
Copy Markdown
Member

@christianbrodbeck looks like this PR is one year old as of a couple of weeks ago (happy birthday little buddy!). Do you have any time to come back to this yet?

@larsoner larsoner closed this Sep 3, 2015
@larsoner

larsoner commented Sep 3, 2015

Copy link
Copy Markdown
Member

@christianbrodbeck feel free to reopen if you find time to work on this again

@christianbrodbeck

Copy link
Copy Markdown
Member Author

Yeah probably not anytime soon :/ , I urgently have to finish up my research projects...

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.

4 participants