Skip to content

Commit 501c352

Browse files
committed
adding some cifti properties
1 parent 4592905 commit 501c352

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

nibabel/cifti/cifti.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272

7373

7474
class CiftiMetaData(object):
75-
""" A list of CiftiNVPairs in stored in the list self.data """
75+
""" A list of key-value pairs stored in the list self.data """
7676

7777
def __init__(self, nvpair=None):
7878
self.data = []
@@ -149,6 +149,10 @@ class CiftiLabelTable(object):
149149
def __init__(self):
150150
self.labels = []
151151

152+
@property
153+
def num_labels(self):
154+
return len(self.labels)
155+
152156
def get_labels_as_dict(self):
153157
self.labels_as_dict = {}
154158
for ele in self.labels:
@@ -190,7 +194,8 @@ def __init__(self, key = 0, label = '', red = None,\
190194
self.blue = blue
191195
self.alpha = alpha
192196

193-
def get_rgba(self):
197+
@property
198+
def rgba(self):
194199
""" Returns RGBA as tuple """
195200
return (self.red, self.green, self.blue, self.alpha)
196201

0 commit comments

Comments
 (0)