pyushkevich / itksnap

ITK-SNAP medical image segmentation tool
http://www.itksnap.org
GNU General Public License v3.0
299 stars 88 forks source link

Code logic of the using command line tool to set colormap #93

Closed sterben-01 closed 1 year ago

sterben-01 commented 1 year ago

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.

jilei-hao commented 1 year ago

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

sterben-01 commented 1 year ago

Yeah that works