|
36 | 36 | " MicroscopeModel,\n", |
37 | 37 | " Microscope,\n", |
38 | 38 | " MicroscopyRig,\n", |
| 39 | + " MicroscopyExperimentMetadata,\n", |
39 | 40 | " LineScan,\n", |
40 | 41 | " MicroscopyChannel,\n", |
41 | 42 | " PlanarImagingSpace,\n", |
|
113 | 114 | " model_number='etl-001',\n", |
114 | 115 | " manufacturer='Custom Build'\n", |
115 | 116 | ")\n", |
116 | | - "nwbfile.add_device(microscope_model)\n", |
| 117 | + "nwbfile.add_device_model(microscope_model)\n", |
117 | 118 | "\n", |
118 | 119 | "# Set up microscope with ETL technique\n", |
119 | 120 | "microscope = Microscope(\n", |
|
142 | 143 | " excitation_mode=\"two-photon\",\n", |
143 | 144 | " wavelength_range_in_nm=[800.0, 1000.0]\n", |
144 | 145 | ")\n", |
145 | | - "nwbfile.add_device(excitation_source_model)\n", |
| 146 | + "nwbfile.add_device_model(excitation_source_model)\n", |
146 | 147 | "\n", |
147 | 148 | "laser = PulsedExcitationSource(\n", |
148 | 149 | " name='laser',\n", |
|
172 | 173 | " center_wavelength_in_nm=920.0,\n", |
173 | 174 | " bandwidth_in_nm=80.0\n", |
174 | 175 | ")\n", |
175 | | - "nwbfile.add_device(excitation_filter_model)\n", |
| 176 | + "nwbfile.add_device_model(excitation_filter_model)\n", |
176 | 177 | "\n", |
177 | 178 | "excitation_filter = BandOpticalFilter(\n", |
178 | 179 | " name='excitation_filter',\n", |
|
192 | 193 | " reflection_band_in_nm=(400.0, 750.0),\n", |
193 | 194 | " angle_of_incidence_in_degrees=45.0\n", |
194 | 195 | ")\n", |
195 | | - "nwbfile.add_device(dichroic_mirror_model)\n", |
| 196 | + "nwbfile.add_device_model(dichroic_mirror_model)\n", |
196 | 197 | "\n", |
197 | 198 | "dichroic = DichroicMirror(\n", |
198 | 199 | " name=\"primary_dichroic\",\n", |
|
210 | 211 | " center_wavelength_in_nm=510.0,\n", |
211 | 212 | " bandwidth_in_nm=84.0\n", |
212 | 213 | ")\n", |
213 | | - "nwbfile.add_device(emission_filter_model)\n", |
| 214 | + "nwbfile.add_device_model(emission_filter_model)\n", |
214 | 215 | "\n", |
215 | 216 | "emission_filter = BandOpticalFilter(\n", |
216 | 217 | " name='emission_filter',\n", |
|
228 | 229 | " gain=70.0,\n", |
229 | 230 | " gain_unit=\"dB\"\n", |
230 | 231 | ")\n", |
231 | | - "nwbfile.add_device(photodetector_model)\n", |
| 232 | + "nwbfile.add_device_model(photodetector_model)\n", |
232 | 233 | "\n", |
233 | 234 | "detector = Photodetector(\n", |
234 | 235 | " name='pmt',\n", |
|
251 | 252 | " label='GCaMP6f',\n", |
252 | 253 | " description='Calcium indicator for multi-plane imaging',\n", |
253 | 254 | " manufacturer='Addgene',\n", |
254 | | - " injection_brain_region='Visual cortex',\n", |
255 | | - " injection_coordinates_in_mm=[-2.5, 3.2, 0.5]\n", |
256 | 255 | ")" |
257 | 256 | ] |
258 | 257 | }, |
|
282 | 281 | " photodetector=detector,\n", |
283 | 282 | " emission_filter=emission_filter\n", |
284 | 283 | ")\n", |
| 284 | + "microscopy_experiment_metadata = MicroscopyExperimentMetadata(\n", |
| 285 | + " indicators=[indicator],\n", |
| 286 | + " microscopy_rigs=[microscopy_rig],\n", |
| 287 | + ")\n", |
| 288 | + "nwbfile.add_lab_meta_data(microscopy_experiment_metadata)" |
| 289 | + ] |
| 290 | + }, |
| 291 | + { |
| 292 | + "cell_type": "code", |
| 293 | + "execution_count": null, |
| 294 | + "metadata": {}, |
| 295 | + "outputs": [], |
| 296 | + "source": [ |
285 | 297 | "\n", |
286 | 298 | "# Create microscopy channel\n", |
287 | 299 | "microscopy_channel = MicroscopyChannel(\n", |
|
290 | 302 | " excitation_wavelength_in_nm=920.0,\n", |
291 | 303 | " emission_wavelength_in_nm=510.0,\n", |
292 | 304 | " indicator=indicator\n", |
293 | | - ")" |
| 305 | + ")\n", |
| 306 | + "\n" |
294 | 307 | ] |
295 | 308 | }, |
296 | 309 | { |
|
442 | 455 | " name='multi_plane_data',\n", |
443 | 456 | " planar_microscopy_series=planar_series_list\n", |
444 | 457 | ")\n", |
445 | | - "nwbfile.add_acquisition(multi_plane_container)\n", |
| 458 | + "nwbfile.add_acquisition(multi_plane_container)\n" |
| 459 | + ] |
| 460 | + }, |
| 461 | + { |
| 462 | + "cell_type": "code", |
| 463 | + "execution_count": null, |
| 464 | + "metadata": {}, |
| 465 | + "outputs": [], |
| 466 | + "source": [ |
446 | 467 | "\n", |
447 | 468 | "segmentation_container = SegmentationContainer(\n", |
448 | 469 | " name='plane_segmentations',\n", |
449 | 470 | " segmentations=segmentation_list\n", |
450 | 471 | ")\n", |
451 | | - "ophys_module.add(segmentation_container)\n", |
| 472 | + "ophys_module.add(segmentation_container)\n" |
| 473 | + ] |
| 474 | + }, |
| 475 | + { |
| 476 | + "cell_type": "code", |
| 477 | + "execution_count": null, |
| 478 | + "metadata": {}, |
| 479 | + "outputs": [], |
| 480 | + "source": [ |
452 | 481 | "\n", |
453 | 482 | "response_container = MicroscopyResponseSeriesContainer(\n", |
454 | 483 | " name='plane_responses',\n", |
|
468 | 497 | }, |
469 | 498 | { |
470 | 499 | "cell_type": "code", |
471 | | - "execution_count": 9, |
| 500 | + "execution_count": null, |
472 | 501 | "metadata": {}, |
473 | 502 | "outputs": [], |
474 | 503 | "source": [ |
|
502 | 531 | ], |
503 | 532 | "metadata": { |
504 | 533 | "kernelspec": { |
505 | | - "display_name": "ndx-microscopy-env", |
| 534 | + "display_name": "ndx-ophys-devices-env", |
506 | 535 | "language": "python", |
507 | 536 | "name": "python3" |
508 | 537 | }, |
|
516 | 545 | "name": "python", |
517 | 546 | "nbconvert_exporter": "python", |
518 | 547 | "pygments_lexer": "ipython3", |
519 | | - "version": "3.11.10" |
| 548 | + "version": "3.13.0" |
520 | 549 | } |
521 | 550 | }, |
522 | 551 | "nbformat": 4, |
|
0 commit comments