Hi there,
I’m new to this forum but hoping that someone can help me out. I’m using ilastik pixel classification to identify cells in a multipage tiff image. This works well but is really slow, and as a result, I want to first convert my multipage tiff images into HDF5 images. I have used the Ilastik Fiji plugin for this purpose with some success, but I have hundreds of images that need to be converted, so I’m hoping to write a script that I can run to open the images and export them as HDF5.
I’m tried looking at the Fiji ilastik plugin source code, but I’m not familiar enough with Java to understand it. I’ve come across code using this forum for processing multiple images in a folder (here) but I don’t know how to take this one step further and call on the Export HDF5 plug in.
If anyone could point me in the right direction, I would be very grateful!
Thanks!
The code I’m found thus far.
/*
- Macro template to process multiple images in a folder
*/#@ File (label = “Input directory”, style = “directory”) input
#@ File (label = “Output directory”, style = “directory”) output
#@ String (label = “File suffix”, value = “.tif”) suffix// See also Process_Folder.py for a version of this code
// in the Python scripting language.processFolder(input);
// function to scan folders/subfolders/files to find files with correct suffix
function processFolder(input) {
list = getFileList(input);
list = Array.sort(list);
for (i = 0; i < list.length; i++) {
if(File.isDirectory(input + File.separator + list[i]))
processFolder(input + File.separator + list[i]);
if(endsWith(list[i], suffix))
processFile(input, output, list[i]);
}
}function processFile(input, output, file) {
// Do the processing here by adding your own code.
// Leave the print statements until things work, then remove them.
// THIS IS WHERE YOU CAN OPEN YOUR FILES, ETC AS YOU WANT
print("Processing: " + input + File.separator + file);
print("Saving to: " + output);
}