5
5
import numpy as np
6
6
from hdmf .common .table import DynamicTable , DynamicTableRegion
7
7
from pynwb import NWBFile
8
- from pynwb .device import Device
8
+ from pynwb .device import Device , DeviceModel
9
9
from pynwb .ophys import (
10
10
ImageSegmentation ,
11
11
ImagingPlane ,
@@ -32,9 +32,12 @@ def setUp(self):
32
32
session_description = "" , identifier = str (uuid4 ()), session_start_time = datetime .now ().astimezone ()
33
33
)
34
34
35
- device = nwbfile .create_device (
36
- name = "Microscope" , description = "My two-photon microscope" , manufacturer = "The best microscope manufacturer"
35
+ device_model = nwbfile .create_device_model (
36
+ name = "My Microscope" ,
37
+ description = "My two-photon microscope" ,
38
+ manufacturer = "The best microscope manufacturer" ,
37
39
)
40
+ device = nwbfile .create_device (name = "Microscope" , description = "My two-photon microscope" , model = device_model )
38
41
optical_channel = OpticalChannel (name = "OpticalChannel" , description = "an optical channel" , emission_lambda = 500.0 )
39
42
imaging_plane = nwbfile .create_imaging_plane (
40
43
name = "ImagingPlane" ,
@@ -180,9 +183,10 @@ def test_pass_check_roi_response_series_link_to_plane_segmentation(self):
180
183
181
184
182
185
def test_check_excitation_lambda_in_nm ():
183
- device = Device (
184
- name = "Microscope" , description = "My two-photon microscope" , manufacturer = "The best microscope manufacturer"
186
+ device_model = DeviceModel (
187
+ name = "My Microscope" , description = "My two-photon microscope" , manufacturer = "The best microscope manufacturer"
185
188
)
189
+ device = Device (name = "Microscope" , description = "My two-photon microscope" , model = device_model )
186
190
optical_channel = OpticalChannel (name = "OpticalChannel" , description = "an optical channel" , emission_lambda = 500.0 )
187
191
imaging_plane = ImagingPlane (
188
192
name = "ImagingPlane" ,
@@ -203,9 +207,10 @@ def test_check_excitation_lambda_in_nm():
203
207
204
208
205
209
def test_pass_check_excitation_lambda_in_nm ():
206
- device = Device (
207
- name = "Microscope" , description = "My two-photon microscope" , manufacturer = "The best microscope manufacturer"
210
+ device_model = DeviceModel (
211
+ name = "My Microscope" , description = "My two-photon microscope" , manufacturer = "The best microscope manufacturer"
208
212
)
213
+ device = Device (name = "Microscope" , description = "My two-photon microscope" , model = device_model )
209
214
optical_channel = OpticalChannel (name = "OpticalChannel" , description = "an optical channel" , emission_lambda = 500.0 )
210
215
imaging_plane = ImagingPlane (
211
216
name = "ImagingPlane" ,
@@ -236,9 +241,10 @@ def test_pass_check_emission_lambda_in_nm():
236
241
237
242
238
243
def test_pass_check_plane_segmentation_image_mask_dims_against_imageseries ():
239
- device = Device (
240
- name = "Microscope" , description = "My two-photon microscope" , manufacturer = "The best microscope manufacturer"
244
+ device_model = DeviceModel (
245
+ name = "My Microscope" , description = "My two-photon microscope" , manufacturer = "The best microscope manufacturer"
241
246
)
247
+ device = Device (name = "Microscope" , description = "My two-photon microscope" , model = device_model )
242
248
optical_channel = OpticalChannel (name = "OpticalChannel" , description = "an optical channel" , emission_lambda = 500.0 )
243
249
imaging_plane = ImagingPlane (
244
250
name = "ImagingPlane" ,
@@ -275,9 +281,10 @@ def test_pass_check_plane_segmentation_image_mask_dims_against_imageseries():
275
281
276
282
277
283
def test_fail_check_plane_segmentation_image_mask_dims_against_imageseries ():
278
- device = Device (
279
- name = "Microscope" , description = "My two-photon microscope" , manufacturer = "The best microscope manufacturer"
284
+ device_model = DeviceModel (
285
+ name = "My Microscope" , description = "My two-photon microscope" , manufacturer = "The best microscope manufacturer"
280
286
)
287
+ device = Device (name = "Microscope" , description = "My two-photon microscope" , model = device_model )
281
288
optical_channel = OpticalChannel (name = "OpticalChannel" , description = "an optical channel" , emission_lambda = 500.0 )
282
289
imaging_plane = ImagingPlane (
283
290
name = "ImagingPlane" ,
@@ -323,9 +330,10 @@ def test_fail_check_plane_segmentation_image_mask_dims_against_imageseries():
323
330
324
331
325
332
def test_false_positive_skip_check_image_series_data_size ():
326
- device = Device (
327
- name = "Microscope" , description = "My two-photon microscope" , manufacturer = "The best microscope manufacturer"
333
+ device_model = DeviceModel (
334
+ name = "My Microscope" , description = "My two-photon microscope" , manufacturer = "The best microscope manufacturer"
328
335
)
336
+ device = Device (name = "Microscope" , description = "My two-photon microscope" , model = device_model )
329
337
optical_channel = OpticalChannel (name = "OpticalChannel" , description = "an optical channel" , emission_lambda = 500.0 )
330
338
imaging_plane = ImagingPlane (
331
339
name = "ImagingPlane" ,
0 commit comments