Mercurial > repos > iuc > imagej2_noise
comparison jython_script.py @ 3:d99cf938ad41 draft
planemo upload commit 18df9e67efd4adafcde4eb9b62cd815e4afe9733-dirty
| author | iuc |
|---|---|
| date | Wed, 26 Aug 2015 14:37:34 -0400 |
| parents | c8fc3f34cbff |
| children |
comparison
equal
deleted
inserted
replaced
| 2:c8fc3f34cbff | 3:d99cf938ad41 |
|---|---|
| 31 # Open the input image file. | 31 # Open the input image file. |
| 32 image_plus = IJ.openImage( input ) | 32 image_plus = IJ.openImage( input ) |
| 33 bit_depth = image_plus.getBitDepth() | 33 bit_depth = image_plus.getBitDepth() |
| 34 image_type = image_plus.getType() | 34 image_type = image_plus.getType() |
| 35 # Create an ImagePlus object for the image. | 35 # Create an ImagePlus object for the image. |
| 36 image_plus_copy = image_plus.createImagePlus() | 36 image_plus_copy = image_plus.duplicate() |
| 37 # Make a copy of the image. | 37 # Make a copy of the image. |
| 38 image_processor_copy = image_plus.getProcessor().duplicate() | 38 image_processor_copy = image_plus_copy.getProcessor() |
| 39 # Set the ImageProcessor on the duplicate ImagePlus object. | |
| 40 image_plus_copy.setProcessor( "image copy", image_processor_copy ) | |
| 41 | 39 |
| 42 # Perform the analysis on the ImagePlus object. | 40 # Perform the analysis on the ImagePlus object. |
| 43 if noise == 'add_noise': | 41 if noise == 'add_noise': |
| 44 IJ.run( image_plus_copy, "Add Noise", "" ) | 42 IJ.run( image_plus_copy, "Add Noise", "" ) |
| 45 elif noise == 'add_specified_noise': | 43 elif noise == 'add_specified_noise': |
