diff --git a/spim_registration/timelapse/Snakefile b/spim_registration/timelapse/Snakefile index 07b4de4752152a388f1e13d2c6bf15e731f1f153..a0a68582fa666a8dc5fa3af38323c0082417d42f 100755 --- a/spim_registration/timelapse/Snakefile +++ b/spim_registration/timelapse/Snakefile @@ -306,6 +306,7 @@ rule external_transform: """{fiji-prefix} {fiji-app} \ -Dimage_file_directory={jdir} \ -Dmerged_xml={merged_xml_file} \ + -Dchannel_setting={channel_setting} \ -Dtransform_angle={transform_angle} \ -Dtransform_channel={transform_channel} \ -Dtransform_illumination={transform_illumination} \ @@ -405,7 +406,7 @@ rule hdf5_xml_output: input: config["hdf5_output"]["output_xml"].strip('\"') + ".xml" output: expand("{dataset}.{suffix}",dataset=[ config["common"]["hdf5_xml_filename"].strip('\"')], suffix=["xml","h5"]), [ item+"_output" for item in datasets ] - log: "hdf5_xml.log" + log: "output_hdf5_xml.log" run: part_string = produce_string( """{fiji-prefix} {fiji-app} \ diff --git a/spim_registration/timelapse/define_output.bsh b/spim_registration/timelapse/define_output.bsh old mode 100644 new mode 100755 index aae8803a6c3a59398858e7af6b8376e9cb6b6572..da8a3ce6d3e8be0d8ed94326d66428529af0abc2 --- a/spim_registration/timelapse/define_output.bsh +++ b/spim_registration/timelapse/define_output.bsh @@ -25,7 +25,6 @@ System.out.println( "xml_filename = " + xml_filename ); System.out.println("========================================================="); System.out.println("Dataset:"); timepoints = System.getProperty( "timepoints" ); - image_file_pattern = System.getProperty( "image_file_pattern" ); type_of_dataset = System.getProperty( "type_of_dataset" ); multiple_timepoints = System.getProperty( "multiple_timepoints" ); @@ -37,7 +36,6 @@ System.out.println( "timepoints = " + timepoints ); System.out.println( "image_file_pattern = " + image_file_pattern ); System.out.println( "type_of_dataset = " + type_of_dataset ); System.out.println( "multiple_timepoints = " + multiple_timepoints ); - System.out.println( "multiple_illumination_directions = " + multiple_illumination_directions ); System.out.println( "multiple_angles = " + multiple_angles ); System.out.println( "imglib_container = " + imglib_container ); @@ -55,7 +53,7 @@ System.out.println( "pixel_distance_y = " + pixel_distance_y ); System.out.println( "pixel_distance_z = " + pixel_distance_z ); System.out.println( "pixel_unit = " + pixel_unit ); -// Channel Switch +// Channel switch System.out.println("========================================================="); System.out.println("Channel Switch:"); multiple_channels = System.getProperty( "multiple_channels" ); @@ -63,7 +61,31 @@ System.out.println( "multiple_channels = " + multiple_channels ); channels = System.getProperty( "channels" ); -IJ.run("Define Multi-View Dataset , type_of_dataset=[" + type_of_dataset + "] " + +if ( multiple_channels.equalsIgnoreCase( "NO (one channel)" ) ) + +{ + + channels=""; + +} + +else if ( multiple_channels.equalsIgnoreCase( "YES (one file per channel)" ) ) + +{ + + channels = "channels_=" + channels + " "; + +} + +else { + + System.out.println( "Channel switch setting gibberish" ); + +} + +System.out.println( "channels = " + channels ); + +System.out.println("Define Multi-View Dataset , type_of_dataset=[" + type_of_dataset + "] " + "xml_filename=[" + xml_filename + ".xml] " + "multiple_timepoints=[" + multiple_timepoints + "] " + "multiple_channels=[" + multiple_channels + "] " + @@ -78,8 +100,8 @@ IJ.run("Define Multi-View Dataset , type_of_dataset=[" + type_of_dataset + "] " "pixel_distance_x=" + pixel_distance_x + " " + "pixel_distance_y=" + pixel_distance_y + " " + "pixel_distance_z=" + pixel_distance_z + " " + - "pixel_unit=" + pixel_unit + ""); - + "pixel_unit=" + pixel_unit + ""); + // Executes Fiji plugin System.out.println("========================================================="); System.out.println("Start plugin:"); diff --git a/spim_registration/timelapse/export_output.bsh b/spim_registration/timelapse/export_output.bsh old mode 100644 new mode 100755 diff --git a/spim_registration/timelapse/fusion.bsh b/spim_registration/timelapse/fusion.bsh old mode 100644 new mode 100755 index 5731ddb35f66bf877091c2363b5c4c022fb739c7..f88eff8fb0acc002a7ce42a6b2b87c98263271ae --- a/spim_registration/timelapse/fusion.bsh +++ b/spim_registration/timelapse/fusion.bsh @@ -20,15 +20,13 @@ System.out.println( "-------------------------------------------------------" ); System.out.println( "Load xml file: " ); image_file_directory = System.getProperty( "image_file_directory" ); merged_xml = System.getProperty( "merged_xml" ); -if ( ! merged_xml.endsWith(".xml") ) - merged_xml = merged.xml + ".xml"; System.out.println( "xml_path=" + image_file_directory + merged_xml + ".xml" ); // Load general Parameters System.out.println( "-------------------------------------------------------" ); System.out.println( "General parameters: " ); -int parallel_timepoints = Integer.parseInt(System.getProperty( "parallel_timepoints" )); +parallel_timepoints = System.getProperty( "parallel_timepoints" ); process_timepoint = System.getProperty( "process_timepoint" ); process_channel = System.getProperty( "process_channel" ); process_illumination = System.getProperty( "process_illumination" ); @@ -75,9 +73,8 @@ System.out.println( "imglib2_data_container=" + imglib2_data_container ); System.out.println( "=======================================================" ); System.out.println( "Starting Fusion" ); -try{ IJ.run("Fuse/Deconvolve Dataset", - "select_xml=" + image_file_directory + merged_xml + " " + + "select_xml=" + image_file_directory + merged_xml + ".xml " + "process_angle=[" + process_angle + "] " + "process_illumination=[" + process_illumination + "] " + "process_timepoint=[" + process_timepoint + "] " + @@ -103,12 +100,6 @@ IJ.run("Fuse/Deconvolve Dataset", "output_file_directory=" + image_file_directory + " " + "lossless " + "imglib2_data_container=[" + imglib2_data_container + "]"); -} -catch ( e ) { - print( "[deconvolution-GPU] caught exception: "+e ); - //important to fail the process if exception occurs - runtime.exit(1); -} /* shutdown */ runtime.exit(0); diff --git a/spim_registration/timelapse/tomancak_test_cluster.yaml b/spim_registration/timelapse/tomancak_test_cluster.yaml index 00e1ca92b785ea895499d540a0a6b04454f654c8..bab766e37a107bb9d33f64b29d703a6b1ac634e1 100755 --- a/spim_registration/timelapse/tomancak_test_cluster.yaml +++ b/spim_registration/timelapse/tomancak_test_cluster.yaml @@ -48,7 +48,8 @@ resave_hdf5: { } registration: { - reg_process_channel: '"Single Channel"', + # "Single Channel" is not a valid choice for "Process_channel" + reg_process_channel: '"Single Channel"', reg_processing_channel: '"green"', reg_interest_points_channel: '"beads"', reg_radius_1: '2', @@ -116,9 +117,12 @@ fusion: { } external_transform: { + # channel setting: '"all_channels"' + channel_setting: '"green"', transform_timepoint: '"All Timepoints"', transform_angle: '"All angles"', transform_channel: '"All channels"', + # illumination setting only one illumination side transform_illumination: '"All illuminations"', apply_transformation: '"Current view transformations (appends to current transforms)"', define_mode_transform: '"Matrix"', @@ -128,7 +132,7 @@ external_transform: { } deconvolution: { - iterations: '5', + iterations: '1', maximal_x_deco: '509', maximal_y_deco: '970', maximal_z_deco: '243', @@ -136,8 +140,6 @@ deconvolution: { minimal_y_deco: '-8', minimal_z_deco: '-174', detections_to_extract_psf_for_channel: '"beads"', - #detections_to_extract_psf_for_channel_0: '"beads"', - #detections_to_extract_psf_for_channel_1: '"beads"', process_timepoint: '"Single Timepoint (Select from List)"', process_angle: '"All angles"', process_channel: '"All channels"', @@ -156,24 +158,24 @@ deconvolution: { } hdf5_output: { - bsh_file_define: "define_output.bsh", - bsh_file_hdf5: "export_output.bsh", - convert_32bit: '"[Use min/max of first image (might saturate intenities over time)]"', - output_channels: "green", - output_data_type: "32Bit", + output_image_file_pattern: 'TP{{t}}_Chgreen_Ill0_Ang0,72,144,216,288.tif', + output_xml: '"fused_Single_Channel"', output_hdf5_xml: '"hdf5_fused_Stock68"', - output_illumination_directions: '"NO (one illumination direction)"', - output_image_file_pattern: 'TP{{t}}_Ch{{c}}_Ill0_Ang0,72,144,216,288.tif', - output_imglib_container: '"ArrayImg (faster)"', - output_multiple_angles: '"NO (one angle)"', output_multiple_channels: '"NO (one channel)"', - output_multiple_timepoints: '"YES (one file per time-point)"', + output_timepoints: '0-4', output_pixel_distance_x: 0.5718, output_pixel_distance_y: 0.5718, output_pixel_distance_z: 0.5718, output_pixel_unit: 'um', - output_timepoints: '0-4', + output_channels: "green", + output_data_type: "32Bit", + convert_32bit: '"[Use min/max of first image (might saturate intenities over time)]"', output_type_of_dataset: '"Image Stacks (ImageJ Opener)"', - output_xml: '"fused_Dual_Channel"' + output_multiple_timepoints: '"YES (one file per time-point)"', + output_multiple_angles: '"NO (one angle)"', + output_illumination_directions: '"NO (one illumination direction)"', + output_imglib_container: '"ArrayImg (faster)"', + bsh_file_define: "define_output.bsh", + bsh_file_hdf5: "export_output.bsh" } diff --git a/spim_registration/timelapse/transform.bsh b/spim_registration/timelapse/transform.bsh index 75034029d67b440a760b3ebb905c7579461b9c1a..3e87082b23b8619a2efb4842681d3033e8b3bbf7 100755 --- a/spim_registration/timelapse/transform.bsh +++ b/spim_registration/timelapse/transform.bsh @@ -1,3 +1,5 @@ +// is problematic needs to be adjusted for +// multi channel and multi illumination datasets import ij.IJ; import ij.ImagePlus; import java.lang.Runtime; @@ -15,8 +17,7 @@ transform_angle = System.getProperty( "transform_angle" ); transform_channel = System.getProperty( "transform_channel" ); transform_illumination = System.getProperty( "transform_illumination" ); transform_timepoint = System.getProperty( "transform_timepoint" ); -channel_1 = System.getProperty( "channel_1" ); -channel_2 = System.getProperty( "channel_2" ); +channel_setting = System.getProperty( "channel_setting" ); transformation = System.getProperty( "transformation" ); apply_transformation = System.getProperty( "apply_transformation" ); define_mode_transform = System.getProperty( "define_mode_transform" ); @@ -30,12 +31,11 @@ System.out.println( "apply_to_angle = " + transform_angle ); System.out.println( "apply_to_channel = " + transform_channel ); System.out.println( "apply_to_illumination = " + transform_illumination ); System.out.println( "apply_to_timepoint = " + transform_timepoint ); -System.out.println( "channel_1 = " + channel_1 ); -System.out.println( "channel_2 = " + channel_2 ); +System.out.println( "Channel_setting = " + channel_setting ); System.out.println( "transformation = " + transformation ); System.out.println( "apply = " + apply_transformation ); System.out.println( "define = " + define_mode_transform ); -System.out.println( "all_timepoints_channel_" + channel_1 + "_illumination_0_all_angles = " + matrix_transform ); +System.out.println( "all_timepoints_channel_" + channel_setting + "_illumination_0_all_angles = " + matrix_transform ); // Execute Fiji Plugin try { @@ -51,11 +51,11 @@ IJ.run("Apply Transformations", "define=" + define_mode_transform + " " + "same_transformation_for_all_timepoints " + "same_transformation_for_all_angles " + - "all_timepoints_channel_" + channel_1 + "_illumination_0_all_angles=[" + matrix_transform + "]"); + "all_timepoints_channel_" + channel_setting + "_illumination_0_all_angles=[" + matrix_transform + "]"); } catch ( e ) { - print( "[registration::interest_points] caught exception: "+e ); + print( "[external transformation] caught exception: "+e ); //important to fail the process if exception occurs runtime.exit(1);