55
66from . import register_class , CORE_NAMESPACE
77from .base import TimeSeries , Image
8+ from .device import Device
89
910
1011@register_class ('ImageSeries' , CORE_NAMESPACE )
@@ -17,7 +18,8 @@ class ImageSeries(TimeSeries):
1718 __nwbfields__ = ('dimension' ,
1819 'external_file' ,
1920 'starting_frame' ,
20- 'format' )
21+ 'format' ,
22+ 'device' )
2123
2224 @docval (* get_docval (TimeSeries .__init__ , 'name' ), # required
2325 {'name' : 'data' , 'type' : ('array_data' , 'data' , TimeSeries ), 'shape' : ([None ] * 3 , [None ] * 4 ),
@@ -40,10 +42,12 @@ class ImageSeries(TimeSeries):
4042 {'name' : 'dimension' , 'type' : Iterable ,
4143 'doc' : 'Number of pixels on x, y, (and z) axes.' , 'default' : None },
4244 * get_docval (TimeSeries .__init__ , 'resolution' , 'conversion' , 'timestamps' , 'starting_time' , 'rate' ,
43- 'comments' , 'description' , 'control' , 'control_description' ))
45+ 'comments' , 'description' , 'control' , 'control_description' ),
46+ {'name' : 'device' , 'type' : Device ,
47+ 'doc' : 'Device used to capture the images/video.' , 'default' : None },)
4448 def __init__ (self , ** kwargs ):
45- bits_per_pixel , dimension , external_file , starting_frame , format = popargs (
46- 'bits_per_pixel' , 'dimension' , 'external_file' , 'starting_frame' , 'format' , kwargs )
49+ bits_per_pixel , dimension , external_file , starting_frame , format , device = popargs (
50+ 'bits_per_pixel' , 'dimension' , 'external_file' , 'starting_frame' , 'format' , 'device' , kwargs )
4751 call_docval_func (super (ImageSeries , self ).__init__ , kwargs )
4852 if external_file is None and self .data is None :
4953 raise ValueError ("Must supply either external_file or data to %s '%s'."
@@ -56,6 +60,7 @@ def __init__(self, **kwargs):
5660 else :
5761 self .starting_frame = None
5862 self .format = format
63+ self .device = device
5964
6065 @property
6166 def bits_per_pixel (self ):
@@ -111,7 +116,11 @@ class ImageMaskSeries(ImageSeries):
111116 'doc' : 'Link to ImageSeries that mask is applied to.' },
112117 * get_docval (ImageSeries .__init__ , 'format' , 'external_file' , 'starting_frame' , 'bits_per_pixel' ,
113118 'dimension' , 'resolution' , 'conversion' , 'timestamps' , 'starting_time' , 'rate' , 'comments' ,
114- 'description' , 'control' , 'control_description' ))
119+ 'description' , 'control' , 'control_description' ),
120+ {'name' : 'device' , 'type' : Device ,
121+ 'doc' : ('Device used to capture the mask data. This field will likely not be needed. '
122+ 'The device used to capture the masked ImageSeries data should be stored in the ImageSeries.' ),
123+ 'default' : None },)
115124 def __init__ (self , ** kwargs ):
116125 masked_imageseries = popargs ('masked_imageseries' , kwargs )
117126 super (ImageMaskSeries , self ).__init__ (** kwargs )
@@ -146,7 +155,7 @@ class OpticalSeries(ImageSeries):
146155 'Must also specify frame of reference.' },
147156 * get_docval (ImageSeries .__init__ , 'external_file' , 'starting_frame' , 'bits_per_pixel' ,
148157 'dimension' , 'resolution' , 'conversion' , 'timestamps' , 'starting_time' , 'rate' , 'comments' ,
149- 'description' , 'control' , 'control_description' ))
158+ 'description' , 'control' , 'control_description' , 'device' ))
150159 def __init__ (self , ** kwargs ):
151160 distance , field_of_view , orientation = popargs ('distance' , 'field_of_view' , 'orientation' , kwargs )
152161 super (OpticalSeries , self ).__init__ (** kwargs )
0 commit comments