diff imagej2_noise_jython_script.py @ 2:0cdd96322600 draft

planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
author imgteam
date Sun, 05 Nov 2023 11:00:42 +0000
parents 7f9840d3b7e7
children bd2aadf0f589
line wrap: on
line diff
--- a/imagej2_noise_jython_script.py	Mon Sep 28 16:48:49 2020 +0000
+++ b/imagej2_noise_jython_script.py	Sun Nov 05 11:00:42 2023 +0000
@@ -35,33 +35,51 @@
 image_processor_copy = image_plus_copy.getProcessor()
 
 # Perform the analysis on the ImagePlus object.
-if noise == 'add_noise':
+if noise == "add_noise":
     IJ.run(image_plus_copy, "Add Noise", "")
-elif noise == 'add_specified_noise':
+elif noise == "add_specified_noise":
     IJ.run(image_plus_copy, "Add Specified Noise", "standard=&standard_deviation")
-elif noise == 'salt_and_pepper':
+elif noise == "salt_and_pepper":
     IJ.run(image_plus_copy, "Salt and Pepper", "")
-elif noise == 'despeckle':
+elif noise == "despeckle":
     IJ.run(image_plus_copy, "Despeckle", "")
-elif noise == 'remove_outliers':
-    IJ.run(image_plus_copy, "Remove Outliers", "radius=&radius threshold=&threshold which=&which_outliers")
-elif noise == 'remove_nans':
+elif noise == "remove_outliers":
+    IJ.run(
+        image_plus_copy,
+        "Remove Outliers",
+        "radius=&radius threshold=&threshold which=&which_outliers",
+    )
+elif noise == "remove_nans":
     IJ.run(image_plus_copy, "Remove NaNs", "")
-elif noise == 'rof_denoise':
+elif noise == "rof_denoise":
     IJ.run(image_plus_copy, "ROF Denoise", "")
-elif noise == 'randomj':
-    if randomj == 'randomj_binomial':
-        IJ.run(image_plus_copy, "RandomJ Binomial", "trials=&trials probability=&probability insertion=&insertion")
-    elif randomj == 'randomj_exponential':
-        IJ.run(image_plus_copy, "RandomJ Exponential", "lambda=&lammbda insertion=&insertion")
-    elif randomj == 'randomj_gamma':
+elif noise == "randomj":
+    if randomj == "randomj_binomial":
+        IJ.run(
+            image_plus_copy,
+            "RandomJ Binomial",
+            "trials=&trials probability=&probability insertion=&insertion",
+        )
+    elif randomj == "randomj_exponential":
+        IJ.run(
+            image_plus_copy,
+            "RandomJ Exponential",
+            "lambda=&lammbda insertion=&insertion",
+        )
+    elif randomj == "randomj_gamma":
         IJ.run(image_plus_copy, "RandomJ Gamma", "order=&order insertion=&insertion")
-    elif randomj == 'randomj_gaussian':
-        IJ.run(image_plus_copy, "RandomJ Gaussian", "mean=&mean sigma=&sigma insertion=&insertion")
-    elif randomj == 'randomj_poisson':
+    elif randomj == "randomj_gaussian":
+        IJ.run(
+            image_plus_copy,
+            "RandomJ Gaussian",
+            "mean=&mean sigma=&sigma insertion=&insertion",
+        )
+    elif randomj == "randomj_poisson":
         IJ.run(image_plus_copy, "RandomJ Poisson", "mean=&mean insertion=&insertion")
-    elif randomj == 'randomj_uniform':
-        IJ.run(image_plus_copy, "RandomJ Uniform", "min=&min max=&max insertion=&insertion")
+    elif randomj == "randomj_uniform":
+        IJ.run(
+            image_plus_copy, "RandomJ Uniform", "min=&min max=&max insertion=&insertion"
+        )
 
 # Save the ImagePlus object as a new image.
 IJ.saveAs(image_plus_copy, image_datatype, tmp_output_path)