Skip to content

WIP: MRI/Head Coregistration / Scaling FsAverage - #379

Closed
christianbrodbeck wants to merge 151 commits into
mne-tools:masterfrom
christianbrodbeck:trans
Closed

christianbrodbeck wants to merge 151 commits into
mne-tools:masterfrom
christianbrodbeck:trans

Conversation

@christianbrodbeck

Copy link
Copy Markdown
Member

Following up on #369

Open Issues:

  • FIX
    • For scaling, allow the bem file to have a different name from fsaverage
  • TESTs
    • try to add TESTs for the GUI through traits
  • DOC
    • integrate the documentation page
  • ENH
    • set the qt backend as default for traitsui
  • ENH (possibly for the future)
    • create source space before scaling

@christianbrodbeck

Copy link
Copy Markdown
Member Author

@dengemann mentioned Head-MRI coregistration (#366 (comment)). I also made a traits GUI for that and I can add it to this PR since it's very similar to scaling fsaverage. The main issue I encountered was that the fit requires the fiducials as an initial constraint, and fiducials do not exist for MRI files. Since I did not find a good way with a traits UI to switch back and forth between two tasks (setting fiducials and fitting) I made a separate GUI for creating a fiducials file first. Maybe there is a better way to do this? I can add the two GUIs here as a basis for discussion.

@christianbrodbeck

Copy link
Copy Markdown
Member Author

@agramfort
I started expanding transform into a package to include the coregistration related code. Before I start also moving tests etc., do you agree with this structure?

@agramfort

Copy link
Copy Markdown
Member

fine with me.

for me to follow where you're heading can you describe a workflow / code to use what you wrote? A kind of draft of doc to make sure I agree with the philosophy?

@christianbrodbeck

Copy link
Copy Markdown
Member Author

@agramfort Could you have a look at what I added to transforms.py (https://github.com/mne-tools/mne-python/pull/379/files#diff-4), whether you would prefer this to be somewhere else.

For the coregistratrion, a first implementation is in place, although I still want to clean it up. The fsaverage folder has to contain all necessary MRI files as well as the fiducials file from the mne download. Then, there are these two options:

path = mne.datasets.sample.data_path()
raw_file = path + '/MEG/sample/sample_audvis_raw.fif'
subjects_dir = path + '/subjects'

# without GUI
from mne.transforms import coreg
c = coreg.MriHeadFitter(raw_file, s_from='fsaverage', s_to='fsa_sc', subjects_dir=subjects_dir)
c.plot() # creates a mayavi figure that dynamically updates
c.set_nasion(0,8,0) # correct the position of the nasion
c.fit()
c.save() # save the scaled brain and the trans file

# with GUI
import mne.transforms.coreg_gui as gui
gui.MriHeadCoreg(raw_file, s_from='fsaverage', s_to='fsa_sc', subjects_dir=subjects_dir)

This would be a draft of the doc:

#. Use :class:`~mne.transforms.coreg_gui.MriHeadCoreg `;
   `s_from` is the MRI to use (usually `'fsaverage'`), `s_to` is the subject
   for which the MRI will be used.
   The position of head and MRI are initially aligned using the nasion.
#. Use "Fit scale" to fit the MRI to the head using rotation and scaling.
   Modify the resulting parameters to achieve a satisfying fit:
   **Nasion**: Shift the position of the nasion alignment.
   **Scale**: The scale parameters applies with the nasion as center.
   **Shrink**: Shrink the MRI (affects scale on all axes) to compensate for
   e.g. an inflated digitizer head shape.
   **Rotation**: Rotation parameters applied with the nasion as center.
   **Fit ...**: at any time you can make a new fit, taking the current parameters
   as the starting point.
#. Once a satisfactory coregistration is achieved, hit "Save" to save the MRI
   as well as the trans file.

Comment thread mne/transforms/transforms.py Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I usually avoid any use of np.matrix. Could we make it an array?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We could. I'm curious as to your reason, is it because np.matrix's behavior is inconsistent with arrays?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's not. The operators are overlpoaded differently. For matrix * means dot
product, for arrays element wise operations. There's another hand full of
features which make it different.

On Tue, Jan 15, 2013 at 2:54 PM, Christian Brodbeck <
[email protected]> wrote:

In mne/transforms/transforms.py:

  •    pts = trans \* pts
    
  •    pts = np.array(pts[:3].T)
    
  • return pts

+def rotation(x=0, y=0, z=0):

  • "Create a rotation matrix"
  • r = np.matrix([[cos(y) * cos(z),
  •                - cos(x) \* sin(z) + sin(x) \* sin(y) \* cos(z),
    
  •                sin(x) \* sin(z) + cos(x) \* sin(y) \* cos(z), 0],
    
  •               [cos(y) \* sin(z),
    
  •                cos(x) \* cos(z) + sin(x) \* sin(y) \* sin(z),
    
  •                - sin(x) \* cos(z) + cos(x) \* sin(y) \* sin(z), 0],
    
  •               [-sin(y), sin(x) \* cos(y), cos(x) \* cos(y), 0],
    
  •               [0, 0, 0, 1]], dtype=float)
    
  • return r

We could. I'm curious as to your reason, is it because np.matrix's
behavior is inconsistent with arrays?

—
Reply to this email directly or view it on GitHubhttps://github.com//pull/379/files#r2649137.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

my reason is that with python you never know by reading the code if it's an array or a matrix. If everything are arrays then A * B is clear whatever the context. I never use np.matrix anymore.

@agramfort

Copy link
Copy Markdown
Member

@agramfort Could you have a look at what I added to transforms.py (https://github.com/mne-tools/mne-python/pull/379/files#diff-4), whether you would prefer this to be somewhere else.

fine there. Besides the use of np.matrix

For the coregistratrion, a first implementation is in place, although I still want to clean it up. The fsaverage folder has to contain all necessary MRI files as well as the fiducials file from the mne download. Then, there are these two options:

path = mne.datasets.sample.data_path()
raw_file = path + '/MEG/sample/sample_audvis_raw.fif'
subjects_dir = path + '/subjects'

without GUI

from mne.transforms import coreg
c = coreg.MriHeadFitter(raw_file, s_from='fsaverage', s_to='fsa_sc', subjects_dir=subjects_dir)
c.plot() # creates a mayavi figure that dynamically updates
c.set_nasion(0,8,0) # correct the position of the nasion
c.fit()
c.save() # save the scaled brain and the trans file

with GUI

import mne.transforms.coreg_gui as gui
gui.MriHeadCoreg(raw_file, s_from='fsaverage', s_to='fsa_sc', subjects_dir=subjects_dir)

looks pretty clean !

so this creates in subjects_dir a new subject called fsa_sc? with all
the necessary files for MNE?

@christianbrodbeck

Copy link
Copy Markdown
Member Author

so this creates in subjects_dir a new subject called fsa_sc? with all
the necessary files for MNE?

Yes, should, although I am not sure if I am considering all the possibilities yet.

@christianbrodbeck

Copy link
Copy Markdown
Member Author

Here's an update on the coregistration GUIs. Let me know if you think this should be prepared for potential inclusion. The fitting is done by functions that are already separate or that could be extracted if they would be useful independent of the GUI.

Fitting an MRI to a head:

>>> MriHeadCoreg('path/to/R0242_raw.fif', s_from='fsaverage')

Screen Shot 2013-02-08 at 00 27 44

Fitting a head to an existing MRI requires fiducials, which can be generated using this GUI:

>>> Fiducials('R0273')

Screen Shot 2013-02-08 at 00 33 45

Then the head-mri coregistration can be done:

>>> HeadMriCoreg('path/to/R0273_raw.fif')

Screen Shot 2013-02-08 at 00 35 23

Comment thread mne/transforms/coreg.py Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

avoid linalg from numpy. Use scipy.linalg

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Ok, is it a better implementation?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ok, is it a better implementation?

numpy can avoid the dependency on fortran with blas/lapack and on some
systems use it's own C implementation of linalg which is much slower
and less accurate.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks for the info!

@agramfort

Copy link
Copy Markdown
Member

my review is not done but I just tried with the sample data and got:

No such file or directory: '/Users/alex/work/data/subjects/fsaverage/bem/fsaverage-head.fif'

should we ship the fsaverage-head.fif with the sample data?

@christianbrodbeck

Copy link
Copy Markdown
Member Author

Yes the fsaverage in the sample data set has an empty bem directory. mne.transforms.coreg.find_mri_paths() looks for all the files that are needed.

@mluessi

mluessi commented Feb 8, 2013

Copy link
Copy Markdown
Contributor

I just tried, it it seems to work quite well. Nice job :-). Two things:

  • How does the fitting procedure compare to what MNE does? @mshamalainen told me that MNE is trying to keep the nasion at a constant location while rotating the rest of the points (not sure how it is done exactly). Also, he told me that the fitting procedure is matching the dig. points to the head surface between the vertices (which is not simple to do) but I guess if you use a high-res surface then this is less important.
  • I think it would be good to make the GUI's more scriptable, e.g., it would be good if instead of just the a raw file name, measurement info could be passed and it should be possible to change the trans file name being written (as a parameter to HeadMriCoreg). This will make it easier to create custom pipelines.

@mluessi

mluessi commented Feb 8, 2013

Copy link
Copy Markdown
Contributor

One more thing.. in HeadMriCoreg I think it would be nicer if the head surface had some transparency and the digitization points were displayed as points instead of a mesh. Like that it would be easier to see how close the points are to the surface (or so I think).

@christianbrodbeck

Copy link
Copy Markdown
Member Author

@agramfort

can you write a quick how to (step be step) starting from the clean sample data?

I'll do that

@mluessi

How does the fitting procedure compare to what MNE does

The nasion is kept constant (you can manually adjust it before running the fit). The fit uses scipy leastsq to minimize the distance from each digitizer head shape point to the closest mri point. Alternatively the head mri coregistration utility can use just the LAP/RAP fiducials.

matching the dig. points to the head surface between the vertices

The fiducials utility currently places the fiducials only to vertex locations (that's what Mayavi offers). In case that's not accurate enough I included the fields for manually adjusting the coordinates

I think it would be good to make the GUI's more scriptable

Definitely

in HeadMriCoreg I think it would be nicer if the head surface had some transparency and the digitization points were displayed as points instead of a mesh. Like that it would be easier to see how close the points are to the surface (or so I think).

The thing is with points you can't really estimate how far they are from the surface either – they are either in or out of the mri. I was thinking about having something like lines connecting each point with the center, that might allow you do estimate how far each point is sticking out; I didn't find an easy way to implement it yet though. Transparency unfortunately isn't handled well in mayavi (at least on my system). I was thinking to add some display options as traits though.

@mluessi

mluessi commented Feb 8, 2013

Copy link
Copy Markdown
Contributor

@christianmbrodbeck FYI the following point matching method is implemented in MNE (thanks @mshamalainen ):

"Besl, P., & McKay, N. (1992). A method for registration of 3-D shapes. IEEE Trans PAMI"

The method implemented here seems to be optimizing them same objective function, but I wonder if there are any guarantees that it converges to the same solution.

@christianbrodbeck

Copy link
Copy Markdown
Member Author

Re quick how to: Here is a draft for a manual page. Currently, mne_setup_forward_model is called right after scaling the mri, but only for the ico subdivision method.

Strangely automatic alignment of the sample dataset head always ends up crooked, but that's not a problem I had with my own subjects...

@mluessi thanks for the info, I don't know to what degree one could make the methods converge by customizing the leastsq call...

@agramfort

Copy link
Copy Markdown
Member

nice !

quick feedback on usability:

  • as a user it would like to know where the trans file is saved as
    well as the fiducial coordinates.
  • why two GUIs? ie set first fiducials and then do the coreg? the
    mne_analyze way would be to do both in one step and initialize the fit
    with the fiducials.
  • the section "Subjects without MRI" suggests that the copying could
    be done automatically. mne.create_default_subject?
  • I would name mne.gui.coregister_head_to_mri just mne.gui.coregister
    or mne.gui.coregistration
  • mne_analyze has a way to discard dig points that are way off. Would
    be neat to have this too.

Also I've seen some code relative to the forward modeling. I think
this should be independent from the coreg step.

@christianbrodbeck

Copy link
Copy Markdown
Member Author
  • as a user it would like to know where the trans file is saved as well as the fiducial coordinates.

I was planning to make arguments with templates as default, such as "{raw_dir}/{subject}-trans.fif"

  • why two GUIs? ie set first fiducials and then do the coreg? the mne_analyze way would be to do both in one step and initialize the fit with the fiducials.

That would be preferable but would require me to spend some more time with traits and co ... yes for the long term though

  • the section "Subjects without MRI" suggests that the copying could be done automatically. mne.create_default_subject?

You mean pulling the data from your mne and freesurfer application folders and running the setup? I can look into that.

  • I would name mne.gui.coregister_head_to_mri just mne.gui.coregister or mne.gui.coregistration

I'll go with coregistration unless there is opposition to that?

  • mne_analyze has a way to discard dig points that are way off. Would be neat to have this too.

Yes.

Also I've seen some code relative to the forward modeling. I think this should be independent from the coreg step.

It's only the preparatory setup_forward_model. You don't think that should be done automatically?

@agramfort

Copy link
Copy Markdown
Member

I was planning to make arguments with templates as default, such as
"{raw_dir}/{subject}-trans.fif"

+1

why two GUIs? ie set first fiducials and then do the coreg? the
mne_analyze way would be to do both in one step and initialize the fit with
the fiducials.

That would be preferable but would require me to spend some more time with
traits and co ... yes for the long term though

good we agree :)

You mean pulling the data from your mne and freesurfer application folders
and running the setup? I can look into that.

yes do the necessary copies automatically.

I would name mne.gui.coregister_head_to_mri just mne.gui.coregister or
mne.gui.coregistration

I'll go with coregistration unless there is opposition to that?

+1

It's only the preparatory setup_forward_model. You don't think that should
be done automatically?

I don't think we should as not everybody uses the same parameters.

I would follow the mne workflow and add an mne.setup_forward_model
like we did for the mne.do_forward_solution

@christianbrodbeck

Copy link
Copy Markdown
Member Author

mne.setup_forward_model

Yes you're right, there are too many parameters

@dengemann

Copy link
Copy Markdown
Member

Btw. as we are at it how is it going here? I was already about to ask for it ;-)

@christianbrodbeck

Copy link
Copy Markdown
Member Author

Hi @kambysese , thanks for testing this! The controls in your screenshot look like the latest version. Thanks also for your suggestions regarding the controls:

to add scrolling to the text boxes such that users can more smoothly change input for fiducial position, scaling, translation and rotation text boxes. Similar to the opacity function in the viewing panel.

A Range Editor as for opacity might be problematic because when its range is small it limits the range of possible values, and when its range is large its steps will be too big for fine adjustments. What I could do is have a separate line for each value and add a [+] and a [-] button that increment and decrement the value in say 1 mm steps? Do you think that would help?

I was unable to see all my subjects in subjects_dir; i.e., the subjects drop down menu doesn't allow scrolling.

I am not sure what to do about this, maybe complementary text entry field?

Although the average points error is acceptable, I am getting rather large fiducial fit errors. Any suggestions on how to reduce these?

It might simply be a question of the fiducials placement. If you think the fiducials are more accurate than head shape points you could use the fiducials for the fit.

@ktavabi

ktavabi commented Jul 13, 2013

Copy link
Copy Markdown
Contributor

Hi @christianmbrodbeck thanks for making this!
I still feel that some mechanism of control over find adjustment of fiducial positions would be beneficial to users. I am in favor of [+]/[-] or up/down arrow heads like the spin box in the range editor gui on the link you provided. Regarding the subjects drop box, the only work around now is to make a second Subject's directory, so a complementary text entry field is a good fix as any. This isn't the first quirky drop down menu I've seen working with Linux!

@christianbrodbeck

Copy link
Copy Markdown
Member Author

I added the +/- buttons. I can't find something like a grid sizer for traits, that's why the buttons are not vertically aligned... What do you think?

screen shot 2013-08-15 at 8 46 19 pm

About the drop-down menu, on Mac I can scroll through the list with the mouse wheel, as well as by hovering over the little arrows on either end. Nothing like that works for you?

enum editor

@ktavabi

ktavabi commented Aug 16, 2013

Copy link
Copy Markdown
Contributor

@christianmbrodbeck buttons look great! As long as they get the job done the alignment is an aesthetic issue. Maybe you can clear up a couple things for me. How do the scale parameters in the top panel (i.e., scale x1, & scale x3) translate into Rt, Ant, Superior?
In cases without MRI why are the Fit LAP/RAP & Fit Fiducials buttons disabled with 3-parameter scaling? In my experience, I proceed as per the manual by first manuall aligning the relative position of the polhemus nasion with the skin surface nasion fiducial. Second, I use Fit LAP/RAP in the middle panel to fit auricular fiducials. Finally, I use the Fit Head Shape button in the top panel to fit with 3 scaling parameters.

image

Once I am satisfied with the coreg/scaling I save the *trans.fif file. But I haven't been able to make anything happen in the subjects freesurfer directory. Obviously the sourcespace and leadfield cannot be created at this point for subjects without MRI, right? I am a bit more confused about whether or not something should happen in the subjects freesurfer directory, namely, the whereabouts of the scaled MRI? Or does the *trans.fif file contain the scaling/head-MRI transformation (which is applied to the BEM with mne_do_forward). Is this approach similar to what you do in cases without MRI? Sorry about all the confusion.

Regarding the drop down menu, I will confirm on UBUNTU 13, but it may be a non-issue. Initially, I didn't realize that only directories with a BEM subdirectory are included. Nevertheless, the menu initially shows with arrows on either end, then scales and the arrows disappear, it may be some Unity quirk.

BTW how do I update my local mne-copy to include the new features? Thanks in advance.

@christianbrodbeck

Copy link
Copy Markdown
Member Author

How do the scale parameters in the top panel (i.e., scale x1, & scale x3) translate into Rt, Ant, Superior?

When MRI scaling is set to "1 param", only the "Anterior" axis field is editable, but it's value is used for all axes (and the field for the other axes should also update whenever the "Anterior" value changes).

Once I am satisfied with the coreg/scaling I save the *trans.fif file. But I haven't been able to make anything happen in the subjects freesurfer directory

If "No scaling" is selected, all that is created is the trans file. The trans.fif file contains rotation and translation info but not scaling (because the transformation from the trans file is applied to the head shape, not the MRI, and we don't want to scale the original subject's head shape). Creating source spaces etc. should then be done using the command line utility.

If on the other hand you enabled scaling, then after pressing "save" the GUI should ask you for a name for the new MRI

screen shot 2013-08-16 at 10 10 14 pm

and start processing the MRI in the background, creating a new MRI subject folder. Existing MRI folders should never be modified (unless you save the trans file there). Info about current processing is displayed under the save button:

screen shot 2013-08-16 at 10 11 27 pm

If these things don't happen maybe there's a bug, let me know!

BTW how do I update my local mne-copy to include the new features?

navigate to your mne-python folder and run

$ git fetch christianmbrodbeck
$ git pull
$ python setup.py install --user

to update your local copy of my branch and then install that updated copy.

@christianbrodbeck

Copy link
Copy Markdown
Member Author

Currently the GUI scales the bem file and then a new source space should be created from the scaled bem file. I wonder if it might be more efficient to create the source space first and then scale it. In experiments where all subjects use the common brain, that should remove the need for morphing. For ico source spaces the result should be the same anyways, because they are based on subdivision, right? For others (volume? @mluessi ) removing the need for morphing might speed things up.

@ktavabi

ktavabi commented Aug 20, 2013

Copy link
Copy Markdown
Contributor

Hi @christianmbrodbeck. Currently I am using your Trans repo with MNE version 0.7 however I am not seeing the new additions i.e., +/- buttons. More troubling is that beyond generating the *trans.fif file, nothing else is happening. The subject folder is not created, hence there is no MRI/BEM file. I've tried this with or without the option(s) prepare bem and setup source space:

image

In either case the outcome is no new subject directory, and no files. In the above case the terminal standard out reads:

image

In the highlighted region, I am assuming the "u'" has to be in the mne_prepare_bem_model command?
In the case where I opt out of prepare bem and setup source space I simply receive an error in the GUI coreg panel saying "error in scaling...":

image

"FYI my permissions for $SUBJECTS_DIR is rwxrwxr-x.

@ktavabi

ktavabi commented Aug 20, 2013

Copy link
Copy Markdown
Contributor

@christianmbrodbeck to update I managed to update to the latest version of your branch. I'd left out the git pull command, doh! However I am still unable to generate the mri file; still receiving "error in scaling ..." message in the gui. Will try with other head shape data and let you know.

@ktavabi

ktavabi commented Aug 20, 2013

Copy link
Copy Markdown
Contributor

@christianmbrodbeck same result with other data sets. I am at a loss here.

@christianbrodbeck

Copy link
Copy Markdown
Member Author

@kambysese the output from the subprocess call (last line in your log) says you are missing .../kubi101-inner_skull.fif. This file is part of fsaverage. If you are not using fsaverage as base for scaling then you might not have that file in the original, and consequently it won't be in the scaled copy either. Do you have another *bem.fif file in your MRI directory? I should probably update the script so it uses any file matching *bem.fif.

(the "u" in front of strings only marks them as unicode and is not necessary unless they contain unicode characters)

@teonbrooks

Copy link
Copy Markdown
Member

I was wondering what the status of this pull request is. I fear that if there are any added features, it may turn into a project itself ;). Any additional features can also be implemented if this ever gets merged.
Our lab has pretty extensively tested it in both wx and qt. It seems stable and ok. I think it is ready for review (although the review may be a bit nightmarish with the amount of commits). What do we see as reasonable steps to move things forward?

@christianbrodbeck

Copy link
Copy Markdown
Member Author

@t3on It will be worked on soon. Meanwhile please do report any problems or requests (even for future PRs). I added a list of open issues to the first post.

@dengemann

Copy link
Copy Markdown
Member

@t3on good you ask and thanks for providing this valuable feedback, it's helpful for this PR's success to know it works for you and your colleagues. @christianmbrodbeck Thanks for ctaching up. There is certainly a generalized feature stop for this branch --- anything new, please after merge. I was believing we had persistent issues with regard to mayavi and tests coverage but this does not seem to be the case anymore.

Two milestones for merge:

  1. Improve Test-Coverage
    @christianmbrodbeck recently posted a test-coverage https://dl.dropboxusercontent.com/u/659990/mne-python/htmlcov/index.html that scores well for the KIT / FIF code but not so well for the GUI, which is natural. Using Enthought traits and turning of the display variables it should still be possible to improve basic coverage.

with this

  1. establish functionality across platforms
    I think if we can say it works with Anaconda and Canopy on Mac and Windows and with regular Ubuntu / Debian Linux binaries we're good. Maybe someone wants to setup stuff on VMs and just check this. Also see DOC: improve github start page, make clear recommendations #732 --- please keep that in mind.

All other improvements, if it's not COSMITS or DOC should be postponed. Generally I think what you could do is to stash commits in way they summarize essential additions, reducing back-and-forth diffs. That would make the reviewing easier.

@agramfort @mluessi @Eric89GXL

@agramfort

Copy link
Copy Markdown
Member

@christianmbrodbeck I see a lot of changes in files outside of the gui modules. Some of then seem to be fixing issues of current master (eg. in the kit module). This is not good and I would have much preferred to quick review / quick merge for this. I know it's annoying to change branches, rebase to keep branches in sync with upstream but it's the only way to go when we work all together on different features. Also you added some functions that wrap mne C commands which can be a debate. For example @Eric89GXL now reimplements setup of source spaces that we plan to improve in the near future to support deep sources. Remember that when we add features we start a maintenance / deprecation cycle that takes time for all of us.

@christianmbrodbeck how would you feel reopening PRs for your changes outside of the .gui code? That would allow quick review / quick merge. As @t3on this branch with 150 commits and 25 changed files turns into a project in itself ... ;)

@dengemann

Copy link
Copy Markdown
Member

@christianmbrodbeck how would you feel reopening PRs for your changes outside of the .gui code? That would allow quick review / quick merge. As @t3on this branch with 150 commits and 25 changed files turns into a project in itself ... ;)

+100

@christianbrodbeck

Copy link
Copy Markdown
Member Author

I see a lot of changes in files outside of the gui modules.

The reason I did not add those features in separate PRs is that they evolved with the GUI.

maintenance / deprecation cycle

I could just make any functions private that we don't want to maintain, like the C command wrappers.

how would you feel reopening PRs for your changes outside of the .gui code

As discussed above I can do it, but I feel it will take a lot of time and I am not sure it will make reviewing that much easier (since it is already possible here to view changes by file).

@agramfort

Copy link
Copy Markdown
Member

I see a lot of changes in files outside of the gui modules.

The reason I did not add those features in separate PRs is that they evolved with the GUI.

why do changes in kit constants affect the GUI?

it would take 5 minutes to open a PR for general functions like:

read_fiducials, write_fiducials

?

maintenance / deprecation cycle

I could just make any functions private that we don't want to maintain, like the C command wrappers.

that's certainly necessary.

how would you feel reopening PRs for your changes outside of the .gui code

As discussed above I can do it, but I feel it will take a lot of time and I am not sure it will make reviewing that much easier (since it is already possible here to view changes by file).

basically you're asking us to spend more time reviewing (reviewing time
is not linear in the number of lines) because you don't make the effort to
work incrementally. Also it's easy to find 20 mins to review 200 lines but
reviewing 2000 lines requires consecutive hours which are much harder
to allocate. Should you spend more time reviewing others work
you would be more convinced by these arguments.

@larsoner

larsoner commented Sep 6, 2013

Copy link
Copy Markdown
Member

I agree almost 5,000 lines is probably too much to review when scattered across topics. @christianmbrodbeck what do you think about breaking into consecutive PRs:

  1. KIT changes (new data read/written, etc).
  2. read_fiducials / write_fiducials, plus maybe the C-function wrappers.
  3. The GUI code.

This would greatly facilitate review. Does that sound reasonable?

@christianbrodbeck

Copy link
Copy Markdown
Member Author

why do changes in kit constants affect the GUI?

@agramfort I don't remember, specifically. However, KIT conversion does sensor - head shape coregistration, and in order to improve this step kit2fiff is now using the same transform functionality as the MRI coregistration.

I'm sorry to annoy you, but since I did not know what underlying functions had to do for the coregistration I could not implement them incrementally. This was too big to project with too little information at the outset to plan everything out from the bottom up.

@Eric89GXL I am submitting the fiducials IO. After that I would continue with the transform functionality (since the KIT relies on them)

This was referenced Sep 7, 2013
@christianbrodbeck christianbrodbeck mentioned this pull request Sep 14, 2013
5 of 9 tasks
@christianbrodbeck
christianbrodbeck deleted the trans branch December 29, 2013 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants