pdnl-process 0.2__tar.gz → 0.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pdnl_process
3
- Version: 0.2
3
+ Version: 0.3
4
4
  Summary: PDNL Process
5
5
  Project-URL: Homepage, https://github.com/PennCompPathology/pdnl_process
6
6
  Author-email: Noah Capp <noahmcapp@gmail.com>
@@ -17,7 +17,7 @@ def main():
17
17
 
18
18
  parser = argparse.ArgumentParser()
19
19
  parser.add_argument('-i', '--input_file', help="path to image file to process", required=True)
20
- parser.add_argument('-o', '--output_file', help="path to write outputs to", required=True)
20
+ parser.add_argument('-o', '--output_path', help="path to write outputs to", required=True)
21
21
  parser.add_argument('-m', '--mask_file', help="path to mask file to apply to the image", default=None)
22
22
  parser.add_argument('-s', '--staining_code', help="stain protocol used to stain the input image", default='H-DAB')
23
23
  parser.add_argument('-p', '--parameters_file', help=".json file containing processing parameters", default=None)
@@ -36,7 +36,7 @@ def main():
36
36
 
37
37
  file_name = os.path.splitext(os.path.basename(args.input_file))[0]
38
38
  debug_level = 'full' if args.debug else 'normal'
39
- logger = pdnl_sana.logging.Logger(debug_level, os.path.splitext(args.output_file)[0]+'.pkl')
39
+ logger = pdnl_sana.logging.Logger(debug_level, os.path.join(args.output_path, 'log.pkl'))
40
40
 
41
41
  if args.staining_code == 'H-DAB':
42
42
  processor = pdnl_sana.process.HDABProcessor(
@@ -46,17 +46,20 @@ def main():
46
46
  stain_vector=params.get('stain_vector', None)
47
47
  )
48
48
 
49
- out = processor.run(
49
+ res = processor.run(
50
50
  triangular_strictness=params.get('triangular_strictness', 0.0),
51
51
  minimum_threshold=params.get('minimum_threshold', 0),
52
52
  od_threshold=params.get('od_threshold', None),
53
53
  morphology_filters=[pdnl_sana.filter.MorphologyFilter(**filter_params) for filter_params in params.get('morphology_filters', [])],
54
- )['positive_dab']
54
+ )
55
55
 
56
56
  if args.debug:
57
57
  plt.show()
58
58
 
59
- out.save(args.output_file)
59
+
60
+ res['stain'].save(os.path.join(args.output_path, 'stain.npy'))
61
+ res['positive_stain'].save(os.path.join(args.output_path, 'pos.png'))
62
+ logger.write_data()
60
63
 
61
64
  if __name__ == "__main__":
62
65
  main()
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "pdnl_process"
7
- version = "0.2"
7
+ version = "0.3"
8
8
  authors = [
9
9
  { name="Noah Capp", email="noahmcapp@gmail.com" },
10
10
  ]
File without changes
File without changes