File tree 2 files changed +14
-0
lines changed
2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,10 @@ def _xarr_reformat(self, delayed: bool) -> xr.DataArray:
80
80
delayed = delayed , squeeze = False , position = self .current_scene_index
81
81
)
82
82
xarr .attrs [constants .METADATA_UNPROCESSED ] = xarr .attrs .pop ("metadata" )
83
+ if self .current_scene_index is not None :
84
+ xarr .attrs [constants .METADATA_UNPROCESSED ][
85
+ "frame"
86
+ ] = rdr .frame_metadata (self .current_scene_index )
83
87
return xarr .isel ({nd2 .AXIS .POSITION : 0 })
84
88
85
89
@property
Original file line number Diff line number Diff line change @@ -227,3 +227,13 @@ def test_aicsimage(
227
227
expected_physical_pixel_sizes = expected_physical_pixel_sizes ,
228
228
expected_metadata_type = expected_metadata_type ,
229
229
)
230
+
231
+
232
+ def test_frame_metadata () -> None :
233
+ filename = "ND2_dims_rgb_t3p2c2z3x64y64.nd2"
234
+ uri = get_resource_full_path (filename , LOCAL )
235
+ rdr = ND2Reader (uri )
236
+ rdr .set_scene (0 )
237
+ assert isinstance (
238
+ rdr .xarray_data .attrs ["unprocessed" ]["frame" ], nd2 .structures .FrameMetadata
239
+ )
You can’t perform that action at this time.
0 commit comments