Skip to content

Commit f83d089

Browse files
update tutorials
1 parent 3a82618 commit f83d089

5 files changed

+1036
-47
lines changed

examples/multi_plane_imaging_example.ipynb

Lines changed: 43 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
" MicroscopeModel,\n",
3737
" Microscope,\n",
3838
" MicroscopyRig,\n",
39+
" MicroscopyExperimentMetadata,\n",
3940
" LineScan,\n",
4041
" MicroscopyChannel,\n",
4142
" PlanarImagingSpace,\n",
@@ -113,7 +114,7 @@
113114
" model_number='etl-001',\n",
114115
" manufacturer='Custom Build'\n",
115116
")\n",
116-
"nwbfile.add_device(microscope_model)\n",
117+
"nwbfile.add_device_model(microscope_model)\n",
117118
"\n",
118119
"# Set up microscope with ETL technique\n",
119120
"microscope = Microscope(\n",
@@ -142,7 +143,7 @@
142143
" excitation_mode=\"two-photon\",\n",
143144
" wavelength_range_in_nm=[800.0, 1000.0]\n",
144145
")\n",
145-
"nwbfile.add_device(excitation_source_model)\n",
146+
"nwbfile.add_device_model(excitation_source_model)\n",
146147
"\n",
147148
"laser = PulsedExcitationSource(\n",
148149
" name='laser',\n",
@@ -172,7 +173,7 @@
172173
" center_wavelength_in_nm=920.0,\n",
173174
" bandwidth_in_nm=80.0\n",
174175
")\n",
175-
"nwbfile.add_device(excitation_filter_model)\n",
176+
"nwbfile.add_device_model(excitation_filter_model)\n",
176177
"\n",
177178
"excitation_filter = BandOpticalFilter(\n",
178179
" name='excitation_filter',\n",
@@ -192,7 +193,7 @@
192193
" reflection_band_in_nm=(400.0, 750.0),\n",
193194
" angle_of_incidence_in_degrees=45.0\n",
194195
")\n",
195-
"nwbfile.add_device(dichroic_mirror_model)\n",
196+
"nwbfile.add_device_model(dichroic_mirror_model)\n",
196197
"\n",
197198
"dichroic = DichroicMirror(\n",
198199
" name=\"primary_dichroic\",\n",
@@ -210,7 +211,7 @@
210211
" center_wavelength_in_nm=510.0,\n",
211212
" bandwidth_in_nm=84.0\n",
212213
")\n",
213-
"nwbfile.add_device(emission_filter_model)\n",
214+
"nwbfile.add_device_model(emission_filter_model)\n",
214215
"\n",
215216
"emission_filter = BandOpticalFilter(\n",
216217
" name='emission_filter',\n",
@@ -228,7 +229,7 @@
228229
" gain=70.0,\n",
229230
" gain_unit=\"dB\"\n",
230231
")\n",
231-
"nwbfile.add_device(photodetector_model)\n",
232+
"nwbfile.add_device_model(photodetector_model)\n",
232233
"\n",
233234
"detector = Photodetector(\n",
234235
" name='pmt',\n",
@@ -251,8 +252,6 @@
251252
" label='GCaMP6f',\n",
252253
" description='Calcium indicator for multi-plane imaging',\n",
253254
" manufacturer='Addgene',\n",
254-
" injection_brain_region='Visual cortex',\n",
255-
" injection_coordinates_in_mm=[-2.5, 3.2, 0.5]\n",
256255
")"
257256
]
258257
},
@@ -282,6 +281,19 @@
282281
" photodetector=detector,\n",
283282
" emission_filter=emission_filter\n",
284283
")\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": [
285297
"\n",
286298
"# Create microscopy channel\n",
287299
"microscopy_channel = MicroscopyChannel(\n",
@@ -290,7 +302,8 @@
290302
" excitation_wavelength_in_nm=920.0,\n",
291303
" emission_wavelength_in_nm=510.0,\n",
292304
" indicator=indicator\n",
293-
")"
305+
")\n",
306+
"\n"
294307
]
295308
},
296309
{
@@ -442,13 +455,29 @@
442455
" name='multi_plane_data',\n",
443456
" planar_microscopy_series=planar_series_list\n",
444457
")\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": [
446467
"\n",
447468
"segmentation_container = SegmentationContainer(\n",
448469
" name='plane_segmentations',\n",
449470
" segmentations=segmentation_list\n",
450471
")\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": [
452481
"\n",
453482
"response_container = MicroscopyResponseSeriesContainer(\n",
454483
" name='plane_responses',\n",
@@ -468,7 +497,7 @@
468497
},
469498
{
470499
"cell_type": "code",
471-
"execution_count": 9,
500+
"execution_count": null,
472501
"metadata": {},
473502
"outputs": [],
474503
"source": [
@@ -502,7 +531,7 @@
502531
],
503532
"metadata": {
504533
"kernelspec": {
505-
"display_name": "ndx-microscopy-env",
534+
"display_name": "ndx-ophys-devices-env",
506535
"language": "python",
507536
"name": "python3"
508537
},
@@ -516,7 +545,7 @@
516545
"name": "python",
517546
"nbconvert_exporter": "python",
518547
"pygments_lexer": "ipython3",
519-
"version": "3.11.10"
548+
"version": "3.13.0"
520549
}
521550
},
522551
"nbformat": 4,

0 commit comments

Comments
 (0)