Hi, I’m a new user of Ilastik. I’m trying to open Ilastik .h5 probability maps in Matlab. I was successful with one file, but when I tried again using the same code and file type, but for a different image, I get an error message saying that the file cannot be found. I checked the export settings in Ilastik before exporting, and it says the dataset is “exported_data,” which is what’s in the code, so I’m very confused. I’ve checked the names of the files too.
Both files were imported to Ilastik from ImageJ and I’m confident I did the same steps for both. The only thing I changed in the code was the name of the file. Does anyone have any advice?
Here’s the code for the first (successfull) and second (unsuccessful) attempts:
First try:
ilastik_filename = ‘MAX_Series007_SM2_Probabilities.h5’; % ilastik prediction map here
ilastik_file = h5read(ilastik_filename,’/exported_data/’); % exported data is the “folder” in Ilastik project where the data is stored. Don’t change this.
pred = squeeze(ilastik_file(2,:,:,:)); % Originally 4D file, we want 3D
pred = permute(pred,[2,1,3]); % prevent the Ilastik axis swap by fixing them here
figure
imshow(sum(pred,3),)
title(‘Ilastik prediction map, z-projection’)
Second try:
ilastik_filename = ‘HidGFP_HFD8D_3_Probabilities.h5’; % ilastik prediction map here
ilastik_file = h5read(ilastik_filename,’/exported_data/’); % exported data is the “folder” in Ilastik project where the data is stored. Don’t change this.
pred = squeeze(ilastik_file(2,:,:,:)); % Originally 4D file, we want 3D
pred = permute(pred,[2,1,3]); % prevent the Ilastik axis swap by fixing them here
figure
imshow(sum(pred,3),)
title(‘Ilastik prediction map, z-projection’)