Hello Mrtrix Expert
I have a minor issue. I wish to add an option in mrview in order change the colormap of my streamline in command line. I’m looking for a bit of help.
Looking at this post : Adding command line option to mrview to set tractography colors , It was straightfoward to modify mrview to add the option:
-tractography.tsf_colourmap index (multiple uses permitted)
Sets the colourmap of the .tsf file as indexed in the tsfcolourmap dropdown
menu. Requires -tractography.tsf_load already
using this:
+ Option ("tractography.tsf_colourmap", "Sets the colourmap of the .tsf file as indexed in the tsf colourmap dropdown menu. Requires -tractography.tsf_load already ").allow_multiple()
+ Argument ("index").type_integer();
Now I need to call a Class or a Function that actually do the change.
if (opt.opt->is ("tractography.tsf_colourmap"))
{
try {
int n = opt[0];
if (n < 0 || !ColourMap::maps[n].name)
throw Exception ("invalid overlay colourmap index \"" + std::string (opt[0]) + "\" for -tractography.tsf_colourmap option");
// help needed here !
// scalar_file_options->set_track_colormap(n) ?
}
catch (Exception& e) { e.display(); }
}
My knowledge of the MRtrix code is close to zero (it is actually zero). In case, it is simple, could you indicate me the command or the class to look for changing the colourmap of the .tsf file. I have been able to it in hard coding the file Tractogram.cpp , line 379
{
set_allowed_features (true, true, true);
colourmap = 3; //// <- here
connect (&window(), SIGNAL (fieldOfViewChanged()), this, SLOT (on_FOV_changed()));
on_FOV_changed ();
}
But a cleaner way would be welcomed. And it will prevent me from editing the file and recompiling of the software.
Thanks in advance,
Valéry