diff --git a/spim_registration/timelapse/registration.bsh b/spim_registration/timelapse/registration.bsh index 0031b54f98e3fb144fa2cf113fbb268728e9a6aa..d6872232b191687a082c3e8f591979528318672e 100755 --- a/spim_registration/timelapse/registration.bsh +++ b/spim_registration/timelapse/registration.bsh @@ -117,16 +117,33 @@ String[] threshold_token = reg_threshold.split(delims); String channel_string = ""; String processing_channel_string = ""; StringBuilder channel_string_multi = new StringBuilder(); - + // If there are no channels set returns an error if (channels.equalsIgnoreCase("")) { System.out.println("Warning: There are no channels set"); } - + +// Returns an Error if there is one channel in channels but multiple settings in radius and or threshold +else if ( channel_token.length == 1 && (radius_1_token.length > 1 || radius_2_token.length > 1 || threshold_token.length > 1 ) ) +{ + System.out.println( "Error: Only one channel detected but multiple channel settings for radius or threshold" ); +} + +// Assembles String for Singel Channel +else if (reg_process_channel.equalsIgnoreCase( "All channels" ) && channel_token.length == 1 ) +{ + processing_channel_string = ""; + channel_string_multi.append(""); + channel_string = "interest_point_specification=[Advanced ...] " + + "radius_1=" + reg_radius_1 + " " + + "radius_2=" + reg_radius_2 + " " + + "threshold=" + reg_threshold + " " + + "find_maxima"; +} + // Dual Channels both Channels contain beads else if (reg_process_channel.equalsIgnoreCase( "All channels" ) && channel_token.length > 1 ) - { // Assembles String using StringBuilder for 2 Channels for (int channel=0; channel < channel_token.length; channel++ ) @@ -140,41 +157,22 @@ else if (reg_process_channel.equalsIgnoreCase( "All channels" ) && channel_token channel_string_multi.append(" "); } - } - -// Returns an Error if there is one channel in channels but multiple settings in radius and or threshold -else if ( channel_token.length == 1 && (radius_1_token.length > 1 || radius_2_token.length > 1 || threshold_token.length > 1 ) ) -{ - System.out.println( "Error: Only one channel detected but multiple channel settings for radius or threshold" ); } - + // Returns an Error if set to Dual Channel one Channel contains beads but there is only one channel in channels else if ( reg_process_channel.equalsIgnoreCase( "Single channel (Select from List)" ) && channel_token.length == 1 ) { System.out.println( "Error: reg_process_channel or channels set incorrectly" ); } - -// Assembles String for Singel Channel -else if (reg_process_channel.equalsIgnoreCase( "Single channel" ) && channel_token.length == 1 ) -{ - reg_process_channel = "All channels"; // Sets reprocess channel All channels - processing_channel_string = ""; - channel_string_multi.append(""); - channel_string = "interest_point_specification=[Advanced ...] " + - "radius_1=" + reg_radius_1 + " " + - "radius_2=" + reg_radius_2 + " " + - "threshold=" + reg_threshold + " " + - "find_maxima"; -} -// Returns and Error if set to Dual Channel but there are multiple settings in radius and or threshold +// Returns and Error if set to Dual Channel processing one channel contains the beads but there are multiple settings in radius and or threshold else if ( reg_process_channel.equalsIgnoreCase( "Single channel (Select from List)" ) && (radius_1_token.length > 1 || radius_2_token.length > 1 || threshold_token.length > 1 ) ) { System.out.println( "Error: You said you wanted to process only one channel but there are multiple settings for radius or threshold" ); -} - +} + // Assembles String for Dual Channel but only one Channel contains beads -else if (reg_process_channel.equalsIgnoreCase( "Single channel (Select from List)" ) && channel_token.length > 1) +else if (reg_process_channel.equalsIgnoreCase( "Single channel (Select from List)" ) && channel_token.length > 1) { channel_string_multi.append(""); processing_channel_string = "processing_channel=[channel " + reg_processing_channel + "] "; @@ -190,9 +188,10 @@ else { System.out.println( "Error: Incorrect settings" ); } - + System.out.println( "Processing Channel = " + processing_channel_string ); System.out.println( "Channel String: " + channel_string ); +System.out.println( reg_process_channel ); System.out.println( "Multi channel String: " + channel_string_multi ); // Channel Setting Registration @@ -207,72 +206,62 @@ reg_interest_points_channel = System.getProperty( "reg_interest_points_channel" System.out.println( "reg_interest_points_channel = " + reg_interest_points_channel ); // Splits up channels, reg_interest_points_channel -String delims = "[,]"; -String[] channel_token = channels.split(delims); +// String delims = "[,]"; +// String[] channel_token = channels.split(delims); +// Splits up channels, reg_interest_points_channel String[] interest_token = reg_interest_points_channel.split(delims); - - String reg_single_channel_string =""; StringBuilder reg_multi_channel_string = new StringBuilder(); - + // If there are no channels set returns an error if (channels.equalsIgnoreCase("")) - { - System.out.println("Warning: There are no channels set"); - } - - // Returns Error if Single Channel selected but multiple settings in channels or reg_interest_points_channel - else if ( reg_process_channel.equalsIgnoreCase( "Single Channel" ) && (channel_token.length > 1 || interest_token.length > 1 )) - { - System.out.println( "Error: Single Channel selected but multiple settings in channls or reg_interest_points_channel" ); - } - - // Assembles string for Single Channel registration - else if (reg_process_channel.equalsIgnoreCase( "Single Channel" ) && channel_token.length == 1 && interest_token.length == 1 ) +{ + System.out.println("Warning: There are no channels set"); +} + +// Assembles string for Single Channel registration +else if (reg_process_channel.equalsIgnoreCase( "All channels" ) && channel_token.length == 1 && interest_token.length == 1 ) +{ + reg_multi_channel_string.append( "" ); + reg_single_channel_string = "interest_points_channel_" + channels + "=" + reg_interest_points_channel + " "; +} + +// Returns error if Multi Channels are selected but not enough settings in channels or reg_interest_points_channel +else if (reg_process_channel.equalsIgnoreCase( "All channels" ) && ( channel_token.length < 1 || interest_token.length < 1) ) +{ + System.out.println( "Error: Multi Channel selected but only one setting in channels or reg_interest_points_channel" ); +} + +// Assembles string for Multi Channel registration +else if (reg_process_channel.equalsIgnoreCase( "All channels" ) && channel_token.length > 1 ) +{ + for (int channel=0; channel < channel_token.length; channel++ ) { - reg_multi_channel_string.append( "" ); - reg_process_channel = "All channels"; // Sets reprocess channel to all channels - reg_single_channel_string = "interest_points_channel_" + channels + "=" + reg_interest_points_channel + " "; - } - - // Returns error if Multi Channels are selected but not enough settings in channels or reg_interest_points_channel - else if (reg_process_channel.equalsIgnoreCase( "All channels" ) && ( channel_token.length < 1 || interest_token.length < 1) ) - { - System.out.println( "Error: Multi Channel selected but only one setting in channels or reg_interest_points_channel" ); - } - - // Assembles string for Multi Channel registration - else if (reg_process_channel.equalsIgnoreCase( "All channels" ) && channel_token.length > 1 ) - { - for (int channel=0; channel < channel_token.length; channel++ ) - - { - String channel_part = "interest_points_channel_" + channel_token[channel] + "=" + interest_token[channel] + " "; - reg_multi_channel_string.append( channel_part ); - reg_multi_channel_string.append(" "); - } + String channel_part = "interest_points_channel_" + channel_token[channel] + "=" + interest_token[channel] + " "; + reg_multi_channel_string.append( channel_part ); + reg_multi_channel_string.append(" "); } +} - // Returns error of Multi Channels one Channel contains the beads is selected but not enough settings in channels or reg_interest_points_channel - else if (reg_process_channel.equalsIgnoreCase( "Single channel (Select from List)" ) && ( channel_token.length < 1 || interest_token.length < 1 )) - { - System.out.println( "Error: Multi Channel one Channel contains beads selected but only one setting in channls or reg_interest_points_channel" ); - } - - // Assembles string for Multi Channel Processing one Channel Contains the beads - else if (reg_process_channel.equalsIgnoreCase( "Single channel (Select from List)" ) && channel_token.length > 1 && interest_token.length > 1) - { - for (int channel=0; channel < channel_token.length; channel++ ) - { - String channel_part = "interest_points_channel_" + channel_token[channel] + "=" + interest_token[channel] + " "; - reg_multi_channel_string.append( channel_part ); - reg_multi_channel_string.append(" "); - } +// Returns error of Multi Channels one Channel contains the beads is selected but not enough settings in channels or reg_interest_points_channel +else if (reg_process_channel.equalsIgnoreCase( "Single channel (Select from List)" ) && ( channel_token.length < 1 || interest_token.length < 1 )) +{ + System.out.println( "Error: Multi Channel one Channel contains beads selected but only one setting in channls or reg_interest_points_channel" ); +} + +// Assembles string for Multi Channel Processing one Channel Contains the beads +else if (reg_process_channel.equalsIgnoreCase( "Single channel (Select from List)" ) && channel_token.length > 1 && interest_token.length > 1) +{ + for (int channel=0; channel < channel_token.length; channel++ ) + { + String channel_part = "interest_points_channel_" + channel_token[channel] + "=" + interest_token[channel] + " "; + reg_multi_channel_string.append( channel_part ); + reg_multi_channel_string.append(" "); } +} -System.out.println( "reg_single_channel_string = " + reg_single_channel_string ); -System.out.println( "reg_multi_channel_string = " + reg_multi_channel_string ); - + System.out.println( "reg_single_channel_string = " + reg_single_channel_string ); + System.out.println( "reg_multi_channel_string = " + reg_multi_channel_string ); // activate cluster processing System.out.println( "=======================================================" ); diff --git a/spim_registration/timelapse/timelapse_registration.bsh b/spim_registration/timelapse/timelapse_registration.bsh index bd60d18fe0a27480024ec8d04af45b66b6a5fddd..82c051815af93ceee782daab02e48dd8c0f7abc2 100755 --- a/spim_registration/timelapse/timelapse_registration.bsh +++ b/spim_registration/timelapse/timelapse_registration.bsh @@ -86,66 +86,53 @@ System.out.println( "reg_interest_points_channel = " + reg_interest_points_chann String delims = "[,]"; String[] channel_token = channels.split(delims); String[] interest_token = reg_interest_points_channel.split(delims); - + String reg_single_channel_string = ""; StringBuilder reg_multi_channel_string = new StringBuilder(); - if (channels.equalsIgnoreCase("")) - { - System.out.println("Warning: There are no channels set"); - } - - // Returns Error if Single Channel selected but multiple settings in channels or reg_interest_points_channel - else if ( reg_process_channel.equalsIgnoreCase( "Single Channel" ) && (channel_token.length > 1 || interest_token.length > 1 )) - { - System.out.println( "Error: Single Channel selected but multiple settings in channls or reg_interest_points_channel" ); - } - - // Assembles string for Single Channel registration - else if (reg_process_channel.equalsIgnoreCase( "Single channel" ) && channel_token.length == 1 ) - { - reg_multi_channel_string.append( "" ); - reg_process_channel = "All channels"; // Sets reprocess channel to All channels - reg_single_channel_string = "interest_points_channel_" + channels + "=" + reg_interest_points_channel + " "; - } - - // Returns error if Multi Channels are selected but not enough settings in channels or reg_interest_points_channel - else if (reg_process_channel.equalsIgnoreCase( "All channels" ) && ( channel_token.length < 1 || interest_token.length < 1) ) - { - System.out.println( "Error: Multi Channel selected but only one setting in channels or reg_interest_points_channel" ); - } - - // Assembles string for Multi Channel registration - else if (reg_process_channel.equalsIgnoreCase( "All channels" ) && channel_token.length > 1 ) - { - for (int channel=0; channel < channel_token.length; channel++ ) +if (channels.equalsIgnoreCase("")) +{ + System.out.println("Warning: There are no channels set"); +} - { - String channel_part = "interest_points_channel_" + channel_token[channel] + "=" + interest_token[channel] + " "; - reg_multi_channel_string.append( channel_part ); - reg_multi_channel_string.append(" "); - } - } - - // Returns error of Multi Channels one Channel contains the beads is selected but not enough settings in channels or reg_interest_points_channel - else if (reg_process_channel.equalsIgnoreCase( "Single channel (Select from List)" ) && ( channel_token.length < 1 || interest_token.length < 1 )) - { - System.out.println( "Error: Multi Channel one Channel contains beads selected but only one setting in channls or reg_interest_points_channel" ); - } +// Assembles string for Single Channel registration +else if (reg_process_channel.equalsIgnoreCase( "All channels" ) && channel_token.length == 1 ) +{ + reg_multi_channel_string.append( "" ); + reg_single_channel_string = "interest_points_channel_" + channels + "=" + reg_interest_points_channel + " "; +} - // Assembles string for Multi Channel Processing one Channel Contains the beads - else if (reg_process_channel.equalsIgnoreCase( "Single channel (Select from List)" ) && channel_token.length > 1 && interest_token.length > 1 ) - { - for (int channel=0; channel < channel_token.length; channel++ ) - - { - String channel_part = "interest_points_channel_" + channel_token[channel] + "=" + interest_token[channel] + " "; - reg_multi_channel_string.append( channel_part ); - reg_multi_channel_string.append(" "); - } +// Assembles string for Multi Channel registration +else if (reg_process_channel.equalsIgnoreCase( "All channels" ) && channel_token.length > 1 ) +{ + for (int channel=0; channel < channel_token.length; channel++ ) + + { + String channel_part = "interest_points_channel_" + channel_token[channel] + "=" + interest_token[channel] + " "; + reg_multi_channel_string.append( channel_part ); + reg_multi_channel_string.append(" "); + } +} + +// Returns error of Multi Channels one Channel contains the beads is selected but not enough settings in channels or reg_interest_points_channel +else if (reg_process_channel.equalsIgnoreCase( "Single channel (Select from List)" ) && ( channel_token.length < 1 || interest_token.length < 1 )) +{ + System.out.println( "Error: Multi Channel one Channel contains beads selected but only one setting in channls or reg_interest_points_channel" ); +} - } +// Assembles string for Multi Channel Processing one Channel Contains the beads +else if (reg_process_channel.equalsIgnoreCase( "Single channel (Select from List)" ) && channel_token.length > 1 && interest_token.length > 1 ) +{ + for (int channel=0; channel < channel_token.length; channel++ ) + { + String channel_part = "interest_points_channel_" + channel_token[channel] + "=" + interest_token[channel] + " "; + reg_multi_channel_string.append( channel_part ); + reg_multi_channel_string.append(" "); + } + +} + System.out.println( "reg_single_channel_string = " + reg_single_channel_string ); System.out.println( "reg_multi_channel_string = " + reg_multi_channel_string ); diff --git a/spim_registration/timelapse/tomancak_test_cluster.yaml b/spim_registration/timelapse/tomancak_test_cluster.yaml index 392954fa193b4afcc771e1e4e68b76f9cdf0a27c..77c76210cd21385a3cbff9cf250fd1a697657831 100755 --- a/spim_registration/timelapse/tomancak_test_cluster.yaml +++ b/spim_registration/timelapse/tomancak_test_cluster.yaml @@ -50,7 +50,7 @@ resave_hdf5: { registration: { # "Single Channel" is not a valid choice for "Process_channel" - reg_process_channel: '"Single channels"', + reg_process_channel: '"All channels"', reg_processing_channel: '"green"', reg_interest_points_channel: '"beads"', reg_radius_1: '2',