Do not open Trainable Weka Segmentation GUI from Matlab

Hi everyone,

I would like to know if it exist the possibility to avoid the openening of the WEKA GUI when it’s called with MIJ.run(‘Trainable Weka Segmentation’); and also the opening of the image result when trainableSegmentation.Weka_Segmentation.getResult is called. I would like to take the result only as a MATLAB variable.

This is the code that I’m using right now:

%Open an image in Fiji within Matlab
[testfile, testpath]=uigetfile({'*.*','All Files'},'Choose image','C:\Users\tmost');
MIJ.run('Open...', ['path=[' testpath testfile ']']);
MIJ.run('8-bit');

% Start Weka
MIJ.run('Trainable Weka Segmentation');
trainableSegmentation.Weka_Segmentation.loadClassifier('C:\Users\tmost\Desktop\TWS\classifier.model');
trainableSegmentation.Weka_Segmentation.getResult;

Segmented_micro=MIJ.getCurrentImage;

Thank you in advance,

Tomás.

Hey Tomás

You could try Mathworks fileexchange “weka”. The (pretty old) Matlab Weka Interface. There is no need to use MIJ.

Best
drchrisch