@@ -330,17 +330,21 @@ def make(self, key):
330330 px_width = scan .field_widths [field_id ],
331331 um_height = scan .field_heights_in_microns [field_id ],
332332 um_width = scan .field_widths_in_microns [field_id ],
333- field_x = x_zero
334- + scan ._degrees_to_microns (scan .fields [field_id ].x )
335- if x_zero
336- else None ,
337- field_y = y_zero
338- + scan ._degrees_to_microns (scan .fields [field_id ].y )
339- if y_zero
340- else None ,
341- field_z = z_zero + scan .fields [field_id ].depth
342- if z_zero
343- else None ,
333+ field_x = (
334+ x_zero
335+ + scan ._degrees_to_microns (scan .fields [field_id ].x )
336+ if x_zero
337+ else None
338+ ),
339+ field_y = (
340+ y_zero
341+ + scan ._degrees_to_microns (scan .fields [field_id ].y )
342+ if y_zero
343+ else None
344+ ),
345+ field_z = (
346+ z_zero + scan .fields [field_id ].depth if z_zero else None
347+ ),
344348 delay_image = scan .field_offsets [field_id ],
345349 roi = scan .field_rois [field_id ][0 ],
346350 )
@@ -359,9 +363,11 @@ def make(self, key):
359363 um_width = getattr (scan , "image_width_in_microns" , None ),
360364 field_x = x_zero if x_zero else None ,
361365 field_y = y_zero if y_zero else None ,
362- field_z = z_zero + scan .scanning_depths [plane_idx ]
363- if z_zero
364- else None ,
366+ field_z = (
367+ z_zero + scan .scanning_depths [plane_idx ]
368+ if z_zero
369+ else None
370+ ),
365371 delay_image = scan .field_offsets [plane_idx ],
366372 )
367373 for plane_idx in range (scan .num_scanning_depths )
@@ -387,9 +393,11 @@ def make(self, key):
387393 self .insert1 (
388394 dict (
389395 key ,
390- nfields = sbx_meta ["num_fields" ]
391- if is_multiROI
392- else sbx_meta ["num_planes" ],
396+ nfields = (
397+ sbx_meta ["num_fields" ]
398+ if is_multiROI
399+ else sbx_meta ["num_planes" ]
400+ ),
393401 nchannels = sbx_meta ["num_channels" ],
394402 nframes = sbx_meta ["num_frames" ],
395403 ndepths = sbx_meta ["num_planes" ],
@@ -412,12 +420,16 @@ def make(self, key):
412420 field_idx = plane_idx ,
413421 px_height = px_height ,
414422 px_width = px_width ,
415- um_height = px_height * sbx_meta ["um_per_pixel_y" ]
416- if sbx_meta ["um_per_pixel_y" ]
417- else None ,
418- um_width = px_width * sbx_meta ["um_per_pixel_x" ]
419- if sbx_meta ["um_per_pixel_x" ]
420- else None ,
423+ um_height = (
424+ px_height * sbx_meta ["um_per_pixel_y" ]
425+ if sbx_meta ["um_per_pixel_y" ]
426+ else None
427+ ),
428+ um_width = (
429+ px_width * sbx_meta ["um_per_pixel_x" ]
430+ if sbx_meta ["um_per_pixel_x" ]
431+ else None
432+ ),
421433 field_x = x_zero ,
422434 field_y = y_zero ,
423435 field_z = z_zero + sbx_meta ["etl_pos" ][plane_idx ],
@@ -462,9 +474,11 @@ def estimate_nd2_scan_duration(nd2_scan_obj):
462474 scan_datetime = nd2_file .text_info ["date" ]
463475 scan_datetime = datetime .strptime (
464476 scan_datetime ,
465- "%m/%d/%Y %H:%M:%S %p"
466- if re .search (("AM|PM" ), scan_datetime )
467- else "%m/%d/%Y %H:%M:%S" ,
477+ (
478+ "%m/%d/%Y %H:%M:%S %p"
479+ if re .search (("AM|PM" ), scan_datetime )
480+ else "%m/%d/%Y %H:%M:%S"
481+ ),
468482 )
469483 scan_datetime = datetime .strftime (scan_datetime , "%Y-%m-%d %H:%M:%S" )
470484 except : # noqa: E722
@@ -551,9 +565,11 @@ def estimate_nd2_scan_duration(nd2_scan_obj):
551565 um_width = PVScan_info ["width_in_um" ],
552566 field_x = PVScan_info ["fieldX" ],
553567 field_y = PVScan_info ["fieldY" ],
554- field_z = PVScan_info ["fieldZ" ]
555- if PVScan_info ["num_planes" ] == 1
556- else PVScan_info ["fieldZ" ][plane_idx ],
568+ field_z = (
569+ PVScan_info ["fieldZ" ]
570+ if PVScan_info ["num_planes" ] == 1
571+ else PVScan_info ["fieldZ" ][plane_idx ]
572+ ),
557573 )
558574 for plane_idx in range (PVScan_info ["num_planes" ])
559575 )
0 commit comments