Repository: mne-tools/mne-python

Issue:
mne coreg save with scaled mri fails if fiducials haven't been saved
Hi, when trying to save a -trans file from MNE coreg after scaling the MRI the dialog box doesn't open if the fiducials file has not been saved.

**Problem:**
I tried tracking the problem and I think it arises because the dialog box that asks if one wants to save the fiducials fails to open due to:

 _coreg_gui.py; line 926:_
"rc = confirm(None, msg, title, cancel=True, default=CANCEL,
                    parent=self.info.ui.control)"

because the function "confirm" takes _parent_ as first argument and is also receiving it as keyword argument:

_/pyface/confirmation_dialog.py; line 22:_
"def confirm(parent, message, title=None, cancel=False, default=NO):" 

**Possible solutions:**
I've tried fixing it and I'v seen that both of the following changes fix the issue but I don't  know which one is preferable:

"rc = confirm(None, msg, title, cancel=True, default=CANCEL)"
                  
"rc = confirm(self.info.ui.control, msg, title, cancel=True, default=CANCEL)"

I'll be happy to make a pull request if you think this is ok and if you tell me which way is preferable.

Thanks for everything, cheers,

Eze


**Error Traceback:**
Exception occurred in traits notification handler for object: <mne.gui._coreg_gui.CoregPanel object at 0x7fc2ab01dca8>, trait: save, old value: <undefined>, new value: 0
Traceback (most recent call last):
  File "/home/eze/soft/anaconda3/envs/mne3/lib/python3.6/site-packages/traits/trait_notifiers.py", line 519, in _dispatch_change_event
    self.dispatch( handler, *args )
  File "/home/eze/soft/anaconda3/envs/mne3/lib/python3.6/site-packages/traits/trait_notifiers.py", line 614, in dispatch
    handler( *args )
  File "/home/eze/soft/anaconda3/envs/mne3/lib/python3.6/site-packages/traitsui/ui.py", line 1023, in dispatch
    self.method(self.info)
  File "/home/eze/soft/anaconda3/envs/mne3/lib/python3.6/site-packages/mne/gui/_coreg_gui.py", line 927, in object_save_changed
    parent=self.info.ui.control)
TypeError: confirm() got multiple values for argument 'parent'


**Sys info:**
Platform:      Linux-4.15.0-33-generic-x86_64-with-debian-buster-sid
Python:        3.6.6 |Anaconda, Inc.| (default, Jun 28 2018, 17:14:51)  [GCC 7.2.0]
Executable:    /home/eze/soft/anaconda3/envs/mne3/bin/python
CPU:           x86_64: 8 cores
Memory:        15.6 GB
mne:           0.17.dev0
numpy:         1.15.0 {blas=mkl_rt, lapack=mkl_rt}
scipy:         1.1.0
matplotlib:    2.2.2 {backend=Qt5Agg}
sklearn:       0.19.1
nibabel:       2.3.0
mayavi:        4.6.1 {qt_api=pyqt5}
cupy:          Not found
pandas:        0.23.3
dipy:          Not found




Discussion:
`rc = confirm(self.info.ui.control, msg, title, cancel=True, default=CANCEL)` sounds like the better choice.

Resolving patch:
diff --git a/mne/gui/_coreg_gui.py b/mne/gui/_coreg_gui.py
--- a/mne/gui/_coreg_gui.py
+++ b/mne/gui/_coreg_gui.py
@@ -923,8 +923,8 @@ def object_save_changed(self, info):  # noqa: D102
                    "Select No to proceed scaling the MRI without fiducials.".
                    format(src=subject_from))
             title = "Save Fiducials for %s?" % subject_from
-            rc = confirm(None, msg, title, cancel=True, default=CANCEL,
-                         parent=self.info.ui.control)
+            rc = confirm(self.info.ui.control, msg, title, cancel=True,
+                         default=CANCEL)
             if rc == CANCEL:
                 return
             elif rc == YES:


Test patch: