Skip to content
Snippets Groups Projects
Commit 4aa3afa2 authored by schmiedc's avatar schmiedc
Browse files

Merge pull request #8 from mpicbg-scicomp/master

Update to newest master
parents 5582f2a9 27743163
No related branches found
No related tags found
No related merge requests found
Showing
with 925 additions and 547 deletions
...@@ -7,8 +7,8 @@ if JOBDIR[-1] != "/": # this checks if jobdir ends with slash if not it adds a s ...@@ -7,8 +7,8 @@ if JOBDIR[-1] != "/": # this checks if jobdir ends with slash if not it adds a s
JOBDIR+="/" JOBDIR+="/"
#data specific config file, expected to be inside JOBDIR #data specific config file, expected to be inside JOBDIR
configfile: "tomancak_test_cluster.json" # configfile: "tomancak_test_cluster.json"
# configfile: "tomancak_test_cluster.yaml" configfile: "tomancak_test_cluster.yaml"
padding_format = "{0:0"+str(padding_of_file_id(int(config["common"]["ntimepoints"])))+"d}" padding_format = "{0:0"+str(padding_of_file_id(int(config["common"]["ntimepoints"])))+"d}"
...@@ -21,6 +21,7 @@ xml_merge_in = produce_xml_merge_job_files(datasets) ...@@ -21,6 +21,7 @@ xml_merge_in = produce_xml_merge_job_files(datasets)
rule done: rule done:
input: [ ds + "_output_hdf5" for ds in datasets ] input: [ ds + "_output_hdf5" for ds in datasets ]
#input: [ ds + "_fusion" for ds in datasets ]
rule resave_prepared: rule resave_prepared:
input: expand("{dataset}.{suffix}",dataset=[ config["common"]["hdf5_xml_filename"] ], suffix=["xml","h5"]) input: expand("{dataset}.{suffix}",dataset=[ config["common"]["hdf5_xml_filename"] ], suffix=["xml","h5"])
...@@ -34,20 +35,15 @@ rule define_xml_czi: ...@@ -34,20 +35,15 @@ rule define_xml_czi:
cmd_string = produce_string("""{fiji-prefix} {fiji-app} \ cmd_string = produce_string("""{fiji-prefix} {fiji-app} \
-Dimage_file_directory={jdir} \ -Dimage_file_directory={jdir} \
-Dfirst_czi={first_czi} \ -Dfirst_czi={first_czi} \
-Dangle_1={angle_1} \ -Dangles={angles} \
-Dangle_2={angle_2} \ -Dchannels={channels} \
-Dangle_3={angle_3} \ -Dillumination={illumination} \
-Dangle_4={angle_4} \
-Dangle_5={angle_5} \
-Dchannel_1={channel_1} \
-Dchannel_2={channel_2} \
-Dillumination_1={illumination_1} \
-Drotation_around={rotation_around} \
-Dpixel_distance_x={pixel_distance_x} \ -Dpixel_distance_x={pixel_distance_x} \
-Dpixel_distance_y={pixel_distance_y} \ -Dpixel_distance_y={pixel_distance_y} \
-Dpixel_distance_z={pixel_distance_z} \ -Dpixel_distance_z={pixel_distance_z} \
-Dpixel_unit={pixel_unit} \ -Dpixel_unit={pixel_unit} \
-Dfirst_xml_filename={first_xml_filename} \ -Dfirst_xml_filename={first_xml_filename} \
-Drotation_around={rotation_around} \
-- --no-splash {path_bsh}""", -- --no-splash {path_bsh}""",
config["common"], config["common"],
config["define_xml_czi"], config["define_xml_czi"],
...@@ -68,8 +64,9 @@ rule define_xml_tif: ...@@ -68,8 +64,9 @@ rule define_xml_tif:
"""{fiji-prefix} {fiji-app} \ """{fiji-prefix} {fiji-app} \
-Dimage_file_directory={jdir} \ -Dimage_file_directory={jdir} \
-Dtimepoints={timepoints} \ -Dtimepoints={timepoints} \
-Dacquisition_angles={acquisition_angles} \ -Dangles={angles} \
-Dchannels={channels} \ -Dchannels={channels} \
-Dillumination={illumination} \
-Dimage_file_pattern={image_file_pattern} \ -Dimage_file_pattern={image_file_pattern} \
-Dpixel_distance_x={pixel_distance_x} \ -Dpixel_distance_x={pixel_distance_x} \
-Dpixel_distance_y={pixel_distance_y} \ -Dpixel_distance_y={pixel_distance_y} \
...@@ -93,7 +90,7 @@ rule define_xml_tif: ...@@ -93,7 +90,7 @@ rule define_xml_tif:
cmd_string +=" > {log} 2>&1" cmd_string +=" > {log} 2>&1"
shell(cmd_string) shell(cmd_string)
ruleorder: define_xml_tif > define_xml_czi ruleorder: define_xml_czi > define_xml_tif
# create mother .xml/.h5 # create mother .xml/.h5
rule hdf5_xml: rule hdf5_xml:
...@@ -135,7 +132,7 @@ rule resave_hdf5: ...@@ -135,7 +132,7 @@ rule resave_hdf5:
run: run:
part_string = produce_string( part_string = produce_string(
"""{fiji-prefix} {fiji-app} \ """{fiji-prefix} {fiji-app} \
-Dimage_file_directory={jdir} \ -Dimage_file_directory={jdir} \
-Dfirst_xml_filename={first_xml_filename} \ -Dfirst_xml_filename={first_xml_filename} \
-Dhdf5_xml_filename={input_xml_base} \ -Dhdf5_xml_filename={input_xml_base} \
-Dresave_angle={resave_angle} \ -Dresave_angle={resave_angle} \
...@@ -168,24 +165,24 @@ rule registration: ...@@ -168,24 +165,24 @@ rule registration:
-Dparallel_timepoints={file_id_w} \ -Dparallel_timepoints={file_id_w} \
-Dimage_file_directory={jdir} \ -Dimage_file_directory={jdir} \
-Dxml_filename={input_xml} \ -Dxml_filename={input_xml} \
-Dprocess_timepoint={timepoint} \ -Dreg_process_timepoint={reg_process_timepoint} \
-Dprocess_channel={channel} \ -Dreg_process_channel={reg_process_channel} \
-Dprocess_illumination={illuminations} \ -Dreg_process_illumination={reg_process_illumination} \
-Dprocess_angle={angle} \ -Dreg_process_angle={reg_process_angle} \
-Dprocessing_channel={proc-ch} \ -Dchannels={channels} \
-Dreg_processing_channel={reg_processing_channel} \
-Dlabel_interest_points={label_interest_points} \ -Dlabel_interest_points={label_interest_points} \
-Dtype_of_registration={type_of_registration} \ -Dtype_of_registration={type_of_registration} \
-Dtype_of_detection={type_of_detection} \ -Dtype_of_detection={type_of_detection} \
-Dsubpixel_localization={subpixel_localization} \ -Dsubpixel_localization={subpixel_localization} \
-Dimglib_container={imglib_container} \ -Dimglib_container={imglib_container} \
-Dradius_1={radius_1} \ -Dreg_radius_1={reg_radius_1} \
-Dradius_2={radius_2} \ -Dreg_radius_2={reg_radius_2} \
-Dthreshold={threshold} \ -Dreg_threshold={reg_threshold} \
-Dinitial_sigma={initial_sigma} \ -Dinitial_sigma={initial_sigma} \
-Dthreshold_gaussian={threshold_gaussian} \ -Dthreshold_gaussian={threshold_gaussian} \
-Dregistration_algorithm={algorithm} \ -Dregistration_algorithm={algorithm} \
-Dinterest_points_channel_0={interest_points_channel_0} \ -Dreg_interest_points_channel={reg_interest_points_channel} \
-Dinterest_points_channel_1={interest_points_channel_1} \
-Dfix_tiles={fix_tiles} \ -Dfix_tiles={fix_tiles} \
-Dmap_back_tiles={map_back_tiles} \ -Dmap_back_tiles={map_back_tiles} \
-Dtransformation_model={transformation_model} \ -Dtransformation_model={transformation_model} \
...@@ -193,6 +190,7 @@ rule registration: ...@@ -193,6 +190,7 @@ rule registration:
-Dlambda={lambda} \ -Dlambda={lambda} \
-Dallowed_error_for_ransac={allowed_error_for_ransac} \ -Dallowed_error_for_ransac={allowed_error_for_ransac} \
-Ddetection_min_max={detection_min_max} \ -Ddetection_min_max={detection_min_max} \
-Dsignificance={significance} \
-- --no-splash {path_bsh}""", -- --no-splash {path_bsh}""",
config["common"], config["common"],
config["registration"], config["registration"],
...@@ -233,15 +231,14 @@ rule timelapse: ...@@ -233,15 +231,14 @@ rule timelapse:
-Dimage_file_directory={jdir} \ -Dimage_file_directory={jdir} \
-Dmerged_xml={input} \ -Dmerged_xml={input} \
-Dtimelapse_process_timepoints={timelapse_process_timepoints} \ -Dtimelapse_process_timepoints={timelapse_process_timepoints} \
-Dprocess_channel_timelapse={channel} \ -Dreg_process_channel={reg_process_channel} \
-Dprocess_illumination={illuminations} \ -Dreg_process_illumination={reg_process_illumination} \
-Dprocess_angle={angle} \ -Dreg_process_angle={reg_process_angle} \
-Dreference_timepoint={reference_timepoint} \ -Dreference_timepoint={reference_timepoint} \
-Dchannel_1={proc-ch} \ -Dchannels={channels} \
-Dtype_of_registration_timelapse={type_of_registration_timelapse} \ -Dtype_of_registration_timelapse={type_of_registration_timelapse} \
-Dregistration_algorithm={algorithm} \ -Dregistration_algorithm={algorithm} \
-Dreg_1_interest_points_channel={interest_points_channel_0} \ -Dreg_interest_points_channel={reg_interest_points_channel} \
-Dreg_2_interest_points_channel={interest_points_channel_1} \
-Dtransformation_model={transformation_model} \ -Dtransformation_model={transformation_model} \
-Dmodel_to_regularize_with={model_to_regularize_with} \ -Dmodel_to_regularize_with={model_to_regularize_with} \
-Dlambda={lambda} \ -Dlambda={lambda} \
...@@ -292,7 +289,7 @@ rule fusion: ...@@ -292,7 +289,7 @@ rule fusion:
-- --no-splash {path_bsh}""", -- --no-splash {path_bsh}""",
config["common"], config["common"],
config["fusion"], config["fusion"],
config["resave_czi_hdf5"], config["resave_hdf5"],
path_bsh=config["common"]["bsh_directory"] + config["fusion"]["bsh_file"], path_bsh=config["common"]["bsh_directory"] + config["fusion"]["bsh_file"],
jdir=JOBDIR, jdir=JOBDIR,
file_id_w="{wildcards.file_id}", file_id_w="{wildcards.file_id}",
...@@ -310,10 +307,11 @@ rule external_transform: ...@@ -310,10 +307,11 @@ rule external_transform:
"""{fiji-prefix} {fiji-app} \ """{fiji-prefix} {fiji-app} \
-Dimage_file_directory={jdir} \ -Dimage_file_directory={jdir} \
-Dmerged_xml={merged_xml_file} \ -Dmerged_xml={merged_xml_file} \
-Dtransform_angle={angle} \ -Dchannel_setting={channel_setting} \
-Dtransform_channel={channel} \ -Dtransform_angle={transform_angle} \
-Dtransform_illumination={illumination} \ -Dtransform_channel={transform_channel} \
-Dtransform_timepoint={timepoint} \ -Dtransform_illumination={transform_illumination} \
-Dtransform_timepoint={transform_timepoint} \
-Dtransformation={transformation} \ -Dtransformation={transformation} \
-Dapply_transformation={apply_transformation} \ -Dapply_transformation={apply_transformation} \
-Ddefine_mode_transform={define_mode_transform} \ -Ddefine_mode_transform={define_mode_transform} \
...@@ -329,7 +327,7 @@ rule external_transform: ...@@ -329,7 +327,7 @@ rule external_transform:
shell(cmd_string) shell(cmd_string)
rule deconvolution: rule deconvolution:
input: rules.external_transform.output, "{xml_base}-{file_id,\d+}-00.h5", merged_xml="{xml_base}_merge.xml" input: rules.timelapse.output, "{xml_base}-{file_id,\d+}-00.h5", merged_xml="{xml_base}_merge.xml" # rules.external_transform.output, "{xml_base}-{file_id,\d+}-00.h5", merged_xml="{xml_base}_merge.xml"
output: "{xml_base}-{file_id,\d+}-00.h5_deconvolution" output: "{xml_base}-{file_id,\d+}-00.h5_deconvolution"
log: "{xml_base}-{file_id,\d+}-00-deconvolution.log" log: "{xml_base}-{file_id,\d+}-00-deconvolution.log"
run: run:
...@@ -343,12 +341,13 @@ rule deconvolution: ...@@ -343,12 +341,13 @@ rule deconvolution:
-Dprocess_channel={process_channel} \ -Dprocess_channel={process_channel} \
-Dprocess_illumination={process_illumination} \ -Dprocess_illumination={process_illumination} \
-Dprocess_angle={process_angle} \ -Dprocess_angle={process_angle} \
-Dminimal_x_deco={minimal_x} \ -Dchannels={channels} \
-Dminimal_y_deco={minimal_y} \ -Dminimal_x_deco={minimal_x_deco} \
-Dminimal_z_deco={minimal_z} \ -Dminimal_y_deco={minimal_y_deco} \
-Dmaximal_x_deco={maximal_x} \ -Dminimal_z_deco={minimal_z_deco} \
-Dmaximal_y_deco={maximal_y} \ -Dmaximal_x_deco={maximal_x_deco} \
-Dmaximal_z_deco={maximal_z} \ -Dmaximal_y_deco={maximal_y_deco} \
-Dmaximal_z_deco={maximal_z_deco} \
-Dimglib2_container_deco={imglib2_container} \ -Dimglib2_container_deco={imglib2_container} \
-Dtype_of_iteration={type_of_iteration} \ -Dtype_of_iteration={type_of_iteration} \
-Dosem_acceleration={osem_acceleration} \ -Dosem_acceleration={osem_acceleration} \
...@@ -356,8 +355,7 @@ rule deconvolution: ...@@ -356,8 +355,7 @@ rule deconvolution:
-Dcompute={compute} \ -Dcompute={compute} \
-Dpsf_estimation={psf_estimation} \ -Dpsf_estimation={psf_estimation} \
-Ddirectory_cuda={directory_cuda} \ -Ddirectory_cuda={directory_cuda} \
-Ddetections_to_extract_psf_for_channel_0={detections_to_extract_psf_for_channel_0} \ -Ddetections_to_extract_psf_for_channel={detections_to_extract_psf_for_channel} \
-Ddetections_to_extract_psf_for_channel_1={detections_to_extract_psf_for_channel_1} \
-Dpsf_size_x={psf_size_x} \ -Dpsf_size_x={psf_size_x} \
-Dpsf_size_y={psf_size_y} \ -Dpsf_size_y={psf_size_y} \
-Dpsf_size_z={psf_size_z} \ -Dpsf_size_z={psf_size_z} \
...@@ -409,7 +407,7 @@ rule hdf5_xml_output: ...@@ -409,7 +407,7 @@ rule hdf5_xml_output:
input: config["hdf5_output"]["output_xml"].strip('\"') + ".xml" input: config["hdf5_output"]["output_xml"].strip('\"') + ".xml"
output: expand("{dataset}.{suffix}",dataset=[ config["common"]["hdf5_xml_filename"].strip('\"')], suffix=["xml","h5"]), output: expand("{dataset}.{suffix}",dataset=[ config["common"]["hdf5_xml_filename"].strip('\"')], suffix=["xml","h5"]),
[ item+"_output" for item in datasets ] [ item+"_output" for item in datasets ]
log: "hdf5_xml.log" log: "output_hdf5_xml.log"
run: run:
part_string = produce_string( part_string = produce_string(
"""{fiji-prefix} {fiji-app} \ """{fiji-prefix} {fiji-app} \
...@@ -420,8 +418,8 @@ rule hdf5_xml_output: ...@@ -420,8 +418,8 @@ rule hdf5_xml_output:
-Dresave_channel={resave_channel} \ -Dresave_channel={resave_channel} \
-Dresave_illumination={resave_illumination} \ -Dresave_illumination={resave_illumination} \
-Dresave_timepoint={resave_timepoint} \ -Dresave_timepoint={resave_timepoint} \
-Dsubsampling_factors={subsampling_factors} \ -Dsubsampling_factors={subsampling_output} \
-Dhdf5_chunk_sizes={hdf5_chunk_sizes} \ -Dhdf5_chunk_sizes={chunk_sizes_output} \
-Dtimepoints_per_partition={timepoints_per_partition} \ -Dtimepoints_per_partition={timepoints_per_partition} \
-Dsetups_per_partition={setups_per_partition} \ -Dsetups_per_partition={setups_per_partition} \
-Drun_only_job_number=0 \ -Drun_only_job_number=0 \
...@@ -432,7 +430,7 @@ rule hdf5_xml_output: ...@@ -432,7 +430,7 @@ rule hdf5_xml_output:
config["hdf5_output"], config["hdf5_output"],
config["resave_hdf5"], config["resave_hdf5"],
jdir=JOBDIR, jdir=JOBDIR,
path_bsh=config["common"]["bsh_directory"] + config["resave_hdf5"]["bsh_file"]) path_bsh=config["common"]["bsh_directory"] + config["hdf5_output"]["bsh_file_hdf5"])
part_string += " > {log} 2>&1 && touch {output}" part_string += " > {log} 2>&1 && touch {output}"
shell(part_string) shell(part_string)
...@@ -451,8 +449,8 @@ rule resave_hdf5_output: ...@@ -451,8 +449,8 @@ rule resave_hdf5_output:
-Dresave_channel={resave_channel} \ -Dresave_channel={resave_channel} \
-Dresave_illumination={resave_illumination} \ -Dresave_illumination={resave_illumination} \
-Dresave_timepoint={resave_timepoint} \ -Dresave_timepoint={resave_timepoint} \
-Dsubsampling_factors={subsampling_factors} \ -Dsubsampling_factors={subsampling_output} \
-Dhdf5_chunk_sizes={hdf5_chunk_sizes} \ -Dhdf5_chunk_sizes={chunk_sizes_output} \
-Dtimepoints_per_partition={timepoints_per_partition} \ -Dtimepoints_per_partition={timepoints_per_partition} \
-Dsetups_per_partition={setups_per_partition} \ -Dsetups_per_partition={setups_per_partition} \
-Drun_only_job_number={job_number} \ -Drun_only_job_number={job_number} \
...@@ -463,7 +461,7 @@ rule resave_hdf5_output: ...@@ -463,7 +461,7 @@ rule resave_hdf5_output:
config["hdf5_output"], config["hdf5_output"],
config["resave_hdf5"], config["resave_hdf5"],
jdir=JOBDIR, jdir=JOBDIR,
path_bsh=config["common"]["bsh_directory"] + config["resave_hdf5"]["bsh_file"], path_bsh=config["common"]["bsh_directory"] + config["hdf5_output"]["bsh_file_hdf5"],
input_xml_base="{wildcards.xml_base}", input_xml_base="{wildcards.xml_base}",
job_number=int(wildcards.file_id)+1) job_number=int(wildcards.file_id)+1)
part_string += " > {log} 2>&1 && touch {output}" part_string += " > {log} 2>&1 && touch {output}"
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
"lsf_extra" : "-n 6 -R \"span[hosts=1] rusage[mem=100000]\"" "lsf_extra" : "-n 6 -R \"span[hosts=1] rusage[mem=100000]\""
}, },
"external_trafo" : "external_transfrom" :
{ {
"lsf_extra" : "-R \"span[hosts=1] rusage[mem=10000]\"" "lsf_extra" : "-R \"span[hosts=1] rusage[mem=10000]\""
}, },
...@@ -24,5 +24,10 @@ ...@@ -24,5 +24,10 @@
{ {
"lsf_extra" : "-n 7 -R \"span[hosts=1] rusage[mem=50000]\"", "lsf_extra" : "-n 7 -R \"span[hosts=1] rusage[mem=50000]\"",
"lsf_q" : "gpu" "lsf_q" : "gpu"
},
"resave_hdf5_output" :
{
"lsf_extra" : "-n 7 -R \"span[hosts=1] rusage[mem=50000]\""
} }
} }
// Load Fiji dependencies
import ij.IJ;
import ij.ImagePlus;
import java.lang.Runtime;
import java.io.File;
import java.io.FilenameFilter;
runtime = Runtime.getRuntime();
System.out.println(runtime.availableProcessors() + " cores available for multi-threading");
System.out.println( "Start to load Parameters:" );
// Select xml
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( "-------------------------------------------------------" );
System.out.println( "Load xml file: " );
System.out.println( "selected_xml = " + image_file_directory + merged_xml);
// Load general Parameters
parallel_timepoints = Integer.parseInt(System.getProperty( "parallel_timepoints" ));
process_timepoint = System.getProperty( "process_timepoint" );
process_channel = System.getProperty( "process_channel" );
process_illumination = System.getProperty( "process_illumination" );
process_angle = System.getProperty( "process_angle" );
System.out.println( "-------------------------------------------------------" );
System.out.println( "General parameters: " );
System.out.println( "timepoint_processed = " + parallel_timepoints );
System.out.println( "process_timepoints = " + process_timepoint );
System.out.println( "process_channel = " + process_channel );
System.out.println( "process_illumination = " + process_illumination );
System.out.println( "process_angle = " + process_angle );
// Load bounding box
minimal_x_deco = System.getProperty( "minimal_x_deco" );
minimal_y_deco = System.getProperty( "minimal_y_deco" );
minimal_z_deco = System.getProperty( "minimal_z_deco" );
maximal_x_deco = System.getProperty( "maximal_x_deco" );
maximal_y_deco = System.getProperty( "maximal_y_deco" );
maximal_z_deco = System.getProperty( "maximal_z_deco" );
System.out.println( "-------------------------------------------------------" );
System.out.println( "Bounding box: " );
System.out.println( "minimal_x_deco = " + minimal_x_deco );
System.out.println( "minimal_y_deco = " + minimal_y_deco );
System.out.println( "minimal_z_deco = " + minimal_z_deco );
System.out.println( "maximal_x_deco = " + maximal_x_deco );
System.out.println( "maximal_y_deco = " + maximal_y_deco );
System.out.println( "maximal_z_deco = " + maximal_z_deco );
// Load deconvolution Parameters
imglib2_container_deco = System.getProperty( "imglib2_container_deco" );
type_of_iteration = System.getProperty( "type_of_iteration" );
osem_acceleration = System.getProperty( "osem_acceleration" );
Tikhonov_parameter = System.getProperty( "Tikhonov_parameter" );
//float Tikhonov_parameter = Float.parseFloat( System.getProperty( "Tikhonov_parameter" ) );
compute = System.getProperty( "compute" );
psf_estimation = System.getProperty( "psf_estimation" );
iterations = System.getProperty( "iterations" );
deco_output_file_directory = System.getProperty( "deco_output_file_directory" );
detections_to_extract_psf_for_channel_0 = System.getProperty( "detections_to_extract_psf_for_channel_0" );
detections_to_extract_psf_for_channel_1 = System.getProperty( " detections_to_extract_psf_for_channel_1" );
System.out.println( "-------------------------------------------------------" );
System.out.println( "Deconvolution settings: " );
System.out.println( "imglib2_container = " + imglib2_container_deco );
System.out.println( "type_of_iteration = "+ type_of_iteration );
System.out.println( "osem_acceleration = " + osem_acceleration );
System.out.println( "Tikhonov_parameter = " + Tikhonov_parameter );
System.out.println( "compute = " + compute );
System.out.println( "psf_estimation = " + psf_estimation );
System.out.println( "number_of_iterations = " + iterations );
System.out.println( "deco_output_file_directory = " + deco_output_file_directory );
System.out.println( "detections_to_extract_psf_for_channel_0 = " + detections_to_extract_psf_for_channel_0 );
System.out.println( "detections_to_extract_psf_for_channel_1 = " + detections_to_extract_psf_for_channel_1 );
// Search for CUDA
directory_cuda = System.getProperty( "directory_cuda" );
System.out.println( "-------------------------------------------------------" );
System.out.println( "Loading CUDA directory: " );
System.out.println( "directory_cuda = " + directory_cuda );
// PSF Parameters
psf_size_x = System.getProperty( "psf_size_x" );
psf_size_y = System.getProperty( "psf_size_y" );
psf_size_z = System.getProperty( "psf_size_z" );
System.out.println( "-------------------------------------------------------" );
System.out.println( "PSF Parameters: " );
System.out.println( "psf_size_x = " + psf_size_x );
System.out.println( "psf_size_y = " + psf_size_y );
System.out.println( "psf_size_z = " + psf_size_z );
// Execute Fiji Plugin
System.out.println( "=======================================================" );
System.out.println( "Starting Deconvolution" );
try {
IJ.run("Fuse/Deconvolve Dataset",
"select_xml=" + image_file_directory + merged_xml + " " +
"process_angle=[All angles] " +
"process_channel=[All channels] " +
"process_illumination=[All illuminations] " +
"process_timepoint=[" + process_timepoint + "] " +
"processing_timepoint=[Timepoint " + parallel_timepoints + "] " +
"type_of_image_fusion=[Multi-view deconvolution] " +
"bounding_box=[Define manually] " +
"fused_image=[Save as TIFF stack] " +
"minimal_x=" + minimal_x_deco + " " +
"minimal_y=" + minimal_y_deco + " " +
"minimal_z=" + minimal_z_deco + " " +
"maximal_x=" + maximal_x_deco + " " +
"maximal_y=" + maximal_y_deco + " " +
"maximal_z=" + maximal_z_deco + " " +
"imglib2_container=" + imglib2_container_deco + " " +
"type_of_iteration=[" + type_of_iteration + "] " +
"osem_acceleration=[" + osem_acceleration + "] " +
"number_of_iterations=" + iterations + " " +
// "adjust_blending_parameters " +
"use_tikhonov_regularization " +
"tikhonov_parameter=" + Tikhonov_parameter + " " +
"compute=[" + compute + "] " +
"compute_on=[CPU (Java)] " +
"psf_estimation=[" + psf_estimation + "] " +
"psf_display=[Do not show PSFs] " +
"output_file_directory=" + deco_output_file_directory + " " +
"detections_to_extract_psf_for_channel_0=" + detections_to_extract_psf_for_channel_0 + " " +
"detections_to_extract_psf_for_channel_1=" + detections_to_extract_psf_for_channel_1 + " " + // Dual Channel
"psf_size_x=" + psf_size_x + " " +
"psf_size_y=" + psf_size_y + " " +
"psf_size_z=" + psf_size_z + "");
}
catch ( e ) {
print( "[deconvolution-CPU] caught exception: "+e );
//important to fail the process if exception occurs
runtime.exit(1);
}
/* shutdown */
runtime.exit(0);
// Load Fiji dependencies // Load Fiji dependencies
import ij.IJ; import ij.IJ; // calls imagej
import ij.ImagePlus; import ij.Prefs; // calls imagej settings
import java.lang.Runtime; import java.lang.Runtime;
import java.io.File; import java.io.File;
import java.io.FilenameFilter; import java.io.FilenameFilter;
...@@ -8,17 +8,19 @@ import java.io.FilenameFilter; ...@@ -8,17 +8,19 @@ import java.io.FilenameFilter;
runtime = Runtime.getRuntime(); runtime = Runtime.getRuntime();
System.out.println(runtime.availableProcessors() + " cores available for multi-threading"); System.out.println(runtime.availableProcessors() + " cores available for multi-threading");
System.out.println( "Start to load Parameters:" ); Prefs.setThreads(7); // defines the number of threads allowed
print("Threads: "+Prefs.getThreads()); // prints thread setting in output
System.out.println( "Start to load Parameters:" );
// Select xml // Select xml
image_file_directory = System.getProperty( "image_file_directory" ); image_file_directory = System.getProperty( "image_file_directory" );
merged_xml = System.getProperty( "merged_xml" ); merged_xml = System.getProperty( "merged_xml" );
if ( ! merged_xml.endsWith(".xml") ) if ( ! merged_xml.endsWith(".xml") )
merged_xml = merged.xml + ".xml"; merged_xml = merged.xml + ".xml";
System.out.println( "-------------------------------------------------------" ); System.out.println( "-------------------------------------------------------" );
System.out.println( "Load xml file: " ); System.out.println( "Load xml file: " );
System.out.println( "selected_xml = " + image_file_directory + merged_xml); System.out.println( "selected_xml = " + image_file_directory + merged_xml + ".xml");
// Load general Parameters // Load general Parameters
int parallel_timepoints = Integer.parseInt(System.getProperty( "parallel_timepoints" )); int parallel_timepoints = Integer.parseInt(System.getProperty( "parallel_timepoints" ));
...@@ -27,6 +29,7 @@ process_channel = System.getProperty( "process_channel" ); ...@@ -27,6 +29,7 @@ process_channel = System.getProperty( "process_channel" );
process_illumination = System.getProperty( "process_illumination" ); process_illumination = System.getProperty( "process_illumination" );
process_angle = System.getProperty( "process_angle" ); process_angle = System.getProperty( "process_angle" );
System.out.println( "-------------------------------------------------------" ); System.out.println( "-------------------------------------------------------" );
System.out.println( "General parameters: " ); System.out.println( "General parameters: " );
System.out.println( "timepoint_processed = " + parallel_timepoints ); System.out.println( "timepoint_processed = " + parallel_timepoints );
...@@ -62,8 +65,7 @@ compute = System.getProperty( "compute" ); ...@@ -62,8 +65,7 @@ compute = System.getProperty( "compute" );
psf_estimation = System.getProperty( "psf_estimation" ); psf_estimation = System.getProperty( "psf_estimation" );
iterations = System.getProperty( "iterations" ); iterations = System.getProperty( "iterations" );
deco_output_file_directory = System.getProperty( "deco_output_file_directory" ); deco_output_file_directory = System.getProperty( "deco_output_file_directory" );
detections_to_extract_psf_for_channel_0 = System.getProperty( "detections_to_extract_psf_for_channel_0" );
detections_to_extract_psf_for_channel_1 = System.getProperty( "detections_to_extract_psf_for_channel_1" );
System.out.println( "-------------------------------------------------------" ); System.out.println( "-------------------------------------------------------" );
System.out.println( "Deconvolution settings: " ); System.out.println( "Deconvolution settings: " );
...@@ -75,14 +77,11 @@ System.out.println( "compute = " + compute ); ...@@ -75,14 +77,11 @@ System.out.println( "compute = " + compute );
System.out.println( "psf_estimation = " + psf_estimation ); System.out.println( "psf_estimation = " + psf_estimation );
System.out.println( "number_of_iterations = " + iterations ); System.out.println( "number_of_iterations = " + iterations );
System.out.println( "deco_output_file_directory = " + deco_output_file_directory ); System.out.println( "deco_output_file_directory = " + deco_output_file_directory );
System.out.println( "detections_to_extract_psf_for_channel_0 = " + detections_to_extract_psf_for_channel_0 );
System.out.println( "detections_to_extract_psf_for_channel_1 = " + detections_to_extract_psf_for_channel_1 );
// Search for CUDA // Search for CUDA
directory_cuda = System.getProperty( "directory_cuda" );
System.out.println( "-------------------------------------------------------" ); System.out.println( "-------------------------------------------------------" );
System.out.println( "Loading CUDA directory: " ); System.out.println( "Loading CUDA directory: " );
directory_cuda = System.getProperty( "directory_cuda" );
System.out.println( "directory_cuda = " + directory_cuda ); System.out.println( "directory_cuda = " + directory_cuda );
// PSF Parameters // PSF Parameters
...@@ -96,19 +95,48 @@ System.out.println( "psf_size_x = " + psf_size_x ); ...@@ -96,19 +95,48 @@ System.out.println( "psf_size_x = " + psf_size_x );
System.out.println( "psf_size_y = " + psf_size_y ); System.out.println( "psf_size_y = " + psf_size_y );
System.out.println( "psf_size_z = " + psf_size_z ); System.out.println( "psf_size_z = " + psf_size_z );
// Channel settings
System.out.println( "-------------------------------------------------------" );
System.out.println( "Channel Settings: " );
// Channel setting for Deconvolution
// parses channels and takes from there the number of channels
// parses detections_to_extract_psf_for_channel
channels = System.getProperty( "channels" );
System.out.println( "Channels = " + channels );
detections_to_extract_psf_for_channel = System.getProperty( "detections_to_extract_psf_for_channel" );
System.out.println( "PSF: " + detections_to_extract_psf_for_channel );
// Splits channels and detections_to_extract_psf_for_channel
String delims = "[,]";
String[] channel_token = channels.split(delims);
String[] psf_token = detections_to_extract_psf_for_channel.split(delims);
// Assembles channel_string
StringBuilder channel_string = new StringBuilder();
for (int channel=0; channel < channel_token.length; channel++ )
{
String channel_part = "detections_to_extract_psf_for_channel_" + channel_token[channel] + "=" + psf_token[channel] + " ";
channel_string.append( channel_part );
channel_string.append(" ");
}
System.out.println( channel_string );
// Execute Fiji Plugin // Execute Fiji Plugin
System.out.println( "=======================================================" ); System.out.println( "=======================================================" );
System.out.println( "Starting Deconvolution" ); System.out.println( "Starting Deconvolution" );
try { try {
IJ.run("Fuse/Deconvolve Dataset", IJ.run("Fuse/Deconvolve Dataset",
"select_xml=" + image_file_directory + merged_xml + " " + "select_xml=" + image_file_directory + merged_xml + " " +
"process_angle=[All angles] " + "process_angle=[All angles] " +
"process_channel=[All channels] " + "process_channel=[All channels] " +
"process_illumination=[All illuminations] " + "process_illumination=[All illuminations] " +
"process_timepoint=[" + process_timepoint + "] " + "process_timepoint=[" + process_timepoint + "] " +
"processing_timepoint=[Timepoint " + parallel_timepoints + "] " + "processing_timepoint=[Timepoint " + parallel_timepoints + "] " +
// "processing_timepoint=[Timepoint 0] " +
"type_of_image_fusion=[Multi-view deconvolution] " + "type_of_image_fusion=[Multi-view deconvolution] " +
"bounding_box=[Define manually] " + "bounding_box=[Define manually] " +
"fused_image=[Save as TIFF stack] " + "fused_image=[Save as TIFF stack] " +
...@@ -130,12 +158,10 @@ IJ.run("Fuse/Deconvolve Dataset", ...@@ -130,12 +158,10 @@ IJ.run("Fuse/Deconvolve Dataset",
"psf_estimation=[" + psf_estimation + "] " + "psf_estimation=[" + psf_estimation + "] " +
"psf_display=[Do not show PSFs] " + "psf_display=[Do not show PSFs] " +
"output_file_directory=" + deco_output_file_directory + " " + "output_file_directory=" + deco_output_file_directory + " " +
// "directory=[/sw/users/schmied/packages/Fiji.app.cuda_new/lib/] " + "cuda_directory=[" + directory_cuda + "] " +
"directory=[" + directory_cuda + "] " +
"select_native_library_for_cudafourierconvolution=libFourierConvolutionCUDALib.so " + "select_native_library_for_cudafourierconvolution=libFourierConvolutionCUDALib.so " +
"gpu_1 " + "gpu_1 " +
"detections_to_extract_psf_for_channel_0=" + detections_to_extract_psf_for_channel_0 + " " + channel_string +
// "detections_to_extract_psf_for_channel_1=" + detections_to_extract_psf_for_channel_1 + " " + // Dual Channel
"psf_size_x=" + psf_size_x + " " + "psf_size_x=" + psf_size_x + " " +
"psf_size_y=" + psf_size_y + " " + "psf_size_y=" + psf_size_y + " " +
"psf_size_z=" + psf_size_z + ""); "psf_size_z=" + psf_size_z + "");
......
...@@ -26,25 +26,93 @@ System.out.println( "first_czi_path = " + image_file_directory + first_czi ); ...@@ -26,25 +26,93 @@ System.out.println( "first_czi_path = " + image_file_directory + first_czi );
// Dataset settings // Dataset settings
System.out.println("---------------------------------------------------------"); System.out.println("---------------------------------------------------------");
System.out.println("Dataset:"); System.out.println("Angle Settings:");
angle_1 = System.getProperty( "angle_1" );
angle_2 = System.getProperty( "angle_2" ); // Angle settings
angle_3 = System.getProperty( "angle_3" ); // Parses angles and determines the number of angles
angle_4 = System.getProperty( "angle_4" ); // uses tokens of string angles to assemble the string for angle_string
angle_5 = System.getProperty( "angle_5" ); // via StringBuilder
channel_1 = System.getProperty( "channel_1" ); angles = System.getProperty( "angles" );
channel_2 = System.getProperty( "channel_2" ); System.out.println( "Angles = " + angles );
illumination_1 = System.getProperty( "illumination_1" );
rotation_around = System.getProperty( "rotation_around" ); // Parses string angles
String delims = "[,]";
String[] angle_token = angles.split(delims);
// Builds string using the number of tokens and inserts the tokens in the string
StringBuilder angle_string = new StringBuilder();
String angle_part;
for ( int angle = 0; angle < angle_token.length; angle++) {
int num_angles = angle + 1;
angle_part = "angle_" + num_angles + "=" + angle_token[angle];
angle_string.append(angle_part);
angle_string.append(" ");
}
System.out.println( angle_string );
System.out.println("---------------------------------------------------------");
System.out.println("Channel Settings:");
// Channel settings
// This parses channels and determines the number of channels
// then uses the tokens of channels to assemble the necessary string
// for channel_string via StringBuilder
channels = System.getProperty( "channels" );
System.out.println( "Channel Names = " + channels );
// Parses string channel_names
String delims = "[,]";
String[] channel_token = channels.split(delims);
// Builds string using the number of tokens and inserts the tokens in the string
StringBuilder channel_string = new StringBuilder();
String channel_part;
for ( int channel = 0; channel < channel_token.length; channel++) {
int num_channel = channel + 1;
channel_part = "channel_" + num_channel + "=" + channel_token[channel];
channel_string.append(channel_part);
channel_string.append(" ");
}
System.out.println( "Channel String = " + channel_string );
System.out.println("---------------------------------------------------------");
System.out.println("Illumination Settings:");
// Illuminatin settings
// This parses illumination and determines the number of illuminations
// then uses the tokens of illuminations to assemble the string for
// illum_string via StringBuilder
illumination = System.getProperty( "illumination" );
System.out.println( "Illumination = " + illumination );
// Parses string illumination
String delims = "[,]";
String[] illum_token = illumination.split(delims);
// Builds string using the number of tokens and inserts the tokens in the string
StringBuilder illum_string = new StringBuilder();
String illum_part;
System.out.println( "angle_1 = " + angle_1 ); for ( int illum= 0; illum< illum_token.length; illum++) {
System.out.println( "angle_2 = " + angle_2 ); int num_illum = illum + 1;
System.out.println( "angle_3 = " + angle_3 ); illum_part = "_______illumination_" + num_illum + "=" + illum_token[illum];
System.out.println( "angle_4 = " + angle_4 ); illum_string.append(illum_part);
System.out.println( "angle_5 = " + angle_5 ); illum_string.append(" ");
System.out.println( "channel_1 = " + channel_1 );
System.out.println( "channel_2 = " + channel_2 ); }
System.out.println( "illumination_1 = " + illumination_1 );
System.out.println( illum_string );
System.out.println("---------------------------------------------------------");
System.out.println("Rotation setting:");
rotation_around = System.getProperty( "rotation_around" );
System.out.println( "rotation_around = " + rotation_around ); System.out.println( "rotation_around = " + rotation_around );
// Calibaration // Calibaration
...@@ -63,19 +131,30 @@ System.out.println( "pixel_unit = " + pixel_unit ); ...@@ -63,19 +131,30 @@ System.out.println( "pixel_unit = " + pixel_unit );
// Executes Fiji plugin // Executes Fiji plugin
System.out.println("========================================================="); System.out.println("=========================================================");
System.out.println("Start plugin:"); System.out.println("Start plugin:");
System.out.println("Define Multi-View Dataset type_of_dataset=[Zeiss Lightsheet Z.1 Dataset (LOCI Bioformats)] " +
"xml_filename=" + first_xml_filename + ".xml " +
"browse=" + image_file_directory + first_czi + " " +
"first_czi=" + image_file_directory + first_czi + " " +
angle_string +
channel_string +
illum_string +
"modify_calibration " +
"modify_rotation_axis " +
"pixel_distance_x=" + pixel_distance_x + " " +
"pixel_distance_y=" + pixel_distance_y + " " +
"pixel_distance_z=" + pixel_distance_z + " " +
"pixel_unit=" + pixel_unit + " " +
"rotation_around=" + rotation_around + "");
try {
IJ.run("Define Multi-View Dataset", IJ.run("Define Multi-View Dataset",
"type_of_dataset=[Zeiss Lightsheet Z.1 Dataset (LOCI Bioformats)] " + "type_of_dataset=[Zeiss Lightsheet Z.1 Dataset (LOCI Bioformats)] " +
"xml_filename=" + first_xml_filename + ".xml " + "xml_filename=" + first_xml_filename + ".xml " +
"browse=" + image_file_directory + first_czi + " " + "browse=" + image_file_directory + first_czi + " " +
"first_czi=" + image_file_directory + first_czi + " " + "first_czi=" + image_file_directory + first_czi + " " +
"angle_1=" + angle_1 + " " + angle_string +
"angle_2=" + angle_2 + " " + channel_string +
"angle_3=" + angle_3 + " " + illum_string +
"angle_4=" + angle_4 + " " +
"angle_5=" + angle_5 + " " +
"channel_1=" + channel_1 + " " +
// "channel_2=" + channel_2 + " " + // for dual channel comment out if single channel
"_______illumination_1=" + illumination_1 + " " +
"modify_calibration " + "modify_calibration " +
"modify_rotation_axis " + "modify_rotation_axis " +
"pixel_distance_x=" + pixel_distance_x + " " + "pixel_distance_x=" + pixel_distance_x + " " +
...@@ -83,6 +162,13 @@ IJ.run("Define Multi-View Dataset", ...@@ -83,6 +162,13 @@ IJ.run("Define Multi-View Dataset",
"pixel_distance_z=" + pixel_distance_z + " " + "pixel_distance_z=" + pixel_distance_z + " " +
"pixel_unit=" + pixel_unit + " " + "pixel_unit=" + pixel_unit + " " +
"rotation_around=" + rotation_around + ""); "rotation_around=" + rotation_around + "");
}
catch ( e ) {
print( "[define_czi] caught exception: "+e );
//important to fail the process if exception occurs
runtime.exit(1);
}
/* shutdown */ /* shutdown */
runtime.exit(0); runtime.exit(0);
...@@ -25,7 +25,6 @@ System.out.println( "xml_filename = " + xml_filename ); ...@@ -25,7 +25,6 @@ System.out.println( "xml_filename = " + xml_filename );
System.out.println("========================================================="); System.out.println("=========================================================");
System.out.println("Dataset:"); System.out.println("Dataset:");
timepoints = System.getProperty( "timepoints" ); timepoints = System.getProperty( "timepoints" );
image_file_pattern = System.getProperty( "image_file_pattern" ); image_file_pattern = System.getProperty( "image_file_pattern" );
type_of_dataset = System.getProperty( "type_of_dataset" ); type_of_dataset = System.getProperty( "type_of_dataset" );
multiple_timepoints = System.getProperty( "multiple_timepoints" ); multiple_timepoints = System.getProperty( "multiple_timepoints" );
...@@ -37,7 +36,6 @@ System.out.println( "timepoints = " + timepoints ); ...@@ -37,7 +36,6 @@ System.out.println( "timepoints = " + timepoints );
System.out.println( "image_file_pattern = " + image_file_pattern ); System.out.println( "image_file_pattern = " + image_file_pattern );
System.out.println( "type_of_dataset = " + type_of_dataset ); System.out.println( "type_of_dataset = " + type_of_dataset );
System.out.println( "multiple_timepoints = " + multiple_timepoints ); System.out.println( "multiple_timepoints = " + multiple_timepoints );
System.out.println( "multiple_illumination_directions = " + multiple_illumination_directions ); System.out.println( "multiple_illumination_directions = " + multiple_illumination_directions );
System.out.println( "multiple_angles = " + multiple_angles ); System.out.println( "multiple_angles = " + multiple_angles );
System.out.println( "imglib_container = " + imglib_container ); System.out.println( "imglib_container = " + imglib_container );
...@@ -55,7 +53,7 @@ System.out.println( "pixel_distance_y = " + pixel_distance_y ); ...@@ -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_distance_z = " + pixel_distance_z );
System.out.println( "pixel_unit = " + pixel_unit ); System.out.println( "pixel_unit = " + pixel_unit );
// Channel Switch // Channel switch
System.out.println("========================================================="); System.out.println("=========================================================");
System.out.println("Channel Switch:"); System.out.println("Channel Switch:");
multiple_channels = System.getProperty( "multiple_channels" ); multiple_channels = System.getProperty( "multiple_channels" );
...@@ -63,7 +61,31 @@ System.out.println( "multiple_channels = " + multiple_channels ); ...@@ -63,7 +61,31 @@ System.out.println( "multiple_channels = " + multiple_channels );
channels = System.getProperty( "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] " + "xml_filename=[" + xml_filename + ".xml] " +
"multiple_timepoints=[" + multiple_timepoints + "] " + "multiple_timepoints=[" + multiple_timepoints + "] " +
"multiple_channels=[" + multiple_channels + "] " + "multiple_channels=[" + multiple_channels + "] " +
...@@ -78,11 +100,12 @@ IJ.run("Define Multi-View Dataset , type_of_dataset=[" + type_of_dataset + "] " ...@@ -78,11 +100,12 @@ IJ.run("Define Multi-View Dataset , type_of_dataset=[" + type_of_dataset + "] "
"pixel_distance_x=" + pixel_distance_x + " " + "pixel_distance_x=" + pixel_distance_x + " " +
"pixel_distance_y=" + pixel_distance_y + " " + "pixel_distance_y=" + pixel_distance_y + " " +
"pixel_distance_z=" + pixel_distance_z + " " + "pixel_distance_z=" + pixel_distance_z + " " +
"pixel_unit=" + pixel_unit + ""); "pixel_unit=" + pixel_unit + "");
// Executes Fiji plugin // Executes Fiji plugin
System.out.println("========================================================="); System.out.println("=========================================================");
System.out.println("Start plugin:"); System.out.println("Start plugin:");
try {
IJ.run("Define Multi-View Dataset", IJ.run("Define Multi-View Dataset",
"type_of_dataset=[" + type_of_dataset + "] " + "type_of_dataset=[" + type_of_dataset + "] " +
"xml_filename=[" + xml_filename + ".xml] " + "xml_filename=[" + xml_filename + ".xml] " +
...@@ -100,7 +123,14 @@ IJ.run("Define Multi-View Dataset", ...@@ -100,7 +123,14 @@ IJ.run("Define Multi-View Dataset",
"pixel_distance_y=" + pixel_distance_y + " " + "pixel_distance_y=" + pixel_distance_y + " " +
"pixel_distance_z=" + pixel_distance_z + " " + "pixel_distance_z=" + pixel_distance_z + " " +
"pixel_unit=" + pixel_unit + ""); "pixel_unit=" + pixel_unit + "");
}
catch ( e ) {
print( "[define_output] caught exception: "+e );
//important to fail the process if exception occurs
runtime.exit(1);
}
/* shutdown */ /* shutdown */
runtime.exit(0); runtime.exit(0);
......
...@@ -24,28 +24,91 @@ System.out.println( "xml_filename = " + xml_filename ); ...@@ -24,28 +24,91 @@ System.out.println( "xml_filename = " + xml_filename );
// Dataset settings // Dataset settings
System.out.println("========================================================="); System.out.println("=========================================================");
System.out.println("Dataset:"); System.out.println("Dataset:");
timepoints = System.getProperty( "timepoints" );
channels = System.getProperty( "channels" );
acquisition_angles = System.getProperty( "acquisition_angles" );
image_file_pattern = System.getProperty( "image_file_pattern" ); image_file_pattern = System.getProperty( "image_file_pattern" );
type_of_dataset = System.getProperty( "type_of_dataset" ); type_of_dataset = System.getProperty( "type_of_dataset" );
timepoints = System.getProperty( "timepoints" );
angles = System.getProperty( "angles" );
System.out.println( "image_file_pattern = " + image_file_pattern );
System.out.println( "type_of_dataset = " + type_of_dataset );
System.out.println( "timepoints = " + timepoints );
System.out.println( "angles = " + angles );
multiple_timepoints = System.getProperty( "multiple_timepoints" ); multiple_timepoints = System.getProperty( "multiple_timepoints" );
multiple_channels = System.getProperty( "multiple_channels" ); multiple_channels = System.getProperty( "multiple_channels" );
multiple_illumination_directions = System.getProperty( "multiple_illumination_directions" ); multiple_illumination_directions = System.getProperty( "multiple_illumination_directions" );
multiple_angles = System.getProperty( "multiple_angles" ); multiple_angles = System.getProperty( "multiple_angles" );
imglib_container = System.getProperty( "imglib_container" ); imglib_container = System.getProperty( "imglib_container" );
System.out.println( "timepoints = " + timepoints );
System.out.println( "channels = " + channels );
System.out.println( "acquisition_angles = " + acquisition_angles );
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_timepoints = " + multiple_timepoints );
System.out.println( "multiple_channels = " + multiple_channels ); System.out.println( "multiple_channels = " + multiple_channels );
System.out.println( "multiple_illumination_directions = " + multiple_illumination_directions ); System.out.println( "multiple_illumination_directions = " + multiple_illumination_directions );
System.out.println( "multiple_angles = " + multiple_angles ); System.out.println( "multiple_angles = " + multiple_angles );
System.out.println( "imglib_container = " + imglib_container ); System.out.println( "imglib_container = " + imglib_container );
System.out.println("---------------------------------------------------------");
System.out.println("Channel setting:");
// Channel switch: parses channels and determines if Single or Multi Channel
// assembles the appropriate string for the channel setting
channels = System.getProperty( "channels" );
String channel_string = null;
String delims = "[,]";
String[] channel_token = channels.split(delims);
if (channels.equalsIgnoreCase(""))
{
System.out.println("Warning: There are no channels set");
}
else if ( channel_token.length == 1 )
{
channel_string="";
System.out.println("Single Channel");
}
else if ( channel_token.length > 1)
{
channel_string = "channels_=" + channels + " ";
System.out.println("Multi Channel");
}
System.out.println( "Channels = " + channel_string );
System.out.println("---------------------------------------------------------");
System.out.println("Illumination setting:");
// Illuminatin switch: parses illumination and determines if there is a single
// or multiple illumination sides and then assembles the illum_string
illumination = System.getProperty( "illumination" );
String illum_string = null;
String delims = "[,]";
String[] illum_token = illumination.split(delims);
if (illumination.equalsIgnoreCase(""))
{
System.out.println("Warning: There are no illuminations set");
}
else if ( illum_token.length == 1 )
{
illum_string="";
System.out.println("One illumination side or fused illumination");
}
else if ( illum_token.length > 1)
{
illum_string = "illumination_=" + illumination + " ";
System.out.println("Dual Illumination sides");
}
System.out.println( "Illuminations = " + illum_string );
// Calibaration // Calibaration
System.out.println("========================================================="); System.out.println("=========================================================");
System.out.println("Calibration:"); System.out.println("Calibration:");
...@@ -59,9 +122,30 @@ System.out.println( "pixel_distance_y = " + pixel_distance_y ); ...@@ -59,9 +122,30 @@ System.out.println( "pixel_distance_y = " + pixel_distance_y );
System.out.println( "pixel_distance_z = " + pixel_distance_z ); System.out.println( "pixel_distance_z = " + pixel_distance_z );
System.out.println( "pixel_unit = " + pixel_unit ); System.out.println( "pixel_unit = " + pixel_unit );
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 + "] " +
"_____multiple_illumination_directions=[" + multiple_illumination_directions + "] " +
"multiple_angles=[" + multiple_angles + "] " +
"image_file_directory=" + image_file_directory + " " +
"image_file_pattern=" + image_file_pattern + " " +
"timepoints_=" + timepoints + " " +
channel_string +
illum_string +
"acquisition_angles_=" + acquisition_angles + " " +
"calibration_type=[Same voxel-size for all views] calibration_definition=[User define voxel-size(s)]" + " " +
"imglib2_data_container=[" + imglib_container + "] " +
"pixel_distance_x=" + pixel_distance_x + " " +
"pixel_distance_y=" + pixel_distance_y + " " +
"pixel_distance_z=" + pixel_distance_z + " " +
"pixel_unit=" + pixel_unit + "");
// Executes Fiji plugin // Executes Fiji plugin
System.out.println("========================================================="); System.out.println("=========================================================");
System.out.println("Start plugin:"); System.out.println("Start plugin:");
try {
IJ.run("Define Multi-View Dataset", IJ.run("Define Multi-View Dataset",
"type_of_dataset=[" + type_of_dataset + "] " + "type_of_dataset=[" + type_of_dataset + "] " +
"xml_filename=[" + xml_filename + ".xml] " + "xml_filename=[" + xml_filename + ".xml] " +
...@@ -72,15 +156,23 @@ IJ.run("Define Multi-View Dataset", ...@@ -72,15 +156,23 @@ IJ.run("Define Multi-View Dataset",
"image_file_directory=" + image_file_directory + " " + "image_file_directory=" + image_file_directory + " " +
"image_file_pattern=" + image_file_pattern + " " + "image_file_pattern=" + image_file_pattern + " " +
"timepoints_=" + timepoints + " " + "timepoints_=" + timepoints + " " +
// "channels_=" + channels + " " + // for dual channel comment out if single channel channel_string +
"acquisition_angles_=" + acquisition_angles + " " + illum_string +
"acquisition_angles_=" + angles + " " +
"calibration_type=[Same voxel-size for all views] calibration_definition=[User define voxel-size(s)]" + " " + "calibration_type=[Same voxel-size for all views] calibration_definition=[User define voxel-size(s)]" + " " +
"imglib2_data_container=[" + imglib_container + "] " + "imglib2_data_container=[" + imglib_container + "] " +
"pixel_distance_x=" + pixel_distance_x + " " + "pixel_distance_x=" + pixel_distance_x + " " +
"pixel_distance_y=" + pixel_distance_y + " " + "pixel_distance_y=" + pixel_distance_y + " " +
"pixel_distance_z=" + pixel_distance_z + " " + "pixel_distance_z=" + pixel_distance_z + " " +
"pixel_unit=" + pixel_unit + ""); "pixel_unit=" + pixel_unit + "");
}
catch ( e ) {
print( "[define_tif_zip] caught exception: "+e );
//important to fail the process if exception occurs
runtime.exit(1);
}
/* shutdown */ /* shutdown */
runtime.exit(0); runtime.exit(0);
......
...@@ -45,31 +45,33 @@ subsampling_factors = System.getProperty( "subsampling_factors" ); ...@@ -45,31 +45,33 @@ subsampling_factors = System.getProperty( "subsampling_factors" );
hdf5_chunk_sizes = System.getProperty( "hdf5_chunk_sizes" ); hdf5_chunk_sizes = System.getProperty( "hdf5_chunk_sizes" );
timepoints_per_partition = System.getProperty( "timepoints_per_partition" ); timepoints_per_partition = System.getProperty( "timepoints_per_partition" );
setups_per_partition = System.getProperty( "setups_per_partition" ); setups_per_partition = System.getProperty( "setups_per_partition" );
run_only_job_number = System.getProperty( "run_only_job_number" );
System.out.println( "subsampling_factors=" + subsampling_factors); System.out.println( "subsampling_factors=" + subsampling_factors);
System.out.println( "hdf5_chunk_sizes=" + hdf5_chunk_sizes ); System.out.println( "hdf5_chunk_sizes=" + hdf5_chunk_sizes );
System.out.println( "timepoints_per_partition=" + timepoints_per_partition ); System.out.println( "timepoints_per_partition=" + timepoints_per_partition );
System.out.println( "setups_per_partition=" + setups_per_partition ); System.out.println( "setups_per_partition=" + setups_per_partition );
int run_only_job_number = Integer.parseInt( System.getProperty( "run_only_job_number" ) );
System.out.println( "run_only_job_number=" + run_only_job_number ); System.out.println( "run_only_job_number=" + run_only_job_number );
// Activate cluster processing // Activate cluster processing
System.out.println("========================================================="); System.out.println("=========================================================");
try{
System.out.println("Cluster setting:"); System.out.println("Cluster setting:");
try {
IJ.run("Toggle Cluster Processing", "display_cluster"); IJ.run("Toggle Cluster Processing", "display_cluster");
} }
catch ( e ) { catch ( e ) {
print( "[deconvolution-GPU] caught exception: "+e );
//important to fail the process if exception occurs print( "[export::cluster setting] caught exception: "+e );
runtime.exit(1); //important to fail the process if exception occurs
runtime.exit(1);
} }
// Executes Fiji plugin // Executes Fiji plugin
System.out.println("========================================================="); System.out.println("=========================================================");
System.out.println("Start plugin:"); System.out.println("Start plugin:");
try{
try {
IJ.run("As HDF5", IJ.run("As HDF5",
"select_xml=" + image_file_directory + first_xml_filename + ".xml " + "select_xml=" + image_file_directory + first_xml_filename + ".xml " +
"resave_angle=[" + resave_angle + "] " + "resave_angle=[" + resave_angle + "] " +
...@@ -86,11 +88,14 @@ IJ.run("As HDF5", ...@@ -86,11 +88,14 @@ IJ.run("As HDF5",
"use_deflate_compression " + "use_deflate_compression " +
"export_path=" + image_file_directory + hdf5_xml_filename ); "export_path=" + image_file_directory + hdf5_xml_filename );
} }
catch ( e ) { catch ( e ) {
print( "[deconvolution-GPU] caught exception: "+e );
//important to fail the process if exception occurs print( "[export::resaving] caught exception: "+e );
runtime.exit(1); //important to fail the process if exception occurs
runtime.exit(1);
} }
/* shutdown */ /* shutdown */
System.exit(0); System.exit(0);
...@@ -54,26 +54,22 @@ System.out.println( "setups_per_partition=" + setups_per_partition ); ...@@ -54,26 +54,22 @@ System.out.println( "setups_per_partition=" + setups_per_partition );
System.out.println( "run_only_job_number=" + run_only_job_number ); System.out.println( "run_only_job_number=" + run_only_job_number );
// Add a switch for choosing between 16 or 32 bit // Add a switch for choosing between 16 or 32 bit
output_data_type = System.getProperty( "output_data_type" ); output_data_type = System.getProperty( "output_data_type" );
System.out.println( "Output Datatype = " + output_data_type ); System.out.println( "Output Datatype = " + output_data_type );
convert_32bit = System.getProperty( "convert_32bit" );
if ( output_data_type.equalsIgnoreCase( "16Bit" ) ) if ( output_data_type.equalsIgnoreCase( "32Bit" ) )
{ {
data_string = "convert_32bit=convert_32bit"; data_string = "convert_32bit=" + convert_32bit;
} }
else if ( output_data_type.equalsIgnoreCase( "32Bit" ) ) else if ( output_data_type.equalsIgnoreCase( "16Bit" ) )
{ {
data_string = ""; data_string = "";
} }
System.out.println( "Data string = " + data_string ); System.out.println( "Data string = " + data_string );
// Activate cluster processing // Activate cluster processing
System.out.println("========================================================="); System.out.println("=========================================================");
System.out.println("Cluster setting:"); System.out.println("Cluster setting:");
...@@ -81,7 +77,7 @@ try{ ...@@ -81,7 +77,7 @@ try{
IJ.run("Toggle Cluster Processing", "display_cluster"); IJ.run("Toggle Cluster Processing", "display_cluster");
} }
catch ( e ) { catch ( e ) {
print( "[deconvolution-GPU] caught exception: "+e ); print( "[export_output::cluster setting] caught exception: "+e );
//important to fail the process if exception occurs //important to fail the process if exception occurs
runtime.exit(1); runtime.exit(1);
} }
...@@ -105,11 +101,10 @@ IJ.run("As HDF5", ...@@ -105,11 +101,10 @@ IJ.run("As HDF5",
"run_only_job_number=" + run_only_job_number + " " + "run_only_job_number=" + run_only_job_number + " " +
"use_deflate_compression " + "use_deflate_compression " +
"export_path=" + image_file_directory + hdf5_xml_filename + " " + "export_path=" + image_file_directory + hdf5_xml_filename + " " +
data_string + data_string + "");
);
} }
catch ( e ) { catch ( e ) {
print( "[deconvolution-GPU] caught exception: "+e ); print( "[export_output::resaving] caught exception: "+e );
//important to fail the process if exception occurs //important to fail the process if exception occurs
runtime.exit(1); runtime.exit(1);
} }
......
...@@ -19,6 +19,7 @@ System.out.println( "Start to load Parameters:" ); ...@@ -19,6 +19,7 @@ System.out.println( "Start to load Parameters:" );
System.out.println( "-------------------------------------------------------" ); System.out.println( "-------------------------------------------------------" );
System.out.println( "Load xml file: " ); System.out.println( "Load xml file: " );
image_file_directory = System.getProperty( "image_file_directory" ); image_file_directory = System.getProperty( "image_file_directory" );
merged_xml = System.getProperty( "merged_xml" ); merged_xml = System.getProperty( "merged_xml" );
if ( ! merged_xml.endsWith(".xml") ) if ( ! merged_xml.endsWith(".xml") )
merged_xml = merged.xml + ".xml"; merged_xml = merged.xml + ".xml";
...@@ -28,7 +29,7 @@ System.out.println( "xml_path=" + image_file_directory + merged_xml + ".xml" ); ...@@ -28,7 +29,7 @@ System.out.println( "xml_path=" + image_file_directory + merged_xml + ".xml" );
// Load general Parameters // Load general Parameters
System.out.println( "-------------------------------------------------------" ); System.out.println( "-------------------------------------------------------" );
System.out.println( "General parameters: " ); System.out.println( "General parameters: " );
int parallel_timepoints = Integer.parseInt(System.getProperty( "parallel_timepoints" )); int parallel_timepoints = Integer.parseInt( System.getProperty( "parallel_timepoints" ) );
process_timepoint = System.getProperty( "process_timepoint" ); process_timepoint = System.getProperty( "process_timepoint" );
process_channel = System.getProperty( "process_channel" ); process_channel = System.getProperty( "process_channel" );
process_illumination = System.getProperty( "process_illumination" ); process_illumination = System.getProperty( "process_illumination" );
...@@ -74,7 +75,6 @@ System.out.println( "imglib2_data_container=" + imglib2_data_container ); ...@@ -74,7 +75,6 @@ System.out.println( "imglib2_data_container=" + imglib2_data_container );
// Execute Fiji Plugin // Execute Fiji Plugin
System.out.println( "=======================================================" ); System.out.println( "=======================================================" );
System.out.println( "Starting Fusion" ); System.out.println( "Starting Fusion" );
try{ try{
IJ.run("Fuse/Deconvolve Dataset", IJ.run("Fuse/Deconvolve Dataset",
"select_xml=" + image_file_directory + merged_xml + " " + "select_xml=" + image_file_directory + merged_xml + " " +
...@@ -98,17 +98,16 @@ IJ.run("Fuse/Deconvolve Dataset", ...@@ -98,17 +98,16 @@ IJ.run("Fuse/Deconvolve Dataset",
"imglib2_container=" + imglib2_container_fusion + " " + "imglib2_container=" + imglib2_container_fusion + " " +
"process_views_in_paralell=All " + "process_views_in_paralell=All " +
"interpolation=[" + interpolation + "] " + "interpolation=[" + interpolation + "] " +
"blend " + //"blend " +
"content-based " + //"content-based " +
"output_file_directory=" + image_file_directory + " " + "output_file_directory=" + image_file_directory + " " +
"lossless " + "lossless " +
"imglib2_data_container=[" + imglib2_data_container + "]"); "imglib2_data_container=[" + imglib2_data_container + "]");
} }
catch ( e ) { catch ( e ) {
print( "[deconvolution-GPU] caught exception: "+e ); print( "[Contentbased multiview fusion] caught exception: "+e );
//important to fail the process if exception occurs //important to fail the process if exception occurs
runtime.exit(1); runtime.exit(1);
} }
/* shutdown */ /* shutdown */
runtime.exit(0); runtime.exit(0);
This diff is collapsed.
...@@ -16,30 +16,27 @@ print("Threads: "+Prefs.getThreads()); // prints thread setting in output ...@@ -16,30 +16,27 @@ print("Threads: "+Prefs.getThreads()); // prints thread setting in output
System.out.println("---------------------------------------------------------"); System.out.println("---------------------------------------------------------");
System.out.println("Xml file:"); System.out.println("Xml file:");
xml_path = System.getProperty( "image_file_directory" );
xml_path = System.getProperty( "image_file_directory" ); xml_path = System.getProperty( "image_file_directory" );
merged_xml = System.getProperty( "merged_xml" ); merged_xml = System.getProperty( "merged_xml" );
if ( ! merged_xml.endsWith(".xml") ) if ( ! merged_xml.endsWith(".xml") )
merged_xml = merged.xml + ".xml"; merged_xml = merged.xml + ".xml";
System.out.println( "selected_xml = " + xml_path + merged_xml + ".xml"); System.out.println( "selected_xml = " + xml_path + merged_xml );
// General Registration Parameters and Channel Settings // General Registration Parameters and Channel Settings
System.out.println("---------------------------------------------------------"); System.out.println("---------------------------------------------------------");
System.out.println( "General parameters: " ); System.out.println( "General parameters: " );
timelapse_process_timepoints = System.getProperty( "timelapse_process_timepoints" ); timelapse_process_timepoints = System.getProperty( "timelapse_process_timepoints" );
process_channel_timelapse = System.getProperty( "process_channel_timelapse" ); reg_process_illumination = System.getProperty( "reg_process_illumination" );
process_illumination = System.getProperty( "process_illumination" ); reg_process_angle = System.getProperty( "reg_process_angle" );
process_angle = System.getProperty( "process_angle" );
channel_1 = System.getProperty( "channel_1" );
channel_2 = System.getProperty( "channel_2" );
System.out.println( "process_timepoints = " + timelapse_process_timepoints ); System.out.println( "process_timepoints = " + timelapse_process_timepoints );
System.out.println( "process_channel = " + process_channel_timelapse ); System.out.println( "process_illumination = " + reg_process_illumination );
System.out.println( "process_illumination = " + process_illumination ); System.out.println( "process_angle = " + reg_process_angle );
System.out.println( "process_angle = " + process_angle );
System.out.println( "channel_1 = " + channel_1 );
System.out.println( "channel_2 = " + channel_2 );
// Timelapse registration Parameter // Timelapse registration Parameter
System.out.println("---------------------------------------------------------"); System.out.println("---------------------------------------------------------");
System.out.println( "Timelapse Registration: " ); System.out.println( "Timelapse Registration: " );
...@@ -49,13 +46,11 @@ System.out.println( "reference_timepoint=" + reference_timepoint ); ...@@ -49,13 +46,11 @@ System.out.println( "reference_timepoint=" + reference_timepoint );
type_of_registration_timelapse = System.getProperty( "type_of_registration_timelapse" ); type_of_registration_timelapse = System.getProperty( "type_of_registration_timelapse" );
registration_algorithm = System.getProperty( "registration_algorithm" ); registration_algorithm = System.getProperty( "registration_algorithm" );
reg_1_interest_points_channel = System.getProperty( "reg_1_interest_points_channel" );
reg_2_interest_points_channel = System.getProperty( "reg_2_interest_points_channel" ); // Dual Channel
System.out.println( "type_of_registration = " + type_of_registration_timelapse ); System.out.println( "type_of_registration = " + type_of_registration_timelapse );
System.out.println( "registration_algorithm = " + registration_algorithm ); System.out.println( "registration_algorithm = " + registration_algorithm );
System.out.println( "interest_points_channel_" + channel_1 + " = " + reg_1_interest_points_channel );
System.out.println( "interest_points_channel_" + channel_2 + " = " + reg_2_interest_points_channel );
transformation_model = System.getProperty( "transformation_model" ); transformation_model = System.getProperty( "transformation_model" );
model_to_regularize_with = System.getProperty( "model_to_regularize_with" ); model_to_regularize_with = System.getProperty( "model_to_regularize_with" );
...@@ -63,25 +58,120 @@ float lambda = Float.parseFloat( System.getProperty( "lambda" ) ); ...@@ -63,25 +58,120 @@ float lambda = Float.parseFloat( System.getProperty( "lambda" ) );
int allowed_error_for_ransac = Integer.parseInt( System.getProperty( "allowed_error_for_ransac" ) ); int allowed_error_for_ransac = Integer.parseInt( System.getProperty( "allowed_error_for_ransac" ) );
significance = System.getProperty( "significance" ); significance = System.getProperty( "significance" );
System.out.println( "transformation = " + transformation ); System.out.println( "transformation = " + transformation_model );
System.out.println( "model_to_regularize_with = " + model_to_regularize_with ); System.out.println( "model_to_regularize_with = " + model_to_regularize_with );
System.out.println( "lambda = " + lambda ); System.out.println( "lambda = " + lambda );
System.out.println( "allowed_error_for_ransac = " + allowed_error_for_ransac ); System.out.println( "allowed_error_for_ransac = " + allowed_error_for_ransac );
System.out.println( "significance = " + significance ); System.out.println( "significance = " + significance );
// Timelapse registration Parameter
System.out.println("---------------------------------------------------------");
System.out.println( "Channel Settings: " );
// Channel Setting Registration
// parses channels and takes from there the number of channels
// takes from reg_process_channel if it is Single Channel, Dual Channel or Dual Channel
// were one Channel contains the beads
// from this it decides which string to assemble
reg_process_channel = System.getProperty( "reg_process_channel" );
System.out.println( "process_channel = " + reg_process_channel );
channels = System.getProperty( "channels" );
System.out.println( "Channels = " + channels );
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[] 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");
}
// 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 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 );
System.out.println( "=======================================================" ); System.out.println( "=======================================================" );
System.out.println( "Starting Timelapse Registration" ); System.out.println( "Starting Timelapse Registration" );
System.out.println( "Register Dataset based on Interest Points , select_xml=" + xml_path + merged_xml + " " +
"process_angle=[" + reg_process_angle + "] " +
"process_channel=[" + reg_process_channel + "] " +
"process_illumination=[" + reg_process_illumination + "] " +
"process_timepoint=[" + timelapse_process_timepoints + "] " +
"registration_algorithm=[" + registration_algorithm + "] " +
"type_of_registration=[" + type_of_registration_timelapse + "] " +
reg_multi_channel_string +
reg_single_channel_string +
// "interest_points_channel_" + channel_1 + "=" + reg_1_interest_points_channel + " " +
// "interest_points_channel_" + channel_2 + "=" + reg_2_interest_points_channel + " " + // Dual Channel
"reference=" + reference_timepoint + " " +
"consider_each_timepoint_as_rigid_unit " +
"transformation=" + transformation_model + " " +
"regularize_model " +
"model_to_regularize_with=" + model_to_regularize_with + " " +
"lamba=" + lambda + " " +
"allowed_error_for_ransac=" + allowed_error_for_ransac + " " +
"significance=" + significance + "");
try { try {
IJ.run("Register Dataset based on Interest Points", IJ.run("Register Dataset based on Interest Points",
"select_xml=" + xml_path + merged_xml + " " + "select_xml=" + xml_path + merged_xml + " " +
"process_angle=[" + process_angle + "] " + "process_angle=[" + reg_process_angle + "] " +
"process_channel=[" + process_channel_timelapse + "] " + "process_channel=[" + reg_process_channel + "] " +
"process_illumination=[" + process_illumination + "] " + "process_illumination=[" + reg_process_illumination + "] " +
"process_timepoint=[" + timelapse_process_timepoints + "] " + "process_timepoint=[" + timelapse_process_timepoints + "] " +
"registration_algorithm=[" + registration_algorithm + "] " + "registration_algorithm=[" + registration_algorithm + "] " +
"type_of_registration=[" + type_of_registration_timelapse + "] " + "type_of_registration=[" + type_of_registration_timelapse + "] " +
"interest_points_channel_" + channel_1 + "=" + reg_1_interest_points_channel + " " + reg_multi_channel_string +
reg_single_channel_string +
// "interest_points_channel_" + channel_1 + "=" + reg_1_interest_points_channel + " " +
// "interest_points_channel_" + channel_2 + "=" + reg_2_interest_points_channel + " " + // Dual Channel // "interest_points_channel_" + channel_2 + "=" + reg_2_interest_points_channel + " " + // Dual Channel
"reference=" + reference_timepoint + " " + "reference=" + reference_timepoint + " " +
"consider_each_timepoint_as_rigid_unit " + "consider_each_timepoint_as_rigid_unit " +
...@@ -94,11 +184,10 @@ IJ.run("Register Dataset based on Interest Points", ...@@ -94,11 +184,10 @@ IJ.run("Register Dataset based on Interest Points",
} }
catch ( e ) { catch ( e ) {
print( "[deconvolution-GPU] caught exception: "+e ); print( "[registration::timelapse] caught exception: "+e );
//important to fail the process if exception occurs //important to fail the process if exception occurs
runtime.exit(1); runtime.exit(1);
} }
/* shutdown */ /* shutdown */
runtime.exit(0); runtime.exit(0);
common: common: {
{
# directory that contains the bean shell scripts # directory that contains the bean shell scripts
bsh_directory: "/home/steinbac/development/schmied-snakemake-workflows/spim_registration/timelapse/", bsh_directory: "/projects/pilot_spim/Christopher/snakemake-workflows/spim_registration/timelapse/",
directory_cuda: "/lustre/projects/hpcsupport/steinbac/unicore/christopher/unicore_jobs/Fiji.app.cuda_new/lib/", directory_cuda: "/sw/users/schmied/packages/2015-06-08_Fiji.app.cuda/lib/",
fiji-app: "/projects/hpcsupport/steinbac/unicore/christopher/unicore_jobs/Fiji.app.cuda_new/ImageJ-linux64", fiji-app: "/sw/users/schmied/packages/2015-06-08_Fiji.app.cuda/ImageJ-linux64",
fiji-prefix: "/sw/bin/xvfb-run -a", fiji-prefix: "/sw/bin/xvfb-run -a",
first_xml_filename: "test_unicore", first_xml_filename: "test_unicore",
fusion_switch: "deconvolution",
hdf5_xml_filename: '"hdf5_test_unicore"', hdf5_xml_filename: '"hdf5_test_unicore"',
merged_xml: "hdf5_test_unicore_merge", merged_xml: "hdf5_test_unicore_merge",
ntimepoints: 5 ntimepoints: 5,
} angles: "0,72,144,216,288",
channels: "green",
deconvolution: illumination: "0",
{
Tikhonov_parameter: '0.0006',
bsh_file: "deconvolution_GPU.bsh",
compute: '"in 512x512x512 blocks"',
compute_on: '"GPU (Nvidia CUDA via JNA)"',
detections_to_extract_psf_for_channel_0: '"beads"',
detections_to_extract_psf_for_channel_1: '"beads"',
imglib2_container: '"ArrayImg"',
iterations: '5',
maximal_x: '509',
maximal_y: '970',
maximal_z: '243',
minimal_x: '95',
minimal_y: '-8',
minimal_z: '-174',
osem_acceleration: '"1 (balanced)"',
process_angle: '"All angles"',
process_channel: '"All channels"',
process_illumination: '"All illuminations"',
process_timepoint: '"Single Timepoint (Select from List)"',
psf_estimation: '"Extract from beads"',
psf_size_x: '19',
psf_size_y: '19',
psf_size_z: '25',
type_of_iteration: '"Efficient Bayesian - Optimization I (fast, precise)"'
}
define_xml_czi:
{
angle_1: '0',
angle_2: '72',
angle_3: '144',
angle_4: '216',
angle_5: '288',
bsh_file: "define_czi.bsh",
channel_1: "green",
channel_2: "red",
first_czi: "2015-04-11_LZ2_Stock68_3.czi",
illumination_1: '0',
pixel_distance_x: '0.28590106964', pixel_distance_x: '0.28590106964',
pixel_distance_y: '0.28590106964', pixel_distance_y: '0.28590106964',
pixel_distance_z: '1.50000', pixel_distance_z: '1.50000',
pixel_unit: "um", pixel_unit: "um",
rotation_around: "X-Axis" fusion_switch: "deconvolution"
# fusion_switch: "fusion"
}
define_xml_czi: {
first_czi: "2015-04-11_LZ2_Stock68_3.czi",
rotation_around: "X-Axis",
bsh_file: "define_czi.bsh"
} }
define_xml_tif: define_xml_tif: {
{
acquisition_angles: '0,72,144,216,288',
bsh_file: "define_tif_zip.bsh",
channels: '0',
image_file_pattern: 'img_TL{{t}}_Angle{{a}}.tif', image_file_pattern: 'img_TL{{t}}_Angle{{a}}.tif',
imglib_container: '"ArrayImg (faster)"', imglib_container: '"ArrayImg (faster)"',
multiple_angles: '"YES (one file per angle)"', multiple_angles: '"YES (one file per angle)"',
multiple_channels: '"NO (one channel)"', multiple_channels: '"NO (one channel)"',
multiple_illumination_directions: '"NO (one illumination direction)"', multiple_illumination_directions: '"NO (one illumination direction)"',
multiple_timepoints: '"YES (one file per time-point)"', multiple_timepoints: '"YES (one file per time-point)"',
pixel_distance_x: '0.28590106964', type_of_dataset: '"Image Stacks (ImageJ Opener)"',
pixel_distance_y: '0.28590106964', bsh_file: "define_tif_zip.bsh"
pixel_distance_z: '1.50000', }
pixel_unit: "um",
type_of_dataset: '"Image Stacks (ImageJ Opener)"' resave_hdf5: {
hdf5_chunk_sizes: '"{{ {{32,32,4}}, {{32,32,4}}, {{16,16,16}}, {{16,16,16}} }}"',
resave_angle: '"All angles"',
resave_channel: '"All channels"',
resave_illumination: '"All illuminations"',
resave_timepoint: '"All Timepoints"',
setups_per_partition: '0',
subsampling_factors: '"{{ {{1,1,1}}, {{2,2,1}}, {{4,4,1}}, {{8,8,1}} }}"',
timepoints_per_partition: '1',
bsh_file: "export.bsh"
} }
registration: {
external_transform: # "Single Channel" is not a valid choice for "Process_channel"
{ reg_process_channel: '"All channels"',
angle: '"All angles"', reg_processing_channel: '"green"',
apply_transformation: '"Current view transformations reg_interest_points_channel: '"beads"',
(appends to current transforms)"', reg_radius_1: '2',
bsh_file: "transform.bsh", reg_radius_2: '3',
channel: '"All channels"', reg_threshold: '0.005',
define_mode_transform: '"Matrix"', initial_sigma: '1.8',
illumination: '"All illuminations"', threshold_gaussian: '0.0080',
matrix_transform: '"0.5, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0"', type_of_detection: '"Difference-of-Mean (Integral image based)"',
timepoint: '"All Timepoints"', label_interest_points: '"beads"',
transformation: '"Rigid"' reg_process_timepoint: '"Single Timepoint (Select from List)"',
reg_process_angle: '"All angles"',
reg_process_illumination: '"All illuminations"',
subpixel_localization: '"3-dimensional quadratic fit"',
detection_min_max: "find_maxima",
type_of_registration: '"Register timepoints individually"',
algorithm: '"Fast 3d geometric hashing (rotation invariant)"',
transformation_model: "Affine",
allowed_error_for_ransac: '5',
significance: '10',
fix_tiles: '"Fix first tile"',
map_back_tiles: '"Map back to first tile using rigid model"',
model_to_regularize_with: "Rigid",
lambda: '0.10',
imglib_container: '"ArrayImg (faster)"',
bsh_file: "registration.bsh"
}
xml_merge: {
bsh_file: "xml_merge.bsh"
}
timelapse: {
reference_timepoint: '0',
type_of_registration_timelapse: '"Match against one reference timepoint (no global optimization)"',
timelapse_process_timepoints: '"All Timepoints"',
bsh_file: "timelapse_registration.bsh"
}
Dublicate_transformations: {
source_dublication: "red",
target_dublication: "green",
bsh_file: "dublicate_channel.bsh"
} }
fusion: { fusion: {
bsh_file: "fusion.bsh", bsh_file: "fusion.bsh",
downsample: '1', downsample: '4',
fused_image: '"Append to current XML Project"', fused_image: '"Append to current XML Project"',
imglib2_container_fusion: '"ArrayImg"', imglib2_container_fusion: '"ArrayImg"',
imglib2_data_container: '"ArrayImg (faster)"', imglib2_data_container: '"ArrayImg (faster)"',
interpolation: '"Linear Interpolation"', interpolation: '"Linear Interpolation"',
maximal_x: '1019',
maximal_y: '1941',
maximal_z: '486',
minimal_x: '190', minimal_x: '190',
minimal_y: '-16', minimal_y: '-16',
minimal_z: '-348', minimal_z: '-348',
maximal_x: '1019',
maximal_y: '1941',
maximal_z: '486',
pixel_type: '"16-bit unsigned integer"', pixel_type: '"16-bit unsigned integer"',
process_angle: '"All angles"', process_angle: '"All angles"',
process_channel: '"All channels"', process_channel: '"All channels"',
...@@ -113,77 +116,71 @@ fusion: { ...@@ -113,77 +116,71 @@ fusion: {
process_views_in_paralell: '"All"', process_views_in_paralell: '"All"',
xml_output: '"Save every XML with user-provided unique id"' xml_output: '"Save every XML with user-provided unique id"'
} }
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"',
matrix_transform: '"0.5, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0"',
transformation: '"Rigid"',
bsh_file: "transform.bsh"
}
deconvolution: {
iterations: '1',
minimal_x_deco: '190',
minimal_y_deco: '-16',
minimal_z_deco: '-348',
maximal_x_deco: '1019',
maximal_y_deco: '1941',
maximal_z_deco: '486',
detections_to_extract_psf_for_channel: '"beads"',
process_timepoint: '"Single Timepoint (Select from List)"',
process_angle: '"All angles"',
process_channel: '"All channels"',
process_illumination: '"All illuminations"',
Tikhonov_parameter: '0.0006',
compute: '"in 512x512x512 blocks"',
compute_on: '"GPU (Nvidia CUDA via JNA)"',
imglib2_container: '"ArrayImg"',
osem_acceleration: '"1 (balanced)"',
psf_estimation: '"Extract from beads"',
psf_size_x: '19',
psf_size_y: '19',
psf_size_z: '25',
type_of_iteration: '"Efficient Bayesian - Optimization I (fast, precise)"',
bsh_file: "deconvolution_GPU.bsh"
}
hdf5_output: { hdf5_output: {
bsh_file_define: "define_output.bsh", output_image_file_pattern: 'TP{{t}}_Chgreen_Ill0_Ang0,72,144,216,288.tif',
bsh_file_hdf5: "export_output.bsh", output_xml: '"fused_Single_Channel"',
convert_32bit: '"[Use min/max of first image (might saturate intenities over time)]"', output_hdf5_xml: '"hdf5_fused_Single_Channel"',
output_channels: "green",
output_data_type: "32Bit",
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_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_x: 0.5718,
output_pixel_distance_y: 0.5718, output_pixel_distance_y: 0.5718,
output_pixel_distance_z: 0.5718, output_pixel_distance_z: 0.5718,
output_pixel_unit: 'um', 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_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)"',
registration: { output_illumination_directions: '"NO (one illumination direction)"',
algorithm: '"Fast 3d geometric hashing (rotation invariant)"', output_imglib_container: '"ArrayImg (faster)"',
allowed_error_for_ransac: '5', subsampling_output: '"{{ {{1,1,1}}, {{2,2,2}}, {{4,4,4}}, {{8,8,8}} }}"',
angle: '"All angles"', chunk_sizes_output: '"{{ {{16,16,16}}, {{16,16,16}}, {{16,16,16}}, {{16,16,16}} }}"',
bsh_file: "registration.bsh", # subsampling_output: '"{{ {{1,1,1}}, {{2,2,2}} }}"',
channel: '"All channels"', # chunk_sizes_output: '"{{ {{16,16,16}}, {{16,16,16}} }}"',
detection_min_max: "find_maxima", bsh_file_define: "define_output.bsh",
fix_tiles: '"Fix first tile"', bsh_file_hdf5: "export_output.bsh"
illuminations: '"All illuminations"',
imglib_container: '"ArrayImg (faster)"',
initial_sigma: '1.8',
interest_points_channel_0: '"beads"',
interest_points_channel_1: '"beads"',
label_interest_points: '"beads"',
lambda: '0.10',
map_back_tiles: '"Map back to first tile using rigid model"',
model_to_regularize_with: "Rigid",
proc-ch: '"channel 0"',
radius_1: '2',
radius_2: '3',
significance: '10',
subpixel_localization: '"3-dimensional quadratic fit"',
threshold: '0.005',
threshold_gaussian: '0.0080',
timepoint: '"Single Timepoint (Select from List)"',
transformation_model: "Affine",
type_of_detection: '"Difference-of-Mean (Integral image based)"',
type_of_registration: '"Register timepoints individually"'
}
resave_hdf5: {
bsh_file: "export.bsh",
hdf5_chunk_sizes: '"{{ {{32,32,4}}, {{32,32,4}}, {{16,16,16}}, {{16,16,16}} }}"',
resave_angle: '"All angles"',
resave_channel: '"All channels"',
resave_illumination: '"All illuminations"',
resave_timepoint: '"All Timepoints"',
setups_per_partition: '0',
subsampling_factors: '"{{ {{1,1,1}}, {{2,2,1}}, {{4,4,1}}, {{8,8,1}} }}"',
timepoints_per_partition: '1'}
timelapse: {
bsh_file: "timelapse_registration.bsh",
reference_timepoint: '0',
timelapse_process_timepoints: '"All Timepoints"',
type_of_registration_timelapse: '"Match against one reference timepoint (no global optimization)"'
}
xml_merge: {
bsh_file: "xml_merge.bsh"
} }
// is problematic needs to be adjusted for
// multi channel and multi illumination datasets
import ij.IJ; import ij.IJ;
import ij.ImagePlus; import ij.ImagePlus;
import java.lang.Runtime; import java.lang.Runtime;
...@@ -11,13 +13,11 @@ System.out.println(runtime.availableProcessors() + " cores available for multi-t ...@@ -11,13 +13,11 @@ System.out.println(runtime.availableProcessors() + " cores available for multi-t
// Load Parameters form job file // Load Parameters form job file
image_file_directory = System.getProperty( "image_file_directory" ); image_file_directory = System.getProperty( "image_file_directory" );
merged_xml = System.getProperty( "merged_xml" ); merged_xml = System.getProperty( "merged_xml" );
if ( ! merged_xml.endsWith(".xml") )
merged_xml = merged.xml + ".xml";
transform_angle = System.getProperty( "transform_angle" ); transform_angle = System.getProperty( "transform_angle" );
transform_channel = System.getProperty( "transform_channel" ); transform_channel = System.getProperty( "transform_channel" );
transform_illumination = System.getProperty( "transform_illumination" ); transform_illumination = System.getProperty( "transform_illumination" );
transform_timepoint = System.getProperty( "transform_timepoint" ); transform_timepoint = System.getProperty( "transform_timepoint" );
channel_setting = System.getProperty( "channel_setting" );
transformation = System.getProperty( "transformation" ); transformation = System.getProperty( "transformation" );
apply_transformation = System.getProperty( "apply_transformation" ); apply_transformation = System.getProperty( "apply_transformation" );
define_mode_transform = System.getProperty( "define_mode_transform" ); define_mode_transform = System.getProperty( "define_mode_transform" );
...@@ -26,15 +26,16 @@ matrix_transform = System.getProperty( "matrix_transform" ); ...@@ -26,15 +26,16 @@ matrix_transform = System.getProperty( "matrix_transform" );
// Print Parameters into output file // Print Parameters into output file
System.out.println( "browse = " + image_file_directory ); System.out.println( "browse = " + image_file_directory );
System.out.println( "select_xml = " + image_file_directory + merged_xml ); System.out.println( "select_xml = " + image_file_directory + merged_xml );
System.out.println( "apply_to_angle = " + transform_angle ); System.out.println( "apply_to_angle = " + transform_angle );
System.out.println( "apply_to_channel = " + transform_channel ); System.out.println( "apply_to_channel = " + transform_channel );
System.out.println( "apply_to_illumination = " + transform_illumination ); System.out.println( "apply_to_illumination = " + transform_illumination );
System.out.println( "apply_to_timepoint = " + transform_timepoint ); System.out.println( "apply_to_timepoint = " + transform_timepoint );
System.out.println( "Channel_setting = " + channel_setting );
System.out.println( "transformation = " + transformation ); System.out.println( "transformation = " + transformation );
System.out.println( "apply = " + apply_transformation ); System.out.println( "apply = " + apply_transformation );
System.out.println( "define = " + define_mode_transform ); System.out.println( "define = " + define_mode_transform );
System.out.println( "all_timepoints_channel_0_illumination_0_all_angles = " + matrix_transform ); System.out.println( "all_timepoints_channel_" + channel_setting + "_illumination_0_all_angles = " + matrix_transform );
// Execute Fiji Plugin // Execute Fiji Plugin
try { try {
...@@ -50,12 +51,11 @@ IJ.run("Apply Transformations", ...@@ -50,12 +51,11 @@ IJ.run("Apply Transformations",
"define=" + define_mode_transform + " " + "define=" + define_mode_transform + " " +
"same_transformation_for_all_timepoints " + "same_transformation_for_all_timepoints " +
"same_transformation_for_all_angles " + "same_transformation_for_all_angles " +
// "all_timepoints_channel_0_illumination_0_all_angles=[0.5, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0]"); "all_timepoints_channel_" + channel_setting + "_illumination_0_all_angles=[" + matrix_transform + "]");
"all_timepoints_channel_0_illumination_0_all_angles=[" + matrix_transform + "]");
} }
catch ( e ) { catch ( e ) {
print( "[transform] caught exception: "+e ); print( "[external transformation] caught exception: "+e );
//important to fail the process if exception occurs //important to fail the process if exception occurs
runtime.exit(1); runtime.exit(1);
......
import ij.IJ; // Load Fiji dependencies
import ij.IJ; // calls imagej
import ij.Prefs; // calls imagej settings
import ij.ImagePlus; import ij.ImagePlus;
import java.lang.Runtime; import java.lang.Runtime;
import java.io.File; import java.io.File;
...@@ -7,16 +9,18 @@ import java.io.FilenameFilter; ...@@ -7,16 +9,18 @@ import java.io.FilenameFilter;
runtime = Runtime.getRuntime(); runtime = Runtime.getRuntime();
System.out.println(runtime.availableProcessors() + " cores available for multi-threading"); System.out.println(runtime.availableProcessors() + " cores available for multi-threading");
Prefs.setThreads(1); // defines the number of threads allowed
print("Threads: "+Prefs.getThreads()); // prints thread setting in output
System.out.println( "Load Parameters:"); System.out.println( "Load Parameters:");
// Getting parameters from job file // Getting parameters from job file
image_file_directory = System.getProperty( "image_file_directory" ); image_file_directory = System.getProperty( "image_file_directory" );
merged_xml = System.getProperty( "merged_xml" ); merged_xml = System.getProperty( "merged_xml" );
if ( ! merged_xml.endsWith(".xml") ) if ( ! merged_xml.endsWith(".xml") )
merged_xml = merged.xml + ".xml"; merged_xml = merged.xml + ".xml";
// Printing parameters into output file // Printing parameters into output file
System.out.println( "directory=" + image_file_directory ); System.out.println( "directory=" + image_file_directory );
System.out.println( "merged_xml=" + merged_xml ); System.out.println( "merged_xml=" + merged_xml );
...@@ -31,7 +35,8 @@ IJ.run("Merge Cluster Jobs", ...@@ -31,7 +35,8 @@ IJ.run("Merge Cluster Jobs",
"filename_contains=job_ " + "filename_contains=job_ " +
"filename_also_contains=.xml " + "filename_also_contains=.xml " +
"display " + "display " +
"merged_xml=" + merged_xml); // "delete_xml's " +
"merged_xml=" + merged_xml + "");
} }
catch ( e ) { catch ( e ) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment