Rotating volume programatically in mrview

Hi all,

I am trying to take screenshots of tracts from different participants. I want a screenshot of the left and right hemisphere. I cannot seem to rotate the volume to show the right hemisphere. My command is currently this:

mrview -load ../${UNI}_1/${UNI}_1-T1w.nii.gz \
-tractography.load $IN \
-tractography.lighting 1 \
-tractography.thickness 0.3 \
-mode 3 \
-plane 0 \
-imagevisible 1 \
-fullscreen \
-noannotations \
-capture.prefix ${UNI}_1-tract-${S}- \
-capture.grab 
-exit"

Any thoughts?

Claude

1 Like

Unfortunately, there’s no option to do that. What you’d need is an option to manipulate the orientation quaternion that we use internally to handle arbitrary rotations. It wouldn’t be too hard to add that option, but probably a little difficult for users to figure out the correct quaternion for the rotation – it’s not the most intuitive thing (although in your case it would require a simple 180° rotation about the z-axis, which I think would be a 0,0,0,1 quaternion). I’m happy to point people in the right direction as to how to implement that, but I don’t have a lot of time on my hands at the moment, unfortunately…

That sounds a bit low-level… wouldn’t it be possible to (ā€œsimplyā€ :slightly_smiling_face:) add more command line options to mrview to control the various elements that are already present in the screen capture tool? They’re not specified in quaternions, but in a simple axis and angle, and then the play/record buttons of course. I mean, if I want to establish what @cbajada is asking via the GUI, I simply have to open up the screen capture tool, set the rotation axis to 0,0,1 (which is already the default even), set ā€œangleā€ to 180, and hit play; and my volume is rotated. So, unless I’m naively overlooking something somehow, if there’d be options like -capture.rotate_axis 0,0,1 and -capture.rotate_angle 180 and -capture.play, in addition to the existing -capture.grab… that should do the job, but in an intuitive manner (and equivalent to how users are already used to using the screen capture tool). I reckon if we’d add options for all settings / fields / actions of the screen capture tool, users can essentially script whole movies (including more complex camera trajectories).

Yep. The only issue here is that ā€˜simply’ bit… Adding one option is a lot easier than adding the ~6 or so necessary to provide that kind of interface. But if you’re volunteering… :stuck_out_tongue_winking_eye:

Haha, yeah… maybe within a few years when I’m not working late nights and weekends any more… :stuck_out_tongue_winking_eye: .

No, but what I actually also meant is, that I was thinking (but not sure) this would be easier to implement even? Most other mrview command line options are of the kind that they directly trigger the action associated with a GUI element (or set it to a value), right?

I’m not sure it makes all that much difference. I agree that conceptually, it’s a lot easier to ensure command-line options mirror the functionality available on the UI though…