Mercurial > repos > iuc > imagej2_convert_format
comparison imagej2_convert_format.py @ 4:7a8b05b111f9 draft
planemo upload commit 18df9e67efd4adafcde4eb9b62cd815e4afe9733-dirty
| author | iuc |
|---|---|
| date | Wed, 26 Aug 2015 14:37:12 -0400 |
| parents | 14d09b0ab9e1 |
| children |
comparison
equal
deleted
inserted
replaced
| 3:9a24b7e68010 | 4:7a8b05b111f9 |
|---|---|
| 6 if __name__=="__main__": | 6 if __name__=="__main__": |
| 7 # Parse Command Line. | 7 # Parse Command Line. |
| 8 parser = argparse.ArgumentParser() | 8 parser = argparse.ArgumentParser() |
| 9 parser.add_argument( '--in_fname', dest='in_fname', help='Path to the input file' ) | 9 parser.add_argument( '--in_fname', dest='in_fname', help='Path to the input file' ) |
| 10 parser.add_argument( '--input_datatype', dest='input_datatype', help='Input image datatype' ) | 10 parser.add_argument( '--input_datatype', dest='input_datatype', help='Input image datatype' ) |
| 11 parser.add_argument( '--max_heap_size_type', dest='max_heap_size_type', help='Type (default or megabytes) of max_heap_size value' ) | |
| 12 parser.add_argument( '--max_heap_size', dest='max_heap_size', help='Maximum size of the memory allocation pool used by the JVM.' ) | |
| 13 parser.add_argument( '--output_datatype', dest='output_datatype', help='Output image datatype' ) | 11 parser.add_argument( '--output_datatype', dest='output_datatype', help='Output image datatype' ) |
| 14 parser.add_argument( '--out_fname', help='Path to the output file' ) | 12 parser.add_argument( '--out_fname', help='Path to the output file' ) |
| 15 args = parser.parse_args() | 13 args = parser.parse_args() |
| 16 # Set the size of the memory allocation pool used by the JVM. | 14 |
| 17 max_heap_size = imagej2_base_utils.get_max_heap_size_value( args.max_heap_size_type, args.max_heap_size ) | |
| 18 # Start the JVM via the Javabridge. | 15 # Start the JVM via the Javabridge. |
| 19 imagej2_utils.start_vm( args=None, class_path=None, max_heap_size=max_heap_size, run_headless=True ) | 16 imagej2_utils.start_vm( args=None, class_path=None, max_heap_size=None, run_headless=True ) |
| 20 try: | 17 try: |
| 21 tmp_dir = imagej2_base_utils.get_temp_dir() | 18 tmp_dir = imagej2_base_utils.get_temp_dir() |
| 22 in_image_path = imagej2_base_utils.get_input_image_path( tmp_dir, args.in_fname, args.input_datatype ) | 19 in_image_path = imagej2_base_utils.get_input_image_path( tmp_dir, args.in_fname, args.input_datatype ) |
| 23 # Load the input image. | 20 # Load the input image. |
| 24 image, scale = imagej2_utils.load_image( in_image_path, rescale=False, wants_max_intensity=True ) | 21 image, scale = imagej2_utils.load_image( in_image_path, rescale=False, wants_max_intensity=True ) |
