@@ -403,8 +403,8 @@ def run_unet_prediction(
403403
404404def run_unet_prediction_preprocess_slurm (
405405 input_path : str ,
406- input_key : Optional [str ],
407406 output_folder : str ,
407+ input_key : Optional [str ] = None ,
408408 s3 : Optional [str ] = None ,
409409 s3_bucket_name : Optional [str ] = None ,
410410 s3_service_endpoint : Optional [str ] = None ,
@@ -417,8 +417,8 @@ def run_unet_prediction_preprocess_slurm(
417417
418418 Args:
419419 input_path: The path to the input data.
420- input_key: The key / internal path of the image data.
421420 output_folder: The output folder for storing the segmentation related data.
421+ input_key: The key / internal path of the image data.
422422 s3: Flag for considering input_path fo S3 bucket.
423423 s3_bucket_name: S3 bucket name.
424424 s3_service_endpoint: S3 service endpoint.
@@ -437,9 +437,9 @@ def run_unet_prediction_preprocess_slurm(
437437
438438def run_unet_prediction_slurm (
439439 input_path : str ,
440- input_key : Optional [str ],
441440 output_folder : str ,
442441 model_path : str ,
442+ input_key : Optional [str ] = None ,
443443 scale : Optional [float ] = None ,
444444 block_shape : Optional [Tuple [int , int , int ]] = None ,
445445 halo : Optional [Tuple [int , int , int ]] = None ,
@@ -453,9 +453,9 @@ def run_unet_prediction_slurm(
453453
454454 Args:
455455 input_path: The path to the input data.
456- input_key: The key / internal path of the image data.
457456 output_folder: The output folder for storing the segmentation related data.
458457 model_path: The path to the model to use for segmentation.
458+ input_key: The key / internal path of the image data.
459459 scale: A factor to rescale the data before prediction.
460460 By default the data will not be rescaled.
461461 block_shape: The block-shape for running the prediction.
@@ -501,7 +501,11 @@ def run_unet_prediction_slurm(
501501
502502
503503# does NOT need GPU, FIXME: only run on CPU
504- def run_unet_segmentation_slurm (output_folder : str , min_size : int ) -> None :
504+ def run_unet_segmentation_slurm (
505+ output_folder : str ,
506+ min_size : int ,
507+ boundary_distance_threshold : float = 0.5 ,
508+ ) -> None :
505509 """Create segmentation from prediction.
506510
507511 Args:
@@ -510,4 +514,5 @@ def run_unet_segmentation_slurm(output_folder: str, min_size: int) -> None:
510514 """
511515 min_size = int (min_size )
512516 pmap_out = os .path .join (output_folder , "predictions.zarr" )
513- distance_watershed_implementation (pmap_out , output_folder , min_size = min_size )
517+ distance_watershed_implementation (pmap_out , output_folder , boundary_distance_threshold = boundary_distance_threshold ,
518+ min_size = min_size )
0 commit comments