brainrenderwas 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.
Sceneclass has a
screenshotmethod that allows you to save a
.pngimage showing the current view of the rendering. By default the screenshots are saved in the current directory, but a you can use
screenshots_folderto pass a path to the folder where you want them to be saved when you're creating an instance of Scene.
skey in your keyboard. Using
Scene.screenshothowever gives you the freedom to specify a name for the image file to be saved.
brainrenderis 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:
brainrendersupports 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.
VideoMakerclass. This takes a populate
sceneas argument and allows you to create a video by specifying how the camera should move at each frame in the video. The basic
VideoMakerclass only allows for rotations in the three principal directions, however you can use a custom function to specify what should happen at each frame.
Animationclass. 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.
brainrendernow lets you export your scene to an
.htmlfile which you can send to your colleagues (so that they can open it in their web browser) or embed in a website.
htmlis very easy, all you need to do is create a
Scene, add elements to it and once you're happy with it use the
Sceneto create the