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ā€¦