|
7 | 7 | import java.awt.EventQueue; |
8 | 8 | import java.awt.Font; |
9 | 9 | import java.awt.Window; |
| 10 | +import java.io.File; |
10 | 11 | import java.io.IOException; |
11 | 12 | import java.net.URL; |
12 | 13 | import java.nio.charset.StandardCharsets; |
|
29 | 30 | import org.apposed.appose.Service.Task; |
30 | 31 | import org.apposed.appose.Service.TaskStatus; |
31 | 32 | import org.scijava.Initializable; |
| 33 | +import org.scijava.ItemVisibility; |
32 | 34 | import org.scijava.command.Command; |
33 | 35 | import org.scijava.command.DynamicCommand; |
34 | 36 | import org.scijava.module.DefaultMutableModuleItem; |
|
61 | 63 | public class CellposeAppose extends DynamicCommand implements Initializable |
62 | 64 | { |
63 | 65 |
|
64 | | - @Parameter( choices = {"cyto3", "nuclei", "tissunet", "livecell", "CP", "cyto2", "cyto2_cp3", "tissuenet_cp3", |
| 66 | + @Parameter(label= "Cellpose model", choices = {"cyto3", "nuclei", "tissunet", "livecell", "CP", "cyto2", "cyto2_cp3", "tissuenet_cp3", |
65 | 67 | "livecell_cp3", "yeast_PhC_cp3", "yeast_BF_cp3", "bact_phase_cp3", "bact_fluor_cp3", "deepbacs_cp3", |
66 | 68 | "neurips_grayscale_cyto2", "TN1", "TN2", "TN3", "LC1", "LC2", "LC3", "LC4", "neurips_cellpose_default", |
67 | | - "neurips_cellpose_transformer"}, description="Choose CP model to run" ) |
| 69 | + "neurips_cellpose_transformer"}, description="Choose CP model to run") |
68 | 70 | private String cp_model = "cyto3"; // cellpose model |
69 | 71 |
|
| 72 | + @Parameter(label = "Custom model", description = "Custom model path, overrides the Cellpose model", style="file", required = false) |
| 73 | + private File custom_model = null; |
| 74 | + |
70 | 75 | @Parameter( label = "Diameter", min="0", description="Average diameter of a cell/nuclei (in pixels)" ) |
71 | 76 | private int cell_diameter = 30; // cell diameter |
72 | 77 |
|
@@ -115,7 +120,7 @@ public void initialize() { |
115 | 120 |
|
116 | 121 | is3D = is3d(imp); |
117 | 122 |
|
118 | | - |
| 123 | + |
119 | 124 | List<String> channelChoices = new ArrayList<>(); |
120 | 125 | for (int i = 1; i <= imp.getNChannels(); i++) { |
121 | 126 | channelChoices.add(String.valueOf(i)); |
|
0 commit comments