TwoPy 0.3.2__py3-none-any.whl → 0.3.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
twopy/__init__.py CHANGED
@@ -5,305 +5,324 @@ Inputs: none.
5
5
  Outputs: package constants and helper functions imported by users and scripts.
6
6
  """
7
7
 
8
- from twopy._version import __version__
9
- from twopy.analysis import (
10
- DEFAULT_RESPONSE_POST_WINDOW_SECONDS,
11
- DEFAULT_RESPONSE_PRE_WINDOW_SECONDS,
12
- AnalysisResponseComputation,
13
- AnalysisResponseRun,
14
- BackgroundCorrectedRoiTraces,
15
- BackgroundCorrectionMethod,
16
- CorrelationFilterOptions,
17
- DeltaFOverFBaselineMode,
18
- DeltaFOverFFitMode,
19
- DeltaFOverFOptions,
20
- EpochFrameWindow,
21
- EpochResponseMap,
22
- FrameWindow,
23
- GroupedRoiResponses,
24
- GroupedRoiResponseSummary,
25
- Hemisphere,
26
- KernelFitMethod,
27
- KernelStimulusModality,
28
- LoadedAnalysisOutputs,
29
- LowPassFilterOptions,
30
- ManualFovGroupRow,
31
- ManualRoiMatchGroup,
32
- ManualRoiMatchRow,
33
- ManualRoiMatchStatus,
34
- RecordingKernelFit,
35
- RecordingTiming,
36
- ResponseMapData,
37
- ResponseMapMode,
38
- ResponseMapOptions,
39
- ResponseProcessingOptions,
40
- RoiCorrelationScores,
41
- RoiDeltaFOverF,
42
- RoiResponseSummary,
43
- RoiResponseTrial,
44
- SmoothingOptions,
45
- StimulusKernelOptions,
46
- TimingSource,
47
- WindowedRoiResponse,
48
- add_manual_roi_match_group,
49
- analyze_recording_responses,
50
- append_manual_roi_match_rows,
51
- apply_motion_artifact_mask_to_delta_f_over_f,
52
- compute_recording_response_maps,
53
- compute_recording_responses,
54
- compute_roi_delta_f_over_f,
55
- default_baseline_epoch_number,
56
- default_kernel_stimulus_column,
57
- default_recording_baseline_epoch_number,
58
- extract_background_corrected_roi_traces,
59
- finite_mean_and_sem,
60
- fit_recording_stimulus_kernels,
61
- fit_stimulus_kernel,
62
- group_delta_f_over_f_by_epoch,
63
- is_baseline_epoch_name,
64
- load_analysis_outputs,
65
- load_manual_fov_group_rows,
66
- load_manual_roi_match_rows,
67
- load_response_map_data,
68
- make_frame_windows,
69
- make_manual_fov_group_rows,
70
- make_manual_roi_match_rows,
71
- matched_manual_roi_groups,
72
- next_group_cell_id,
73
- no_baseline_epoch_frame_windows,
74
- remove_manual_roi_match_group,
75
- replace_manual_roi_match_group,
76
- resolve_baseline_frame_windows,
77
- resolve_recording_timing,
78
- save_analysis_outputs,
79
- save_manual_fov_group_rows,
80
- save_manual_roi_match_rows,
81
- save_response_map_data,
82
- select_baseline_frame_windows,
83
- split_traces_by_frame_windows,
84
- summarize_epoch_roi_responses,
85
- summarize_grouped_responses,
86
- validate_grouped_roi_responses,
87
- write_response_summary_grouped_csv,
88
- write_response_summary_trials_csv,
89
- )
90
- from twopy.api import find_recordings
91
- from twopy.conversion import convert_recording_to_twopy, load_source_conversion_inputs
92
- from twopy.converted import (
93
- load_converted_recording,
94
- recording_frame_rate_hz,
95
- recording_hemisphere,
96
- )
97
- from twopy.photodiode_classification import (
98
- ClassifiedPhotodiodeEvent,
99
- ClassifiedStimulusTiming,
100
- ClassifiedStimulusWindow,
101
- PhotodiodeDurationClass,
102
- PhotodiodeEventType,
103
- classify_recording_photodiode_events,
104
- )
105
- from twopy.pixel_calibration import (
106
- DEFAULT_PIXEL_CALIBRATION_PATH,
107
- PixelCalibrationResolution,
108
- PixelCalibrationResolutionMethod,
109
- PixelCalibrationRow,
110
- load_pixel_calibrations,
111
- resolve_pixel_size_um,
112
- )
113
- from twopy.pixel_calibration_profiles import (
114
- DEFAULT_PIXEL_CALIBRATION_PROFILE_PATH,
115
- PixelCalibrationGroup,
116
- PixelCalibrationProfile,
117
- PixelCalibrationProfileMapping,
118
- PixelCalibrationProfileSource,
119
- load_pixel_calibration_profile_mappings,
120
- resolve_pixel_calibration_profile,
121
- select_pixel_calibration_group,
122
- )
123
- from twopy.response_roi_extraction import (
124
- ResponseNormalization,
125
- ResponsePolarity,
126
- ResponseStatistic,
127
- ResponseWatershedExtraction,
128
- ResponseWatershedScoreImages,
129
- extract_response_watershed_rois,
130
- response_watershed_roi_set,
131
- )
132
- from twopy.roi import (
133
- RoiSet,
134
- RoiTraces,
135
- extract_roi_traces,
136
- load_roi_set,
137
- make_roi_set,
138
- make_roi_set_from_label_image,
139
- roi_set_to_label_image,
140
- save_roi_set,
141
- )
142
- from twopy.roi_extraction import (
143
- RoiExtractionConfig,
144
- RoiExtractionMethod,
145
- extract_rois_from_image,
146
- grid_roi_set,
147
- grid_roi_set_microns,
148
- grid_size_pixels_from_microns,
149
- watershed_roi_set,
150
- )
151
- from twopy.spatial import SpatialCrop, SpatialDomain, full_frame_crop
152
- from twopy.stimulus import (
153
- StimulusSpecificColumnMapping,
154
- map_stimulus_specific_column,
155
- stimulus_epoch_names_by_number,
156
- )
157
- from twopy.synchronization import (
158
- AlignedPhotodiodeEvent,
159
- PhotodiodeAlignment,
160
- PhotodiodeEvent,
161
- PhotodiodeEventSet,
162
- detect_photodiode_events,
163
- detect_recording_photodiode_events,
164
- pair_photodiode_events_to_imaging_frames,
165
- )
8
+ from importlib import import_module
166
9
 
167
- __all__ = [
168
- "__version__",
169
- "AlignedPhotodiodeEvent",
170
- "AnalysisResponseRun",
171
- "AnalysisResponseComputation",
172
- "add_manual_roi_match_group",
173
- "analyze_recording_responses",
174
- "append_manual_roi_match_rows",
175
- "apply_motion_artifact_mask_to_delta_f_over_f",
176
- "BackgroundCorrectedRoiTraces",
177
- "BackgroundCorrectionMethod",
178
- "ClassifiedPhotodiodeEvent",
179
- "ClassifiedStimulusTiming",
180
- "ClassifiedStimulusWindow",
181
- "classify_recording_photodiode_events",
182
- "compute_roi_delta_f_over_f",
183
- "compute_recording_response_maps",
184
- "compute_recording_responses",
185
- "CorrelationFilterOptions",
186
- "convert_recording_to_twopy",
187
- "DEFAULT_RESPONSE_POST_WINDOW_SECONDS",
188
- "DEFAULT_RESPONSE_PRE_WINDOW_SECONDS",
189
- "DEFAULT_PIXEL_CALIBRATION_PATH",
190
- "DEFAULT_PIXEL_CALIBRATION_PROFILE_PATH",
191
- "default_baseline_epoch_number",
192
- "default_kernel_stimulus_column",
193
- "default_recording_baseline_epoch_number",
194
- "detect_photodiode_events",
195
- "detect_recording_photodiode_events",
196
- "DeltaFOverFBaselineMode",
197
- "DeltaFOverFFitMode",
198
- "DeltaFOverFOptions",
199
- "EpochResponseMap",
200
- "EpochFrameWindow",
201
- "extract_background_corrected_roi_traces",
202
- "extract_response_watershed_rois",
203
- "extract_rois_from_image",
204
- "extract_roi_traces",
205
- "find_recordings",
206
- "fit_recording_stimulus_kernels",
207
- "fit_stimulus_kernel",
208
- "FrameWindow",
209
- "full_frame_crop",
210
- "group_delta_f_over_f_by_epoch",
211
- "GroupedRoiResponseSummary",
212
- "GroupedRoiResponses",
213
- "Hemisphere",
214
- "grid_roi_set",
215
- "grid_roi_set_microns",
216
- "grid_size_pixels_from_microns",
217
- "is_baseline_epoch_name",
218
- "KernelFitMethod",
219
- "KernelStimulusModality",
220
- "load_analysis_outputs",
221
- "load_response_map_data",
222
- "load_manual_fov_group_rows",
223
- "load_manual_roi_match_rows",
224
- "load_converted_recording",
225
- "load_pixel_calibrations",
226
- "load_pixel_calibration_profile_mappings",
227
- "load_roi_set",
228
- "load_source_conversion_inputs",
229
- "LoadedAnalysisOutputs",
230
- "LowPassFilterOptions",
231
- "ManualFovGroupRow",
232
- "ManualRoiMatchGroup",
233
- "ManualRoiMatchRow",
234
- "ManualRoiMatchStatus",
235
- "matched_manual_roi_groups",
236
- "make_roi_set_from_label_image",
237
- "make_frame_windows",
238
- "make_manual_fov_group_rows",
239
- "make_manual_roi_match_rows",
240
- "make_roi_set",
241
- "next_group_cell_id",
242
- "no_baseline_epoch_frame_windows",
243
- "remove_manual_roi_match_group",
244
- "replace_manual_roi_match_group",
245
- "map_stimulus_specific_column",
246
- "pair_photodiode_events_to_imaging_frames",
247
- "PhotodiodeAlignment",
248
- "PhotodiodeDurationClass",
249
- "PhotodiodeEvent",
250
- "PhotodiodeEventType",
251
- "PhotodiodeEventSet",
252
- "PixelCalibrationResolution",
253
- "PixelCalibrationResolutionMethod",
254
- "PixelCalibrationGroup",
255
- "PixelCalibrationProfile",
256
- "PixelCalibrationProfileMapping",
257
- "PixelCalibrationProfileSource",
258
- "PixelCalibrationRow",
259
- "ResponseNormalization",
260
- "ResponsePolarity",
261
- "ResponseMapData",
262
- "ResponseMapMode",
263
- "ResponseMapOptions",
264
- "ResponseProcessingOptions",
265
- "ResponseStatistic",
266
- "ResponseWatershedExtraction",
267
- "ResponseWatershedScoreImages",
268
- "RecordingKernelFit",
269
- "RecordingTiming",
270
- "recording_frame_rate_hz",
271
- "recording_hemisphere",
272
- "resolve_pixel_size_um",
273
- "resolve_pixel_calibration_profile",
274
- "resolve_baseline_frame_windows",
275
- "resolve_recording_timing",
276
- "response_watershed_roi_set",
277
- "RoiExtractionConfig",
278
- "RoiExtractionMethod",
279
- "RoiDeltaFOverF",
280
- "RoiCorrelationScores",
281
- "RoiResponseSummary",
282
- "RoiResponseTrial",
283
- "RoiSet",
284
- "RoiTraces",
285
- "roi_set_to_label_image",
286
- "save_analysis_outputs",
287
- "save_response_map_data",
288
- "save_manual_fov_group_rows",
289
- "save_manual_roi_match_rows",
290
- "save_roi_set",
291
- "select_baseline_frame_windows",
292
- "select_pixel_calibration_group",
293
- "split_traces_by_frame_windows",
294
- "SmoothingOptions",
295
- "SpatialCrop",
296
- "SpatialDomain",
297
- "StimulusKernelOptions",
298
- "StimulusSpecificColumnMapping",
299
- "stimulus_epoch_names_by_number",
300
- "finite_mean_and_sem",
301
- "summarize_epoch_roi_responses",
302
- "summarize_grouped_responses",
303
- "TimingSource",
304
- "validate_grouped_roi_responses",
305
- "watershed_roi_set",
306
- "WindowedRoiResponse",
307
- "write_response_summary_grouped_csv",
308
- "write_response_summary_trials_csv",
309
- ]
10
+ _LAZY_EXPORTS = {
11
+ "__version__": ("twopy._version", "__version__"),
12
+ "DEFAULT_RESPONSE_POST_WINDOW_SECONDS": (
13
+ "twopy.analysis",
14
+ "DEFAULT_RESPONSE_POST_WINDOW_SECONDS",
15
+ ),
16
+ "DEFAULT_RESPONSE_PRE_WINDOW_SECONDS": (
17
+ "twopy.analysis",
18
+ "DEFAULT_RESPONSE_PRE_WINDOW_SECONDS",
19
+ ),
20
+ "AnalysisResponseComputation": ("twopy.analysis", "AnalysisResponseComputation"),
21
+ "AnalysisResponseRun": ("twopy.analysis", "AnalysisResponseRun"),
22
+ "BackgroundCorrectedRoiTraces": ("twopy.analysis", "BackgroundCorrectedRoiTraces"),
23
+ "BackgroundCorrectionMethod": ("twopy.analysis", "BackgroundCorrectionMethod"),
24
+ "CorrelationFilterOptions": ("twopy.analysis", "CorrelationFilterOptions"),
25
+ "DeltaFOverFBaselineMode": ("twopy.analysis", "DeltaFOverFBaselineMode"),
26
+ "DeltaFOverFFitMode": ("twopy.analysis", "DeltaFOverFFitMode"),
27
+ "DeltaFOverFOptions": ("twopy.analysis", "DeltaFOverFOptions"),
28
+ "EpochFrameWindow": ("twopy.analysis", "EpochFrameWindow"),
29
+ "EpochResponseMap": ("twopy.analysis", "EpochResponseMap"),
30
+ "FrameWindow": ("twopy.analysis", "FrameWindow"),
31
+ "GroupedRoiResponses": ("twopy.analysis", "GroupedRoiResponses"),
32
+ "GroupedRoiResponseSummary": ("twopy.analysis", "GroupedRoiResponseSummary"),
33
+ "Hemisphere": ("twopy.analysis", "Hemisphere"),
34
+ "KernelFitMethod": ("twopy.analysis", "KernelFitMethod"),
35
+ "KernelStimulusModality": ("twopy.analysis", "KernelStimulusModality"),
36
+ "LoadedAnalysisOutputs": ("twopy.analysis", "LoadedAnalysisOutputs"),
37
+ "LowPassFilterOptions": ("twopy.analysis", "LowPassFilterOptions"),
38
+ "ManualFovGroupRow": ("twopy.analysis", "ManualFovGroupRow"),
39
+ "ManualRoiMatchGroup": ("twopy.analysis", "ManualRoiMatchGroup"),
40
+ "ManualRoiMatchRow": ("twopy.analysis", "ManualRoiMatchRow"),
41
+ "ManualRoiMatchStatus": ("twopy.analysis", "ManualRoiMatchStatus"),
42
+ "RecordingKernelFit": ("twopy.analysis", "RecordingKernelFit"),
43
+ "RecordingTiming": ("twopy.analysis", "RecordingTiming"),
44
+ "ResponseMapData": ("twopy.analysis", "ResponseMapData"),
45
+ "ResponseMapMode": ("twopy.analysis", "ResponseMapMode"),
46
+ "ResponseMapOptions": ("twopy.analysis", "ResponseMapOptions"),
47
+ "ResponseProcessingOptions": ("twopy.analysis", "ResponseProcessingOptions"),
48
+ "RoiCorrelationScores": ("twopy.analysis", "RoiCorrelationScores"),
49
+ "RoiDeltaFOverF": ("twopy.analysis", "RoiDeltaFOverF"),
50
+ "RoiResponseSummary": ("twopy.analysis", "RoiResponseSummary"),
51
+ "RoiResponseTrial": ("twopy.analysis", "RoiResponseTrial"),
52
+ "SmoothingOptions": ("twopy.analysis", "SmoothingOptions"),
53
+ "StimulusKernelOptions": ("twopy.analysis", "StimulusKernelOptions"),
54
+ "TimingSource": ("twopy.analysis", "TimingSource"),
55
+ "WindowedRoiResponse": ("twopy.analysis", "WindowedRoiResponse"),
56
+ "add_manual_roi_match_group": ("twopy.analysis", "add_manual_roi_match_group"),
57
+ "analyze_recording_responses": ("twopy.analysis", "analyze_recording_responses"),
58
+ "append_manual_roi_match_rows": ("twopy.analysis", "append_manual_roi_match_rows"),
59
+ "apply_motion_artifact_mask_to_delta_f_over_f": (
60
+ "twopy.analysis",
61
+ "apply_motion_artifact_mask_to_delta_f_over_f",
62
+ ),
63
+ "compute_recording_response_maps": (
64
+ "twopy.analysis",
65
+ "compute_recording_response_maps",
66
+ ),
67
+ "compute_recording_responses": ("twopy.analysis", "compute_recording_responses"),
68
+ "compute_roi_delta_f_over_f": ("twopy.analysis", "compute_roi_delta_f_over_f"),
69
+ "default_baseline_epoch_number": (
70
+ "twopy.analysis",
71
+ "default_baseline_epoch_number",
72
+ ),
73
+ "default_kernel_stimulus_column": (
74
+ "twopy.analysis",
75
+ "default_kernel_stimulus_column",
76
+ ),
77
+ "default_recording_baseline_epoch_number": (
78
+ "twopy.analysis",
79
+ "default_recording_baseline_epoch_number",
80
+ ),
81
+ "extract_background_corrected_roi_traces": (
82
+ "twopy.analysis",
83
+ "extract_background_corrected_roi_traces",
84
+ ),
85
+ "finite_mean_and_sem": ("twopy.analysis", "finite_mean_and_sem"),
86
+ "fit_recording_stimulus_kernels": (
87
+ "twopy.analysis",
88
+ "fit_recording_stimulus_kernels",
89
+ ),
90
+ "fit_stimulus_kernel": ("twopy.analysis", "fit_stimulus_kernel"),
91
+ "group_delta_f_over_f_by_epoch": (
92
+ "twopy.analysis",
93
+ "group_delta_f_over_f_by_epoch",
94
+ ),
95
+ "is_baseline_epoch_name": ("twopy.analysis", "is_baseline_epoch_name"),
96
+ "load_analysis_outputs": ("twopy.analysis", "load_analysis_outputs"),
97
+ "load_manual_fov_group_rows": ("twopy.analysis", "load_manual_fov_group_rows"),
98
+ "load_manual_roi_match_rows": ("twopy.analysis", "load_manual_roi_match_rows"),
99
+ "load_response_map_data": ("twopy.analysis", "load_response_map_data"),
100
+ "make_frame_windows": ("twopy.analysis", "make_frame_windows"),
101
+ "make_manual_fov_group_rows": ("twopy.analysis", "make_manual_fov_group_rows"),
102
+ "make_manual_roi_match_rows": ("twopy.analysis", "make_manual_roi_match_rows"),
103
+ "matched_manual_roi_groups": ("twopy.analysis", "matched_manual_roi_groups"),
104
+ "next_group_cell_id": ("twopy.analysis", "next_group_cell_id"),
105
+ "no_baseline_epoch_frame_windows": (
106
+ "twopy.analysis",
107
+ "no_baseline_epoch_frame_windows",
108
+ ),
109
+ "remove_manual_roi_match_group": (
110
+ "twopy.analysis",
111
+ "remove_manual_roi_match_group",
112
+ ),
113
+ "replace_manual_roi_match_group": (
114
+ "twopy.analysis",
115
+ "replace_manual_roi_match_group",
116
+ ),
117
+ "resolve_baseline_frame_windows": (
118
+ "twopy.analysis",
119
+ "resolve_baseline_frame_windows",
120
+ ),
121
+ "resolve_recording_timing": ("twopy.analysis", "resolve_recording_timing"),
122
+ "save_analysis_outputs": ("twopy.analysis", "save_analysis_outputs"),
123
+ "save_manual_fov_group_rows": ("twopy.analysis", "save_manual_fov_group_rows"),
124
+ "save_manual_roi_match_rows": ("twopy.analysis", "save_manual_roi_match_rows"),
125
+ "save_response_map_data": ("twopy.analysis", "save_response_map_data"),
126
+ "select_baseline_frame_windows": (
127
+ "twopy.analysis",
128
+ "select_baseline_frame_windows",
129
+ ),
130
+ "split_traces_by_frame_windows": (
131
+ "twopy.analysis",
132
+ "split_traces_by_frame_windows",
133
+ ),
134
+ "summarize_epoch_roi_responses": (
135
+ "twopy.analysis",
136
+ "summarize_epoch_roi_responses",
137
+ ),
138
+ "summarize_grouped_responses": ("twopy.analysis", "summarize_grouped_responses"),
139
+ "validate_grouped_roi_responses": (
140
+ "twopy.analysis",
141
+ "validate_grouped_roi_responses",
142
+ ),
143
+ "write_response_summary_grouped_csv": (
144
+ "twopy.analysis",
145
+ "write_response_summary_grouped_csv",
146
+ ),
147
+ "write_response_summary_trials_csv": (
148
+ "twopy.analysis",
149
+ "write_response_summary_trials_csv",
150
+ ),
151
+ "find_recordings": ("twopy.api", "find_recordings"),
152
+ "convert_recording_to_twopy": ("twopy.conversion", "convert_recording_to_twopy"),
153
+ "load_source_conversion_inputs": (
154
+ "twopy.conversion",
155
+ "load_source_conversion_inputs",
156
+ ),
157
+ "load_converted_recording": ("twopy.converted", "load_converted_recording"),
158
+ "recording_frame_rate_hz": ("twopy.converted", "recording_frame_rate_hz"),
159
+ "recording_hemisphere": ("twopy.converted", "recording_hemisphere"),
160
+ "ClassifiedPhotodiodeEvent": (
161
+ "twopy.photodiode_classification",
162
+ "ClassifiedPhotodiodeEvent",
163
+ ),
164
+ "ClassifiedStimulusTiming": (
165
+ "twopy.photodiode_classification",
166
+ "ClassifiedStimulusTiming",
167
+ ),
168
+ "ClassifiedStimulusWindow": (
169
+ "twopy.photodiode_classification",
170
+ "ClassifiedStimulusWindow",
171
+ ),
172
+ "PhotodiodeDurationClass": (
173
+ "twopy.photodiode_classification",
174
+ "PhotodiodeDurationClass",
175
+ ),
176
+ "PhotodiodeEventType": ("twopy.photodiode_classification", "PhotodiodeEventType"),
177
+ "classify_recording_photodiode_events": (
178
+ "twopy.photodiode_classification",
179
+ "classify_recording_photodiode_events",
180
+ ),
181
+ "DEFAULT_PIXEL_CALIBRATION_PATH": (
182
+ "twopy.pixel_calibration",
183
+ "DEFAULT_PIXEL_CALIBRATION_PATH",
184
+ ),
185
+ "PixelCalibrationResolution": (
186
+ "twopy.pixel_calibration",
187
+ "PixelCalibrationResolution",
188
+ ),
189
+ "PixelCalibrationResolutionMethod": (
190
+ "twopy.pixel_calibration",
191
+ "PixelCalibrationResolutionMethod",
192
+ ),
193
+ "PixelCalibrationRow": ("twopy.pixel_calibration", "PixelCalibrationRow"),
194
+ "load_pixel_calibrations": ("twopy.pixel_calibration", "load_pixel_calibrations"),
195
+ "resolve_pixel_size_um": ("twopy.pixel_calibration", "resolve_pixel_size_um"),
196
+ "DEFAULT_PIXEL_CALIBRATION_PROFILE_PATH": (
197
+ "twopy.pixel_calibration_profiles",
198
+ "DEFAULT_PIXEL_CALIBRATION_PROFILE_PATH",
199
+ ),
200
+ "PixelCalibrationGroup": (
201
+ "twopy.pixel_calibration_profiles",
202
+ "PixelCalibrationGroup",
203
+ ),
204
+ "PixelCalibrationProfile": (
205
+ "twopy.pixel_calibration_profiles",
206
+ "PixelCalibrationProfile",
207
+ ),
208
+ "PixelCalibrationProfileMapping": (
209
+ "twopy.pixel_calibration_profiles",
210
+ "PixelCalibrationProfileMapping",
211
+ ),
212
+ "PixelCalibrationProfileSource": (
213
+ "twopy.pixel_calibration_profiles",
214
+ "PixelCalibrationProfileSource",
215
+ ),
216
+ "load_pixel_calibration_profile_mappings": (
217
+ "twopy.pixel_calibration_profiles",
218
+ "load_pixel_calibration_profile_mappings",
219
+ ),
220
+ "resolve_pixel_calibration_profile": (
221
+ "twopy.pixel_calibration_profiles",
222
+ "resolve_pixel_calibration_profile",
223
+ ),
224
+ "select_pixel_calibration_group": (
225
+ "twopy.pixel_calibration_profiles",
226
+ "select_pixel_calibration_group",
227
+ ),
228
+ "ResponseNormalization": ("twopy.response_roi_extraction", "ResponseNormalization"),
229
+ "ResponsePolarity": ("twopy.response_roi_extraction", "ResponsePolarity"),
230
+ "ResponseStatistic": ("twopy.response_roi_extraction", "ResponseStatistic"),
231
+ "ResponseWatershedExtraction": (
232
+ "twopy.response_roi_extraction",
233
+ "ResponseWatershedExtraction",
234
+ ),
235
+ "ResponseWatershedScoreImages": (
236
+ "twopy.response_roi_extraction",
237
+ "ResponseWatershedScoreImages",
238
+ ),
239
+ "extract_response_watershed_rois": (
240
+ "twopy.response_roi_extraction",
241
+ "extract_response_watershed_rois",
242
+ ),
243
+ "response_watershed_roi_set": (
244
+ "twopy.response_roi_extraction",
245
+ "response_watershed_roi_set",
246
+ ),
247
+ "RoiSet": ("twopy.roi", "RoiSet"),
248
+ "RoiTraces": ("twopy.roi", "RoiTraces"),
249
+ "extract_roi_traces": ("twopy.roi", "extract_roi_traces"),
250
+ "load_roi_set": ("twopy.roi", "load_roi_set"),
251
+ "make_roi_set": ("twopy.roi", "make_roi_set"),
252
+ "make_roi_set_from_label_image": ("twopy.roi", "make_roi_set_from_label_image"),
253
+ "roi_set_to_label_image": ("twopy.roi", "roi_set_to_label_image"),
254
+ "save_roi_set": ("twopy.roi", "save_roi_set"),
255
+ "RoiExtractionConfig": ("twopy.roi_extraction", "RoiExtractionConfig"),
256
+ "RoiExtractionMethod": ("twopy.roi_extraction", "RoiExtractionMethod"),
257
+ "extract_rois_from_image": ("twopy.roi_extraction", "extract_rois_from_image"),
258
+ "grid_roi_set": ("twopy.roi_extraction", "grid_roi_set"),
259
+ "grid_roi_set_microns": ("twopy.roi_extraction", "grid_roi_set_microns"),
260
+ "grid_size_pixels_from_microns": (
261
+ "twopy.roi_extraction",
262
+ "grid_size_pixels_from_microns",
263
+ ),
264
+ "watershed_roi_set": ("twopy.roi_extraction", "watershed_roi_set"),
265
+ "SpatialCrop": ("twopy.spatial", "SpatialCrop"),
266
+ "SpatialDomain": ("twopy.spatial", "SpatialDomain"),
267
+ "full_frame_crop": ("twopy.spatial", "full_frame_crop"),
268
+ "StimulusSpecificColumnMapping": (
269
+ "twopy.stimulus",
270
+ "StimulusSpecificColumnMapping",
271
+ ),
272
+ "map_stimulus_specific_column": ("twopy.stimulus", "map_stimulus_specific_column"),
273
+ "stimulus_epoch_names_by_number": (
274
+ "twopy.stimulus",
275
+ "stimulus_epoch_names_by_number",
276
+ ),
277
+ "AlignedPhotodiodeEvent": ("twopy.synchronization", "AlignedPhotodiodeEvent"),
278
+ "PhotodiodeAlignment": ("twopy.synchronization", "PhotodiodeAlignment"),
279
+ "PhotodiodeEvent": ("twopy.synchronization", "PhotodiodeEvent"),
280
+ "PhotodiodeEventSet": ("twopy.synchronization", "PhotodiodeEventSet"),
281
+ "detect_photodiode_events": ("twopy.synchronization", "detect_photodiode_events"),
282
+ "detect_recording_photodiode_events": (
283
+ "twopy.synchronization",
284
+ "detect_recording_photodiode_events",
285
+ ),
286
+ "pair_photodiode_events_to_imaging_frames": (
287
+ "twopy.synchronization",
288
+ "pair_photodiode_events_to_imaging_frames",
289
+ ),
290
+ }
291
+
292
+ __all__ = list(_LAZY_EXPORTS)
293
+
294
+
295
+ def __getattr__(name: str) -> object:
296
+ """Load public API names only when callers ask for them.
297
+
298
+ Args:
299
+ name: Public attribute requested from ``twopy``.
300
+
301
+ Returns:
302
+ The exported object from its owning module.
303
+
304
+ The napari launcher imports this package before it can import
305
+ ``twopy.napari``. Delaying the scientific API imports keeps application
306
+ startup from paying for SciPy and HDF5 modules before the GUI needs them.
307
+ """
308
+ try:
309
+ module_name, attribute_name = _LAZY_EXPORTS[name]
310
+ except KeyError as error:
311
+ msg = f"module {__name__!r} has no attribute {name!r}"
312
+ raise AttributeError(msg) from error
313
+ module = import_module(module_name)
314
+ value = getattr(module, attribute_name)
315
+ globals()[name] = value
316
+ return value
317
+
318
+
319
+ def __dir__() -> list[str]:
320
+ """Return module attributes plus lazy public API names.
321
+
322
+ Args:
323
+ None.
324
+
325
+ Returns:
326
+ Sorted module names for notebooks, shells, and documentation tools.
327
+ """
328
+ return sorted(set(globals()) | set(__all__))