-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
MRG: Add support for reading and writing sufaces to .obj #7824
Conversation
mne/surface.py
Outdated
for v in coords: | ||
fid.write('v {} {} {}\n'.format(*v)) | ||
for f in faces: | ||
fid.write('f {} {} {}\n'.format(*(f + 1))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wmvanvliet we are allowed to use f-strings now because we require 3.6+
mne/tests/test_surface.py
Outdated
@@ -244,4 +252,4 @@ def test_normal_orth(): | |||
assert_allclose(ori[2], nn, atol=1e-12) | |||
|
|||
|
|||
run_tests_if_main() | |||
#run_tests_if_main() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW now that we have pytest
and it's (much) easier to use, I find these not so helpful. I'd be okay with getting rid of them in the codebase...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively, is there a good way to run a single test inside a Jupyter console? (I usually need the postmortem debugger)
Personally I just do:
this drops to a |
Does that mean that CircleCI is complaining that no examples needed to be build or something? |
No, it's a warning about optipng (warnings are treated as errors) that you can safely ignore. It's because your branch is out of date and CircleCI doesn't / can't merge the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it just needs latest.inc
update then +1 for merge from me
I'm still working on the "fix my BEM with Blender" tutorial, which I feel should be part of this PR. |
I can push a commit to fix the warnings and add a thumbnail (hopefully) |
(FYI testing locally with Grr... something is wrong with the SG static thumb embedding. I'll probably need to fix that at the SG end, but the syntax here is correct so shouldn't be a blocker for merge |
... turns out I just can't spell |
When CI comes back green, this is ready to merge from my end. |
Green other than timeouts that are not your fault that we can ignore |
The files are actually kind of big (500 / 700 kB), maybe some suitable JPG compression could be used? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the latest.inc
tweak LGTM
@ezemikulan do you want to have a look?
Image filesizes are around 100kb now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure why CIs complain but it looks good to me
CI's were timing out |
Hi, sorry for the late reply, looks great to me! |
Hi @ezemikulan, thanks! If you can state you full name I can add you properly instead of just your username. |
It is Ezequiel Mikulan Thanks again |
* upstream/master: (24 commits) WIP: Fix Travis (mne-tools#7906) WIP: Prototype of notebook viz (screencast) (mne-tools#7758) MRG, FIX: Speed up I/O tests, mark some slow (mne-tools#7904) Proper attribution for Blender tutorial (mne-tools#7900) MAINT: Check usage [ci skip] (mne-tools#7902) Allow find_bad_channels_maxwell() to return scores (mne-tools#7845) Warn if NIRx directory structure has been modified from original format (mne-tools#7898) Pin pvyista to 0.24.3 (mne-tools#7899) MRG: Add support for reading and writing sufaces to .obj (mne-tools#7824) Fix _auto_topomap_coords docstring. (mne-tools#7895) MRG, FIX: Ensure Info H5-writeable (mne-tools#7887) Website contents (mne-tools#7889) MRG, ENH: Add mri_resolution="sparse" (mne-tools#7888) MRG, ENH: Allow disabling FXAA (mne-tools#7877) remove "and and" [ci skip] (mne-tools#7882) fix evoked nave → inverse guidance (mne-tools#7881) ENH: Better error messages (mne-tools#7879) FIX : EDF+ Annotation Timestamps missing sub-second accuracy (mne-tools#7875) FIX: Fix get_channel_types (mne-tools#7878) MRG, BUG: Fix combine evokeds (mne-tools#7869) ...
* upstream/master: (23 commits) MAINT: Add mne.surface to docstring tests (mne-tools#7930) MRG: Add smoothing controller to TimeViewer for the notebook backend (mne-tools#7928) MRG: TimeViewer matplotlib figure color (mne-tools#7925) fix typos (mne-tools#7924) MRG, ENH: Add method to project onto max power ori (mne-tools#7883) WIP: Warn if untested NIRX device (mne-tools#7905) MRG, BUG: Fix bug with volume morph and subject_to!="fsaverage" (mne-tools#7896) MRG, MAINT: Clean up use of bool, float, int (mne-tools#7917) ENH: Better error message for incompatible Evoked objects (mne-tools#7910) try to fix nullcontext (mne-tools#7908) WIP: Fix Travis (mne-tools#7906) WIP: Prototype of notebook viz (screencast) (mne-tools#7758) MRG, FIX: Speed up I/O tests, mark some slow (mne-tools#7904) Proper attribution for Blender tutorial (mne-tools#7900) MAINT: Check usage [ci skip] (mne-tools#7902) Allow find_bad_channels_maxwell() to return scores (mne-tools#7845) Warn if NIRx directory structure has been modified from original format (mne-tools#7898) Pin pvyista to 0.24.3 (mne-tools#7899) MRG: Add support for reading and writing sufaces to .obj (mne-tools#7824) Fix _auto_topomap_coords docstring. (mne-tools#7895) ...
Add support for exporting FreeSurfer surfaces to .obj files so you can import them in blender.
![blender](https://user-images.githubusercontent.com/428273/82824437-fed51980-9eb1-11ea-9140-a9d5e811ecec.png)
See also: https://github.com/ezemikulan/blender_freesurfer
Todo:
Surface inner skull is not completely inside surface outer skull
errors