Adding command line option to mrview to set tractography colors

For some of the work we are doing, different streamlines are generated that run quite close to each other. I’d like to be able to show streamlines overlaid on b0 (and or a registered anatomic image). In the GUI, it’s easy to randomize the colors of each .tck file by selecting them all and choosing ‘Random’ from the color combo box.

However, it would be great to be able to generate screenshots programmatically with colors set from the command line. Something like:

mrview b0.nii.gz -tractography.load tract.tck -tractography.color 1,0,0 -capture.prefix ...

First off: is this possible? Secondly, any pointers on how to add this feature?

Thanks,
-dan

Hi Daniel,

This is one of many items that have been identified within mrview as being accessible from the GUI but not the command-line. In part we haven’t put the effort into covering off those functionalities not yet accessible from the command-line because we’d rather implement a more general solution that would reduce both the management and proclivity for errors in such. This would however most logically be implemented alongside a rather large mrview code overhaul, which is no trivial task.

If you’re interested in just implementing one specific functionality in order to serve a specific purpose, it’s only a matter of identifying how similar functionalities are currently implemented, and then modifying a duplicate of such for your requirement. In your case, the relevant functions are:
GUI::MRView::Tool::Tractography::add_commandline_options()
GUI::MRView::Tool::Tractography::process_commandline_option()

Cheers
Rob