Issues running identifylinearobjects.py in CellProfiler

@bcimini @v_saharuka

Do you have an idea why that is?

When you load it, is there an error message?

What do you mean exactly? I open CellProfiler on a Mac, this gives me no error messages during the launching of CellProfiler. But then I cannot find the additional module.

Is there a direct way to load the module in CellProfiler 2.2.0 UI?

I also tried starting CellProfiler from the terminal to see whether there are error messages using
open -a "CellProfiler.app"
However this does not work. I get an error appearing in an UI window of the Mac, but no error message. What does work is for example "open -a “CellProfiler-3.1.8.app”, which is the newer version.

Is there a way to start CellProfiler 2.2.0 from command line on a Mac in a way that one can see error messages?

@VolkerH
As you suggested, I tried to get https://raw.githubusercontent.com/CellProfiler/CellProfiler-plugins/master/identifylinearobjects.py running with a newer version of CellProfiler (3.1.9), but I did not seem to work. I did not even get a .pyc file in this case. I also did not get an error message.

Hi @Christian_Tischer
I don’t currently have a Mac to try this on. When I try to use this plugin with CP 3.1.8 on Windows I see the following message on the console:

Could not load identifylinearobjects
Traceback (most recent call last):
  File "CellProfiler\cellprofiler\modules\__init__.py", line 325, in add_module
  File "C:\Users\Volker\Downloads\cpplugins\identifylinearobjects.py", line 14, in <module>
    import cellprofiler.cpmodule as cpm
ImportError: No module named cpmodule
could not load these modules: identifylinearobjects

So it appears this is indeed for an older version of CP. Some discussion on fixing the imports can be found here: CP3.0: ImportError: No module named cpmodule

When I still owned a Mac I would see the console messges by openening a Terminal and calling the cellprofiler executable directly using the full Path which was somewhere below /Applications/Cellprofiler.app/MACOSX/. Without seeing the console output and the python traceback debugging will be rather difficult.

1 Like

@bcimini @VolkerH @v_saharuka
Somehow it is not possible anymore to see error messages on a mac. However, I managed to run CellProfiler2.2.0 on Windows and here I got an error message:

Could not load identifylinearobjects
Traceback (most recent call last):
  File "cellprofiler\modules\__init__.pyc", line 294, in add_module
  File "C:\Users\tischer\Desktop\identifylinearobjects.py", line 19, in <module>
ImportError: No module named identify
could not load these modules: identifylinearobjects

Does that help?

Ah, yes, that definitely helps! I looked and it seems like Identify is just used to alias some imports; I can go ahead and manually replace those in the next day or so.

1 Like
3 Likes

Hi @bcimini,

Thanks for the fixes. It looks like there still is something not compatible.
I tried with the new version and now I get:

File "cellprofiler\modules\__init__.pyc", line 294, in add_module
File "C:\Users\tischer\Desktop\identifylinearobjects.py", line 19, in <module>
ImportError: No module named filter

cc @v_saharuka

Just looking at the source code it appears that changing the two occurences of skimage.filter to skimage.filters should fix this. Maybe you can give that a try @Christian_Tischer (this depends on the version of skimage that is bundled with your CellProfiler, with skimage v0.11 the naming changed from skimage.filter to skimage.filters)

1 Like

That helped! Thanks!

Now:

File "C:\Users\tischer\Desktop\identifylinearobjects.py", line 88, in create_settings
KeyError: 'YES'
could not load these modules: identifylinearobjects

(Since the discussion deviated significantly from the original topic, I now moved the posts discussing the plugin installation in CP into a new topic.)

2 Likes

adding

from cellprofiler.settings import YES, NO

back in should fix that @Christian_Tischer

2 Likes

Thanks again @VolkerH!
Attached file now compiles: identifylinearobjects.zip (6.4 KB)

Hey @Christian,

I think my reply might be late. But just thought to leave the info, in 2.2.0 version you could find them in preferences dialog as mentioned here.
Sorry for the late response

Regards,
Lakshmi
Fujifilm Wako Automation (Consultant)
www.wakoautomation.com
For CellProfiler training or optimised pipeline write to,
lakshmi.balasubramanian.contractor@fujifilm.com

Read more on our site.
Yokogawa CV8000 - The Ultimate in Confocal HCS
https://www.wakoautomation.com/products/yokogawa-high-content-imaging

Attached file now compiles

Great, you could do a pull request with the working plugin.

2 Likes