Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import ij.IJ; // calls imagej
import ij.Prefs; // calls imagej settings
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");
Prefs.setThreads(1); // defines the number of threads allowed
print("Threads: "+Prefs.getThreads()); // prints thread setting in output
System.out.println("Start loading parameters");
// Directory
System.out.println("=========================================================");
System.out.println("Directory:");
image_file_directory = System.getProperty( "image_file_directory" );
xml_filename = System.getProperty( "xml_filename" );
System.out.println( "image_file_directory = " + image_file_directory );
System.out.println( "xml_filename = " + xml_filename );
// Dataset settings
System.out.println("=========================================================");
System.out.println("Dataset:");
timepoints = System.getProperty( "timepoints" );
image_file_pattern = System.getProperty( "image_file_pattern" );
type_of_dataset = System.getProperty( "type_of_dataset" );
multiple_timepoints = System.getProperty( "multiple_timepoints" );
multiple_illumination_directions = System.getProperty( "multiple_illumination_directions" );
multiple_angles = System.getProperty( "multiple_angles" );
imglib_container = System.getProperty( "imglib_container" );
System.out.println( "timepoints = " + timepoints );
System.out.println( "image_file_pattern = " + image_file_pattern );
System.out.println( "type_of_dataset = " + type_of_dataset );
System.out.println( "multiple_timepoints = " + multiple_timepoints );
System.out.println( "multiple_illumination_directions = " + multiple_illumination_directions );
System.out.println( "multiple_angles = " + multiple_angles );
System.out.println( "imglib_container = " + imglib_container );
// Calibaration
System.out.println("=========================================================");
System.out.println("Calibration:");
float pixel_distance_x = Float.parseFloat( System.getProperty( "pixel_distance_x" ) );
float pixel_distance_y = Float.parseFloat( System.getProperty( "pixel_distance_y" ) );
float pixel_distance_z = Float.parseFloat( System.getProperty( "pixel_distance_z" ) );
pixel_unit = System.getProperty( "pixel_unit" );
System.out.println( "pixel_distance_x = " + pixel_distance_x );
System.out.println( "pixel_distance_y = " + pixel_distance_y );
System.out.println( "pixel_distance_z = " + pixel_distance_z );
System.out.println( "pixel_unit = " + pixel_unit );
// Channel switch
System.out.println("=========================================================");
System.out.println("Channel Switch:");
multiple_channels = System.getProperty( "multiple_channels" );
System.out.println( "multiple_channels = " + multiple_channels );
channels = System.getProperty( "channels" );
if ( multiple_channels.equalsIgnoreCase( "NO (one channel)" ) )
{
channels="";
}
else if ( multiple_channels.equalsIgnoreCase( "YES (one file per channel)" ) )
{
channels = "channels_=" + channels + " ";
}
else {
System.out.println( "Channel switch setting gibberish" );
}
System.out.println( "channels = " + channels );
System.out.println("Define Multi-View Dataset , type_of_dataset=[" + type_of_dataset + "] " +
"xml_filename=[" + xml_filename + ".xml] " +
"multiple_timepoints=[" + multiple_timepoints + "] " +
"multiple_channels=[" + multiple_channels + "] " +
"_____multiple_illumination_directions=[" + multiple_illumination_directions + "] " +
"multiple_angles=[" + multiple_angles + "] " +
"image_file_directory=" + image_file_directory + " " +
"image_file_pattern=" + image_file_pattern + " " +
"timepoints_=" + timepoints + " " +
channels +
"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
System.out.println("=========================================================");
System.out.println("Start plugin:");
IJ.run("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 + " " +
channels +
"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 + "");
/* shutdown */
runtime.exit(0);