Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use Macro to load classifier #31

Open
yanningzuo opened this issue Sep 16, 2016 · 15 comments
Open

Cannot use Macro to load classifier #31

yanningzuo opened this issue Sep 16, 2016 · 15 comments

Comments

@yanningzuo
Copy link

Hi,

It seems to be some problems with the "load classifier" macro command. I tried several time with the command as below,but overtime it said "cannot load classifier":

run("Trainable Weka Segmentation");
selectWindow("Trainable Weka Segmentation v3.1.2");
call("trainableSegmentation.Weka_Segmentation.loadClassifier", "/Users/lab-public/Desktop/Green.model");
call("trainableSegmentation.Weka_Segmentation.getProbability");
selectWindow("Probability maps");

I used macro recorder and checked a few times. Probably there's something wrong with the Weka.

Thanks!

@yanningzuo
Copy link
Author

It says
Caused by: java.lang.NullPointerException
at trainableSegmentation.Weka_Segmentation$CustomWindow.setButtonsEnabled(Weka_Segmentation.java:1110)
at trainableSegmentation.Weka_Segmentation.loadClassifier(Weka_Segmentation.java:2735)

@yanningzuo
Copy link
Author

yanningzuo commented Sep 16, 2016

Just found it's working on PC but not Mac

@iarganda
Copy link
Collaborator

Thanks for reporting! It probably has to do with the dialog to choose the classifier file. I'll fix it as soon as I can.

@yanningzuo
Copy link
Author

Thank you so much!

Yanning Zuo
Staff Research Associate, Hong Lab

Department of Biological Chemistry
Department of Neurobiology
David Geffen School of Medicine
University of California, Los Angeles

On Fri, Sep 16, 2016 at 1:42 AM, Ignacio Arganda-Carreras <
[email protected]> wrote:

Thanks for reporting! It probably has to do with the dialog to choose the
classifier file. I'll fix it as soon as I can.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#31 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ATCJgkxx9jF19dWgn1eyuojT82JgE2_lks5qqlZ7gaJpZM4J-fwr
.

@iarganda
Copy link
Collaborator

It seems it is a known problem of the open dialog system. Can you please try again after selecting the "Use JFileChooser to open/save" option in the Edit > Options > Input/Output... menu?

It should look like this:
screenshot from 2016-09-21 16 06 52

@iarganda
Copy link
Collaborator

@yanningzuo Did you finally test if my proposed solution fixed the issue?

@yanningzuo
Copy link
Author

yanningzuo commented Feb 21, 2017 via email

@iarganda
Copy link
Collaborator

Hello @yanningzuo,
It works the other way around. If you are using a Mac, you should uncheck the "Use JFileChooser to open/save" option. It seems there is a problem with JFileChooser on Mac OS.

@yanningzuo
Copy link
Author

yanningzuo commented Feb 21, 2017 via email

@iarganda
Copy link
Collaborator

Weird! Which version of Mac OS and Java do you have?

@yanningzuo
Copy link
Author

yanningzuo commented Feb 21, 2017 via email

@iarganda
Copy link
Collaborator

I just noticed you are not using version 3.2.5 which enforces the use of other dialogs instead of JFileChooser if the option is unchecked. Can you please try with that version of the plugin?

@yanningzuo
Copy link
Author

yanningzuo commented Feb 21, 2017 via email

@iarganda
Copy link
Collaborator

I see, and this only happens from a macro? You might need to add a wait command after calling the plugin so it has time to load. This works for me:

selectWindow("Result of Clipboard-1");
run("Trainable Weka Segmentation");
wait( 2000 );
selectWindow("Trainable Weka Segmentation v3.2.5");
call("trainableSegmentation.Weka_Segmentation.loadClassifier", "/Users/lab-public/Desktop/Green.model");
call("trainableSegmentation.Weka_Segmentation.getProbability");

@imagesc-bot
Copy link

This issue has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/java-lang-nullpointerexception-during-trainable-weka-segmentation-scripting/24002/3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants