Ilastik trained model in Jupyter notebook + GPU

Dear Ilastik developers,

I was wondering if it is possible to load an ilastik trained model in a jupyter notebook to apply the model prediction on?

Use case: The Ilastik workflow was trained on XY shape normalized images but the prediction needs to be applied on a directory of TXY shape images, timepoint by timepoint, after normalizing each timepoint in the same way as the training images. In this was the multicut workflow for example can be trained on a bunch of XY shape images but the prediction can then work on timepoint by timepoint and in a jupyter notebook enviornment?

This would be a more user friendly way of applying the prediction than going in the headless mode, which users on some OS may find difficult.

Also is there GPU support available during training and prediction?

Thanks,
Varun

Hi @kapoorlab,

no, right now everything runs on cpus

right now the only way to do this is use the headless mode with subprocesses.

Another way would be to use the batch processing applet in ilastik itself. But I sense that you want to have the full pipeline running without user interaction.

Hi @k-dominik

Thanks for the reply. Sorry to hear about the GPU situation and that it can not run in Jupyter notebook enviornment.

The idea of running it in Jupyter notebook enviornment is to make it friendly for the end users who will not use the headless mode and to give them full user interaction.

This is what I had in mind as a pseudo code in the notebook:

Block1:
Load_Ilastik _Model_XYshape:
Load_Source_Directory_TXYshape:
Load_Destination_Directoy_SuperPixelSegmentation:

Block2:
for image in Source_Directory:
Normalizedimage = NormalizeImage_user_chosen_way(image)
TXY_superpixel = np.zeros([Normalizedimage.shape[0],Normalizedimage.shape[1],Normalizedimage.shape[2]])
for i in range(0, Normalizedimage.shape[0]):
TXY_superpixel[i,:] = Ilastik_Model_XY(Normalizedimage[i,:])

save_tiff_file(TXY_superpixel)

I want to do this for this workflow in particular as superpixel/multicut/correlation clusterning workflow of Ilastik does not support TXY shape images as input and in general I think independent of the workflow it gives users freedom to design a workflow and keep Ilastik as a part of it in the Jupyter notebook based enviornment.