Classification of image Trainable Weka Segmentation_multithreading


Is it possible to classify image in weka using a single thread instead of multiple threads.

Membrane thickness: 1, patch size: 19
Read class name: class 1
Read class name: class 2
Creating feature stack…
Updating features of slice number 1…
Feature stack array is now updated (1 slice(s) with 33 features, took 22718ms).
Classifying whole image using 8 thread(s)…
Classifying whole image data took: 1015ms
Finished segmentation of whole image.

Instead of 8 thread i want only one thread to be used at a time. Is it possible somehow?

1 Like

It should be as simple as setting the ImageJ option in Edit > Options > Memory & Threads…, as the Weka Segmentation plugin is using Prefs.getThreads() to determine the number of available processors.


Thanks a lot for your reply. Is it possible set the number of threads in headless mode.
in code i mean as prefs.getThreads() requires no arguments.
How should i set it in code?
there is Prefs.setThreads(int n). Can i set it with this?


Just use the Recorder when setting your threads… then you can have the code as you like - maybe?!

Should be something like this:

run("Memory & Threads...", "maximum=7719 parallel=8");"Memory & Threads...", "maximum=7719 parallel=8");

Hope this helps!



Thanks a lot for your reply.
Unfortunately, i don’t want to use in my code.

Will Prefs.setThreads(int n) work?

Sorry for the late answer, @nickii, but yes, that would work.

1 Like