Commit 8e18cd98 authored by Christoph Sommer's avatar Christoph Sommer
Browse files

enable other files types

parent 4c44b196
#@ File (label="Select a directory", style="directory") dirname
#@ Integer (label="Resolution level", value=2) series
#@ String (visibility=MESSAGE, value="Resolution level 1 = full res; 2 = half the pixels per dimension ...") msg1
#@ String (label="File type" value=".ims") filetype
function convert_img_to_h5(in_file, out_file, series) {
function convert_ims_to_h5(in_file, out_file, series) {
run("Bio-Formats Importer", "open=" + in_file + " color_mode=Default rois_import=[ROI manager] view=Hyperstack stack_order=XYCZT series_" + series);
title = getTitle();
run("Export HDF5", "select=" + out_file + " datasetname=data compressionlevel=0 input=[" + title + "]");
close(title);
};
all_files = getFileList(dirname);
for (i=0; i<all_files.length; i++) {
in_file = dirname + "/" + all_files[i];
if (endsWith(in_file, ".ims")) {
if (endsWith(in_file, filetype)) {
print("Converting " + in_file);
out_file = dirname + "/" + File.getNameWithoutExtension(in_file) + ".h5";
print("Converting: " + in_file + " --> " + out_file);
if (File.exists(out_file) != 1) {
convert_ims_to_h5(in_file, out_file, series);
convert_img_to_h5(in_file, out_file, series);
print(" - done");
} else {
print(" - output exists already, skipping...");
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment