Mrview: automatically save generated image (screen capture tool options)

Dear MRTrix experts,

I’m using MRtrix 3.0.3 to create a connectome through a scripts that loops through a large number of participants. To be able to go through the QC more sufficient, I was wondering if it is possible to automatically save an image created by mrview. If this is a possibility, what would this command line be?

It would be very useful to include the mrview command and a command that would rewrite the mrview generated image to a file.

As this questions was initially posted on GitHub and reposted in this forum so all users can see it. I’ll add the responses from Ben Jeurissen and Robert Smith to this post:

Ben Jeurissen
Yes, this is possible through the combination of the -capture.* options and the -exit option from the mrview command, e.g.

mrview <options to load images and set things up> -capture.folder <output folder> -capture.prefix <output prefix> -capture.grab -exit

Consult mrview -help for more details.

Robert Smith
The catch here is that not every single interactive control in mrview has a corresponding command-line option. Ideally we would change the implementation so that this is always the case (#1438). But if there are isolated functionalities that you need for a specific project, we can potentially provide assistance regarding how to implement just those.

Thank you!

1 Like

Hi, In my attempts to run the suggested comment, I haven’t been able to save the created file. I was wondering what the ideal output file prefix would be -capture.prefix <output prefix>.

I want the run the following mrview comments:

mrview vf.mif -odf.load_sh meanwmfod.mif -capture.folder ${INITPATH} -capture.prefix <output prefix> -capture.grab -exit

mrview preproc_dwi.mif -tractography.load tracked.tck -capture.folder ${INITPATH} -capture.prefix <output prefix> -capture.grab -exit

mrview parcels.mif -connectome.init parcels.mif -connectome.load parcels.csv -capture.folder ${INITPATH} -capture.prefix <output prefix> -capture.grab -exit.