Skip to content
Snippets Groups Projects
Commit 267a1198 authored by Paul McCarthy's avatar Paul McCarthy
Browse files

LabelOpts.lut generated command line value was 'LookupTable ...' -

fixed, so that the lut key is output.
parent 3987a098
No related branches found
No related tags found
No related merge requests found
......@@ -12,13 +12,9 @@ import volumeopts
import fsl.fsleyes.colourmaps as fslcm
luts = fslcm.getLookupTables()
names = [l.name for l in luts]
alts = [[l.key] for l in luts]
class LabelOpts(volumeopts.ImageOpts):
lut = props.Choice(luts, labels=names, alternates=alts)
lut = props.Choice()
outline = props.Boolean(default=False)
outlineWidth = props.Real(minval=0, maxval=1, default=0.25, clamped=True)
showNames = props.Boolean(default=False)
......@@ -26,3 +22,10 @@ class LabelOpts(volumeopts.ImageOpts):
def __init__(self, overlay, *args, **kwargs):
volumeopts.ImageOpts.__init__(self, overlay, *args, **kwargs)
luts = fslcm.getLookupTables()
names = [l.name for l in luts]
alts = [[l.key] for l in luts]
lutChoice = self.getProp('lut')
lutChoice.setChoices(luts, labels=names, alternates=alts)
......@@ -376,7 +376,12 @@ EXTRA = td.TypeDict({
def _imageTrans(i):
if i == 'none': return None
else: return i.dataSource
def _lutTrans(l):
if isinstance(l, colourmaps.LookupTable): return l.key
else: return l
TRANSFORMS = td.TypeDict({
'SceneOpts.showCursor' : lambda b: not b,
......@@ -391,6 +396,8 @@ TRANSFORMS = td.TypeDict({
# is only used when generating arguments
'VectorOpts.modulate' : _imageTrans,
'ModelOpts.refImage' : _imageTrans,
'LabelOpts.lut' : _lutTrans,
})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment