Skip to content

Commit b81b5cb

Browse files
committed
add average option in cp3
1 parent 2b3858a commit b81b5cb

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

src/main/java/fiji/plugin/appose/ApposeUtils.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,14 +192,16 @@ public static void displayParameters( final Map< String, Object > inputs )
192192
System.out.println( "─".repeat( 50 ) );
193193
}
194194

195-
public static List< String > getChannelChoices( ImagePlus imp )
195+
public static List< String > getChannelChoices( ImagePlus imp, boolean cp3_mode )
196196
{
197197
List< String > channelChoices = new ArrayList<>();
198198
for ( int i = 1; i <= imp.getNChannels(); i++ )
199199
{
200200
channelChoices.add( String.valueOf( i ) );
201201
}
202202
channelChoices.add( "None" );
203+
if ( cp3_mode )
204+
channelChoices.add( "Average" );
203205
return channelChoices;
204206
}
205207

src/main/java/fiji/plugin/appose/cellpose/cp3/CellposeAppose.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public void initialize()
151151

152152
is3D = ApposeUtils.is3d( imp );
153153

154-
List< String > channelChoices = ApposeUtils.getChannelChoices( imp );
154+
List< String > channelChoices = ApposeUtils.getChannelChoices( imp, true );
155155

156156
// Set the max possible value of channels based on image dimension
157157
final MutableModuleItem< String > cytoItem =

src/main/java/fiji/plugin/appose/cellpose/cp4/CellposeSAMAppose.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ public void initialize()
165165
if ( nchanels > 3 )
166166
{
167167
IJ.showMessage( "Cellpose SAM can only handle 3 channels, pick the 3 channels to feed to the model." );
168-
List< String > channelChoices = ApposeUtils.getChannelChoices( imp );
168+
List< String > channelChoices = ApposeUtils.getChannelChoices( imp, false );
169169

170170
chan0 = new DefaultMutableModuleItem<>( getInfo(),
171171
"Channel 0", String.class );

0 commit comments

Comments
 (0)