Problem Ilastik macro "a dataset set is required but none exist"


I’ve got a problem when i use Ilastik from FIJI into a batch processing macro.
I use this macro:

/ set global variables
pixelClassificationProject = "F:/Ilastik/Coralie/Seg_V2.ilp";
outputType = "Probabilities";
inputDataset = "data";
outputDataset = "exported_data";
axisOrder = "tzyxc";
compressionLevel = 0;

// process all H5 files in a given directory
dataDir = "F:/Ilastik/Coralie/Test/";
fileList = getFileList(dataDir);
for (i = 0; i < fileList.length; i++) {
	// import image from the H5
	fileName = dataDir + fileList[i];	
	importArgs = "select=" + fileName + " datasetname=" + inputDataset + " axisorder=" + axisOrder; 			
	run("Import HDF5", importArgs);

	// run pixel classification
	inputImage = fileName + "/" + inputDataset;
	pixelClassificationArgs = "projectfilename=" + pixelClassificationProject + " saveonly=false inputimage=" + inputImage + " chosenoutputtype=" + outputType;
	run("Run Pixel Classification Prediction", pixelClassificationArgs);

	// export probability maps to H5
	outputFile = dataDir + "output" + i + ".h5";
	exportArgs = "select=" + outputFile + " datasetname=" + outputDataset + " compressionlevel=" + compressionLevel;
	run("Export HDF5", exportArgs);

When i run it. I’ve got a window with this message “a dataset is required but none exist”
I use .h5 file and i can open them when i use import h5 file. So i don’t know why it’s doesn’t work.
I’ve got this message in the log:

[Wed Oct 23 16:42:37 CEST 2019] [INFO] /data: DATASET
[Wed Oct 23 16:42:37 CEST 2019] [ERROR] Module threw exception
at org.scijava.thread.DefaultThreadService$
at java.util.concurrent.ThreadPoolExecutor.runWorker(
at java.util.concurrent.ThreadPoolExecutor$

Have a nice day


Maybe @wolny can help?

Hi @RomainM,

this error (‘a dataset is required but none exist’) will pop up only if the h5 file does not have any datasets inside. Two things you might want to check:

  1. does “F:/Ilastik/Coralie/Test/” dir contain only h5 files?
  2. does each and every h5 file has the ‘data’ dataset inside?

Also the exception you got indicates that ‘data’ dataset in not present in one of your h5 files.

Hope this helps.


1 Like

I reconvert my files with “export h5” and now it’s works!

Thx for the help!