Posted by
Dionysios Lefkaditis on
Feb 05, 2013; 6:05pm
URL: http://imagej.273.s1.nabble.com/how-can-I-call-execute-run-a-trained-weka-classifier-from-an-ImageJ-macro-tp5001668p5001677.html
@Kota
Thanks you very much for your quick response! I was aware of this functionality and link that you have suggested and I have been using it extensively. Even if I thought your reply did not directly address my problem, it made me have a second look and I managed to solve the issue. I am grateful!
@Ignacio
Hello again!
Yes, the command works fine in the terminal, when properly formatted, of course. I even tried the simple:
exec("java", "-version");
and that doesn't work either! There must be something wrong when calling java. Unfortunately, there is absolutely no feedback, so I cannot investigate it further. Python code and any other executable on my system does work though.
Ignacio, I would like to take this opportunity and inform you of a bug in AWS. In the past, I had tried many times loading a trained classifier into AWS that used a reduced feature vector (after attribute selection in weka explorer). The classifiers would load successfully, but after feature calculation the classifier would fail/crash to classify the image(s). Today, after Kota's suggestion, I accidentally found that if any of the "Structure" features exist in the final feature vector will cause the classifier to crash when applying the classification to the images. These classifiers are working normally, though, when applied within the weka explorer.
I am attaching the corresponding log file. After the last lines are logged a pop up message appears saying "Could not apply Classifier!". I have the impression, but I cannot confirm that this might happen to classifiers with non-reduced feature vectors as long as "Structure" and maybe "Entropy" features are used. This issue has been bugging me for some time now and I have made all sorts of workarounds to try to avoid it. I hope you can resolve it.
Thanks!
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.htmlLoading Weka classifier from /home/mobile/Desktop/cnh data/3class-mogtip-11feat-ranfor10-classifier-20130103b.model...
Field of view: max sigma = 16.0, min sigma = 8.0
Membrane thickness: 1, patch size: 19
Read class name: mog-tips
Read class name: corn
Read class name: background
Read header from /home/mobile/Desktop/cnh data/3class-mogtip-11feat-ranfor10-classifier-20130103b.model (number of attributes = 11)
Loaded /home/mobile/Desktop/cnh data/3class-mogtip-11feat-ranfor10-classifier-20130103b.model
Processing 2 image files in 2 thread(s)....
Processing image image051.bmp in thread 0
Processing slices of image051.bmp in 1 thread(s)...
Starting thread 0 processing 1 slices, starting with 1
Processing image image052.bmp in thread 1
Processing slices of image052.bmp in 1 thread(s)...
Starting thread 0 processing 1 slices, starting with 1
Creating features for slice 1...
Creating features for slice 1...
Filtering feature stack by selected attributes...
Filtering feature stack by selected attributes...
Classifying slice 1 in 1 thread(s)...
Classifying slice 1 in 1 thread(s)...
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html