|
100 | 100 | # to remove external dependency.
|
101 | 101 | # ------------------------------------------------------------------------------
|
102 | 102 |
|
| 103 | + |
103 | 104 | def drop_empty_slice(slices, empty_threshold: float):
|
104 | 105 | """
|
105 | 106 | Decide which 2D slices to keep by checking if their maximum intensity
|
@@ -330,6 +331,7 @@ def get_features_2p5d(
|
330 | 331 |
|
331 | 332 | return feature_image_xy, feature_image_yz, feature_image_zx
|
332 | 333 |
|
| 334 | + |
333 | 335 | # ------------------------------------------------------------------------------
|
334 | 336 | # End inline fid_utils code
|
335 | 337 | # ------------------------------------------------------------------------------
|
@@ -503,17 +505,15 @@ def main(
|
503 | 505 | ]
|
504 | 506 |
|
505 | 507 | 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"])) |
509 | 509 | if enable_padding:
|
510 | 510 | 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 | + ) |
512 | 514 | )
|
513 | 515 | 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)) |
517 | 517 |
|
518 | 518 | # Intensity scaling to clamp between [-1000, 1000]
|
519 | 519 | transform_list.append(
|
@@ -617,8 +617,12 @@ def main(
|
617 | 617 | # All-reduce / gather features across ranks
|
618 | 618 | # -------------------------------------------------------------------------
|
619 | 619 | 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, |
622 | 626 | ]
|
623 | 627 |
|
624 | 628 | # 1) Gather local feature sizes across ranks
|
|
0 commit comments