Skip to content

Commit bbae516

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 0413df2 commit bbae516

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

generation/maisi/scripts/compute_fid2p5d.py

+13-9
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
# to remove external dependency.
101101
# ------------------------------------------------------------------------------
102102

103+
103104
def drop_empty_slice(slices, empty_threshold: float):
104105
"""
105106
Decide which 2D slices to keep by checking if their maximum intensity
@@ -330,6 +331,7 @@ def get_features_2p5d(
330331

331332
return feature_image_xy, feature_image_yz, feature_image_zx
332333

334+
333335
# ------------------------------------------------------------------------------
334336
# End inline fid_utils code
335337
# ------------------------------------------------------------------------------
@@ -503,17 +505,15 @@ def main(
503505
]
504506

505507
if enable_resampling:
506-
transform_list.append(
507-
monai.transforms.Spacingd(keys=["image"], pixdim=rs_spacing_tuple, mode=["bilinear"])
508-
)
508+
transform_list.append(monai.transforms.Spacingd(keys=["image"], pixdim=rs_spacing_tuple, mode=["bilinear"]))
509509
if enable_padding:
510510
transform_list.append(
511-
monai.transforms.SpatialPadd(keys=["image"], spatial_size=target_shape_tuple, mode=["constant"], value=-1000)
511+
monai.transforms.SpatialPadd(
512+
keys=["image"], spatial_size=target_shape_tuple, mode=["constant"], value=-1000
513+
)
512514
)
513515
if enable_center_cropping:
514-
transform_list.append(
515-
monai.transforms.CenterSpatialCropd(keys=["image"], roi_size=target_shape_tuple)
516-
)
516+
transform_list.append(monai.transforms.CenterSpatialCropd(keys=["image"], roi_size=target_shape_tuple))
517517

518518
# Intensity scaling to clamp between [-1000, 1000]
519519
transform_list.append(
@@ -617,8 +617,12 @@ def main(
617617
# All-reduce / gather features across ranks
618618
# -------------------------------------------------------------------------
619619
features = [
620-
real_features_xy, real_features_yz, real_features_zx,
621-
synth_features_xy, synth_features_yz, synth_features_zx
620+
real_features_xy,
621+
real_features_yz,
622+
real_features_zx,
623+
synth_features_xy,
624+
synth_features_yz,
625+
synth_features_zx,
622626
]
623627

624628
# 1) Gather local feature sizes across ranks

0 commit comments

Comments
 (0)