pyushkevich/itksnap

Code logic of the using command line tool to set colormap

sterben-01 opened this issue · 2 comments

In the file itksnap/Logic/Common/ColorMap.cxx. FunctionColorMap::GetPresetName, the variable preset_names contains a lot of phrases separated by space. But the command line tool can not parse those phrases which contain space.
For example, If I want to set colormap as this
itksnap-wt -layers-set-main 1.nrrd -layers-add-anat 2.nrrd -props-set-colormap Black to red -layers-add-anat 3.nrrd -props-set-colormap Black to blue -o new.itksnap

This command will cause the error:
System exception for command : Expected a command at position 8, instead got 'to'.
Although people can add quotation marks around the color, such as "Black to red", but I think that is not a good idea.
I think the preset name should be changed from Black to red to Black-to-red or Black_to_red.

Try -props-set-colormap "Black to red"

Yeah that works