[Solved] Failed to import trainableSegmentation module

I have written a python script to automate the classification of fluorescent microscopy images using Trainable weka segmentation and export the results to a csv file.

when i placed the script file into

Fiji.app\plugins\Scripts\Process

and access the script from the Process drop down menu, the console generates error:

Traceback (most recent call last):
File “Process/Auto_count_weka_ver2.py”, line 14, in
ImportError: No module named trainableSegmentation

Understandably, the script has failed to identify the Fiji libraries. What must i do to point the script towards the fiji library? I wish to be able to run the script without opening the imageJ script interpreter. Is that possible?
Thank you :slight_smile:

Edit: Previously worked in the Fiji in built script interpreter, however turns out that even the interpreter is unable to find trainableSegmentation library. Tried reinstalling, however didn’t resolve the issue

edit2: My apologies, problem has been solved. There were hidden characters in the import line, not sure how it got there. Rewrote the line and everything worked fine!

Hi sinnersage,

Would you be able to share the Python script you wrote to automate classification? I’m trying to do something similar but running into some roadbumps. Thanks!