Batch Trainable Weka Segmentation in MATLAB?


I’m interested in using MATLAB to call the ImageJ Trainable Weka Segmentation. Right now, in the code, below I am 1) loading an image ‘avgimg’: 2) loading a classifier, and then 3) calculating the probability of the image using a classifer.

Instead I would like 1) load the classifier 2) iterate through a list of images and get the probability for each image using the same classifier.

Does anyone know how I can modify my code to do this?

Thank you‘avgimg’); % Load an image and show it in IJ‘Trainable Weka Segmentation’); % Start Weka, do the magic
IJM.getDatasetAs(‘probmaps’); % Receive computed results
probmapObject = probmaps(:,:,2)’;‘Close All’); % close all image windows

1 Like


You can actually do this in ImageJ directly - within the Script Editor - by using this example code in BeanShell that allows you to apply a classifier to all images in a folder… :slight_smile: