@@ -14,9 +14,9 @@ def main():
1414 parser = argparse .ArgumentParser (
1515 description = "Script to postprocess IHC segmentation based on the number of synapses per IHC." )
1616
17- parser .add_argument ('--base_path' , type = str , required = True , help = "Base segmentation." )
17+ parser .add_argument ('--base_path' , type = str , required = True , help = "Base segmentation. WARNING: Will be edited. " )
1818 parser .add_argument ('--ref_path' , type = str , required = True , help = "Reference segmentation." )
19- parser .add_argument ('--out_path ' , type = str , required = True , help = "Output segmentation." )
19+ parser .add_argument ('--out_path_tif ' , type = str , default = None , help = "Output segmentation for tif output ." )
2020
2121 parser .add_argument ('--base_table' , type = str , required = True , help = "Synapse per IHC table of base segmentation." )
2222
@@ -42,6 +42,10 @@ def main():
4242
4343 args = parser .parse_args ()
4444
45+ if args .tif :
46+ if args .out_path_tif is None :
47+ raise ValueError ("Specify out_path_tif for saving TIF file." )
48+
4549 if args .base_key is None :
4650 data_base = read_image_data (args .base_path , args .base_key )
4751 else :
@@ -54,12 +58,12 @@ def main():
5458 if args .crop :
5559 output_ = ihc_synapse_postprocessing .postprocess_ihc_synapse_crop (
5660 data_base , data_ref , table_base = table_base , synapse_limit = 25 , min_overlap = 0.5 ,
57- )
61+ )
5862 else :
5963 output_ = ihc_synapse_postprocessing .postprocess_ihc_synapse (
6064 data_base , data_ref , table_base = table_base , synapse_limit = 25 , min_overlap = 0.5 ,
6165 resolution = 0.38 , roi_pad = 40 ,
62- )
66+ )
6367
6468 if args .tif :
6569 imageio .imwrite (args .out_path , output_ , compression = "zlib" )
0 commit comments