File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 2525from pynwb import NWBFile
2626from pynwb .file import ProcessingModule , Subject
2727
28+ try :
29+ from pynwb .device import DeviceModel
30+ except ImportError :
31+ # Temporary error message to ensure existing users have the correct version of pynwb
32+ raise ImportError ("Please upgrade pynwb to 3.1.0 or later" )
33+
2834import trodes_to_nwb .metadata_validation
2935from trodes_to_nwb import __version__
3036
@@ -135,12 +141,17 @@ def add_cameras(nwbfile: NWBFile, metadata: dict) -> None:
135141 """
136142 # add each camera device to the nwb
137143 for camera_metadata in metadata ["cameras" ]:
144+ model = DeviceModel (
145+ name = camera_metadata ["model" ],
146+ manufacturer = camera_metadata ["manufacturer" ],
147+ description = "" ,
148+ )
138149 nwbfile .add_device (
139150 CameraDevice (
140151 name = "camera_device " + str (camera_metadata ["id" ]),
141152 meters_per_pixel = camera_metadata ["meters_per_pixel" ],
142153 manufacturer = camera_metadata ["manufacturer" ],
143- model = camera_metadata [ " model" ] ,
154+ model = model ,
144155 lens = camera_metadata ["lens" ],
145156 camera_name = camera_metadata ["camera_name" ],
146157 )
You can’t perform that action at this time.
0 commit comments