brainrender
was to facilitate the dissemination of neuroanatomical data. To do so, creating spectacular renderings is not enough, you need to have a way to export them into a format that you can easily share. For this reason we've put a lot of effort into allowing you to do just that by creating screenshots, animated videos and interactive online visualizations with your renderings.Scene
class has a screenshot
method that allows you to save a .png
image showing the current view of the rendering. By default the screenshots are saved in the current directory, but a you can use screenshots_folder
to pass a path to the folder where you want them to be saved when you're creating an instance of Scene.s
key in your keyboard. Using Scene.screenshot
however gives you the freedom to specify a name for the image file to be saved.brainrender
is setup to ignore the background when saving the screenshots. That means that you will have all of your rendered objects in your image, but the background will be transparent. If you want to include the background in your image, include these two lines before creating the screenshot:brainrender
supports the creating videos where at each frame it shows the current view of the scene and in-between frames it lets you move the scene around. VideoMaker
class. This takes a populate scene
as argument and allows you to create a video by specifying how the camera should move at each frame in the video. The basic VideoMaker
class only allows for rotations in the three principal directions, however you can use a custom function to specify what should happen at each frame.Animation
class. This allows you to specify the video's content by defining a few keyframes. At each keyframe you can specify a few parameters (e.g. camera position) and a function to be called when that point of the video is reached: you can then have your function perform the actions that you need (e.g. add a new actor). The video is then created by interpolating the parameter across keyframes and calling the specified functions when necessary.brainrender
now lets you export your scene to an .html
file which you can send to your colleagues (so that they can open it in their web browser) or embed in a website. html
is very easy, all you need to do is create a Scene
, add elements to it and once you're happy with it use the export_for_web
method of Scene
to create the .html
.k3d==2.7.4
and won't work with other versions of this packagebrainrender's
features can be included into your web export (because of limitations with the k3d
package. For instance the appearance of your exported scene might be different from the one you saw in brainrender.