Create animation from mrview

I would like to create an animation of one image overlaid on another one from mrview GUI. Is there a way to do it in mrtrix3?
Here you find attached a screenshot of the 2 images overlaid.

Hi Rosella,

I’m not sure exactly what kind of animation you’re after, but you can certainly improve on the display you have using the controls on the overlay tool. Here’s an example with the main image displayed using the hot colourmap, and the overlay using the cool colourmap, mixed approximately 50/50:

You can adjust the mixing using the opacity slider, change the colourmap using the appropriate entry, and threshold out the background if that helps.

If you’re trying to create an animation of one image blending into the other, there’s no simple way to do this with the screen capture tool, but you can probably fiddle something using the command-line, using a combination of -overlay.opacity and -capture.grab, e.g.:

mrview -config MRViewOrthoAsRow 1 -config MRViewDockFloating 1 \
anat.nii -noannotation -size 900,300 -colourmap 2 -mode 2 \
-overlay.load b0.mif -overlay.colourmap 2 \
$(for x in `seq 0 0.05 1`; do echo -n "-overlay.opacity $x -capture.grab "; done) \

This involves a bit of bash command substitution in the 4th line to replicate the -overlay.load and -capture.grab options with increasing opacity values without needing to manually type them in. I won’t go through all the details of how this works (this is left as an exercise for the interested reader :stuck_out_tongue_winking_eye:) , but this produces a set of PNG images labelled screenshot00xy.png, which you can then convert to e.g. GIF using e.g. ImageMagick with a command like:

convert -delay 5 screenshot*.png -loop 0 fade.gif

to produce something like this:

Is this more or less what you had in mind?

1 Like

thank you for your reply , that is what I meant.

Hi Donald,
Is there any command to make a rotating brain? Or showing the slices fading backward or forward?


Hi Maryam,

Yes, you can use the Screen Capture tool for this. I really need to create a demo video for how to use this, it’s not immediately obvious how to use it. I don’t have a lot of time to go into it right now, but hopefully you’ll find other posts on here that provide a bit more detail, such as this one.

All the best!