Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Differently localize electrodes with 3d scanner #939

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

SteixnerKumar
Copy link

When you select the elctrode positions manually it is time-comsuming to orient the head model to a desired view with just the keys 'w', 'a','s','d', hence I use the matlab figure window 3D rotate functionality. The problem is that when you want to rotate, the place where you point the mouse cursor gets selected as an electrode position. To avoid this I changed the code where the left mouse button does not select the electrode poisitions. The middle button is used for this purpose, but I have commented the line where the right mouse button can as well be configured to be used for this purpose.

Adds the functionality to select the electrode position with only the middle mouse button. Instead to accidently clicking the left mouse button because one may want to use the matlab 3D rotate functionality. Other keys and their functionality remain the same.
Adds the functionality to select the electrode position with only the middle mouse button (can be modified for using only the right mouse button, there is a comment mentioning that) . Instead of accidently clicking the left mouse button because one may want to use the matlab 3D rotate functionality. Other keys and their functionality remain the same.
@robertoostenveld
Copy link
Contributor

many computers (especially laptops) don't have a middle mouse button, so I don't think that is a good idea as default.

Could you make a small test script that demonstrates it, starting from high-level functions (i.e. ft_electrodeplacement)?

@SteixnerKumar
Copy link
Author

SteixnerKumar commented Feb 6, 2019

Yes, agreed, the middle mouse botton may not be the best solution therefore in the script there is an option to change this to the right mouse button. I think it is not ideal to click an electrode position just by trying to rotate the head model (easily done with the 3d rotate functionality), specially if hundreds of electrodes are involved where one would like to use this script.
In addition if one may want to use the right mouse button to select electrodes the future additions to this function should explore ways to supress any other menu items to open while right clicking.
For middle button owners, no issues ofcourse.

Please find the attached test script, it is the same from the tutorial - http://www.fieldtriptoolbox.org/tutorial/electrode/
test_script.zip
the model data is also from the same page.

The function ft_electrodeplacement calls the function ft_select_point3d where obviously the changes are made in this suggested commit.

extra: For reference I attach another file sk_select_point3d, which is the changed ft_select_point3d file for checking the functionality. To do this line 170 in ft_electrodeplacement will need to be changed from ft_select_point3d to sk_select_point3d.

@Horschig
Copy link
Contributor

maybe rotate if you left click and hold shift or ctrl or so? that is also a standard way to do so (but note my confusion about shift and ctrl, because some programs use the one, others the other one - so much for 'standard' way)

@SteixnerKumar
Copy link
Author

That's a good point, perhaps the shift/ctrl key in addition to the left mouse click to rotate model is a better way; And just the left mouse click selects the electrode.

@schoffelen
Copy link
Contributor

Hi @saurabhsay what is the status of this? Do you know how to proceed based on @Horschig and @robertoostenveld 's inputs?

@SteixnerKumar
Copy link
Author

Hi @schoffelen , I really like the idea from @Horschig , and it is easy enough to include this. I can edit and include this functionality in some time.
Also working on an automatic recognition of the positions using some image processing techniques, however this has been impacted due to the current Covid19 crises. Will come back on it as and when this changes.

p.s.
The three mouse button solution works for the 'non-Mac' users. I understand that this is not optimal.

@schoffelen
Copy link
Contributor

schoffelen commented Feb 10, 2022

The last ativity on this thread is already > 1.5 year ago. @SteixnerKumar what is the status of this. Has this been resolved for you, or is this easily resolvable? If not, I suggest to close the PR without merging.

@SteixnerKumar
Copy link
Author

@schoffelen, Thanks for reaching out on this. It is resolved for windows and Linux systems that use the 3 button mouse (the merge request was open for this!). However not for the apple system. I am not currently working on this since I do not use the mac. @Horschig had the idea that will solve this for mac systems as well and would make it consistent over the different OS.
I hope someone wants to implement this? Else, please decide on the PR as it works only on Windows and Linux.

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.

None yet

4 participants