We're Hiring!

Add function to Omero.insight

General and open developer discussion about using OMERO APIs from C++, Java, Python, Matlab and more! Please new questions at https://forum.image.sc/tags/omero
Please note:
Historical discussions about OMERO. Please look for and ask new questions at https://forum.image.sc/tags/omero

If you are having trouble with custom code, please provide a link to a public repository, ideally GitHub.

Add function to Omero.insight

Postby Hang » Mon Mar 19, 2018 8:50 pm

Hi guys,

I'm working on a project and I'm trying to add some function to the existing Omero.insight client.

Please let me know if the following things are what I need to set up the environment for development:

1. Omero source
2. Ice 3.6
3. Python 2.7
4. Cmake

Is there a tutorial on how to build Omero from source? Or can anyone give me some pointers?

Thanks,

Hang
Hang
 
Posts: 46
Joined: Wed Mar 07, 2018 10:22 pm

Re: Add function to Omero.insight

Postby Dominik » Tue Mar 20, 2018 9:27 am

Hi Hang,

yes, you'd need Ice 3.6, Python 2.7, Java-SDK 8, and the Apache tools Ant, Maven and Ivy; no need for cmake.

There is extensive documentation around: https://docs.openmicroscopy.org/omero/5 ... index.html , or especially with respect to getting started/building from source: https://docs.openmicroscopy.org/omero/5 ... ystem.html .

A very brief quick start summary, in case your using Eclipse IDE:
- You clone the Github repository https://github.com/openmicroscopy/openmicroscopy
- Then run './build.py build-dev' : This will build everything and already create the respective Eclipse projects.
- Then you import the whole openmicroscopy directory into Eclipse "as existing Maven projects" and you'll have all components in Eclipse as separate projects. Even if you just want to have Insight, it's good to have the code for example the Blitz component (which contains the Java Gateway Insight uses to access the Java API of the server) at hand. Just clicking on the method in Eclipse and jumping to the respective code can often be quicker than looking for the documentation/Javadoc.

Depending on the OS you're using and the way various components have been installed, you might see problems like "ant not found", "slice2java not found", etc. In that case you'd have to set some environment variables pointing to the right locations, like: ICE_HOME, SLICE_HOME, ...
Over time I ended up setting all of these in my .bash_profile:
Code: Select all
export SLICE_HOME=/usr/local/share/Ice-3.6.4/slice
export ICE_HOME=/usr/local/share/Ice-3.6.4
export ICE_CONFIG=/Users/dlindner/Repositories/openmicroscopy/dist/etc/ice.config
export PYTHONPATH=/usr/local/lib/python2.7/site-packages

Although some are just needed if you want to start up a local server (like "ICE_CONFIG"), which you'll find in the "dist" directory, if you ran "./build.py build-dev".

Regards,
Dominik
User avatar
Dominik
Team Member
 
Posts: 149
Joined: Mon Feb 10, 2014 11:26 am

Re: Add function to Omero.insight

Postby Hang » Tue Mar 20, 2018 2:18 pm

Thanks for the answer Dominik!

Do I have to use Python 2.7 for it to work? I'm required to use the latest version of every software I use at my work.

Hang
Hang
 
Posts: 46
Joined: Wed Mar 07, 2018 10:22 pm

Re: Add function to Omero.insight

Postby jmoore » Tue Mar 20, 2018 2:35 pm

Hi Hang:

If you mean, can you use Python 3: no, it's not yet supported. That being said, if you are looking to solely develop in Java for OMERO.insight, then you can likely create a separate repository/project and add your jar into/on top of OMERO.insight.zip.

~Josh
User avatar
jmoore
Site Admin
 
Posts: 1591
Joined: Fri May 22, 2009 1:29 pm
Location: Germany

Re: Add function to Omero.insight

Postby Hang » Tue Mar 20, 2018 8:30 pm

Hi Josh,

Yes, I'm looking to solely develop in Java and add some function to OMERO.insight. To be more specific, I want to add a button on Omero.insight so that I can connect to and run some matlab program on our Omero server. If that's doable, can you give me some pointers on how and what do I need to start developing?

Currently,

1. Our IT staff have set up an Omero server for me.

2. I have tried an sample code to connect to that Omero server and it worked.

3. I'm using Eclipse for this development.

Hang
Hang
 
Posts: 46
Joined: Wed Mar 07, 2018 10:22 pm

Re: Add function to Omero.insight

Postby jmoore » Tue Mar 20, 2018 8:55 pm

To be honest, it sounds like you'd like to add MATLAB scripts to your server. Can you read through https://docs.openmicroscopy.org/latest/ ... s/scripts/ and let us know if that would work for you?
User avatar
jmoore
Site Admin
 
Posts: 1591
Joined: Fri May 22, 2009 1:29 pm
Location: Germany

Re: Add function to Omero.insight

Postby Hang » Thu Mar 22, 2018 3:57 pm

Thanks for pointing me at the right direction. However, now I'm having issue while trying to install mlabwrap v1.1:

1. If I try "python setup.py install", I get error:

Code: Select all
C:\Users\yuh5\Downloads\mlabwrap-1.0a\mlabwrap-1.0a>python setup.py install
running install
running build
running build_py
running build_ext
building 'mlabraw' extension
error: Unable to find vcvarsall.bat


2. Or
Code: Select all
C:\Users\yuh5\Downloads\mlabwrap-1.0a\mlabwrap-1.0a>setup.py build --compiler=mi
ngw32
running build
running build_py
running build_ext
Traceback (most recent call last):
  File "C:\Users\yuh5\Downloads\mlabwrap-1.0a\mlabwrap-1.0a\setup.py", line 139,
in <module>
    extra_compile_args=EXTRA_COMPILE_ARGS,
  File "C:\Users\yuh5\AppData\Local\Programs\Python\Python36-32\lib\distutils\co
re.py", line 148, in setup
    dist.run_commands()
  File "C:\Users\yuh5\AppData\Local\Programs\Python\Python36-32\lib\distutils\di
st.py", line 955, in run_commands
    self.run_command(cmd)
  File "C:\Users\yuh5\AppData\Local\Programs\Python\Python36-32\lib\distutils\di
st.py", line 974, in run_command
    cmd_obj.run()
  File "C:\Users\yuh5\AppData\Local\Programs\Python\Python36-32\lib\distutils\co
mmand\build.py", line 135, in run
    self.run_command(cmd_name)
  File "C:\Users\yuh5\AppData\Local\Programs\Python\Python36-32\lib\distutils\cm
d.py", line 313, in run_command
    self.distribution.run_command(command)
  File "C:\Users\yuh5\AppData\Local\Programs\Python\Python36-32\lib\distutils\di
st.py", line 974, in run_command
    cmd_obj.run()
  File "C:\Users\yuh5\AppData\Local\Programs\Python\Python36-32\lib\distutils\co
mmand\build_ext.py", line 308, in run
    force=self.force)
  File "C:\Users\yuh5\AppData\Local\Programs\Python\Python36-32\lib\distutils\cc
ompiler.py", line 1031, in new_compiler
    return klass(None, dry_run, force)
  File "C:\Users\yuh5\AppData\Local\Programs\Python\Python36-32\lib\distutils\cy
gwinccompiler.py", line 282, in __init__
    CygwinCCompiler.__init__ (self, verbose, dry_run, force)
  File "C:\Users\yuh5\AppData\Local\Programs\Python\Python36-32\lib\distutils\cy
gwinccompiler.py", line 126, in __init__
    if self.ld_version >= "2.10.90":
TypeError: '>=' not supported between instances of 'NoneType' and 'str'


Also, I'm looking at the OMERO.scripts user guide, seem like the only way to learn how to write scripts is to looking into the examples? is there such things like an API introduction on how to write UI and functions with the scripts?

Hang
Hang
 
Posts: 46
Joined: Wed Mar 07, 2018 10:22 pm

Re: Add function to Omero.insight

Postby jmoore » Fri Mar 23, 2018 10:15 am

Hi Hang,

error: Unable to find vcvarsall.bat


This sounds like your Visual Studio setup cannot be found.

TypeError: '>=' not supported between instances of 'NoneType' and 'str'


This sounds like an incompatibility in mlabwrap to the rest of your environment. Unfortunately, I don't know mlabwrap very well.

Also, I'm looking at the OMERO.scripts user guide, seem like the only way to learn how to write scripts is to looking into the examples? is there such things like an API introduction on how to write UI and functions with the scripts?


The link I sent below (http://docs.openmicroscopy.org/omero/5.4.4/developers/scripts/index.html) is the starting point for the documentation. If you're having trouble finding specifics, perhaps let us know what you are trying to achieve and we'll point you in the right direction.

However, I should point out that it's not possible to build an entire UI. For user input, only simple parameters can be passed.

Additionally, it looks like you'll have issues with our platform requirements:

  • Microsoft Windows is only supported as a client
  • We don't currently support Python 3.x

See https://docs.openmicroscopy.org/latest/omero/sysadmins/version-requirements.html for more information.

~Josh
User avatar
jmoore
Site Admin
 
Posts: 1591
Joined: Fri May 22, 2009 1:29 pm
Location: Germany

Re: Add function to Omero.insight

Postby Hang » Fri Mar 23, 2018 2:47 pm

Will Python 3 be supported in the near future?

Hang
Hang
 
Posts: 46
Joined: Wed Mar 07, 2018 10:22 pm

Re: Add function to Omero.insight

Postby mtbc » Mon Mar 26, 2018 9:47 am

Dear Hang,

I am afraid that Python 3 will not be supported by OMERO in the near future. We certainly need to support it and the Trello card at https://trello.com/c/eajbWRA5/46-python-3-compatibility tracks the effort but there is so much to do. We are in the process of installing Python 3 across our testing infrastructure but there is a lot of Python code around OMERO's core components. For fixing the code it is not just a case of running 2to3: for example, without much static type inference the changes for Unicode strings require a more manual approach, at least to ensure adequate test coverage: our first priority is data integrity so we must take care not to introduce bugs. Another real-world issue is that it is easier to fund new feature development than what essentially looks like software maintenance of existing projects. We also have other pressing tasks such as keeping OMERO performing well at the scale of the new large datasets being submitted to IDR. So, Python 3 support is necessarily on the radar but unfortunately delivery is probably still quite some way out yet.

Cheers,
Mark
User avatar
mtbc
Team Member
 
Posts: 282
Joined: Tue Oct 23, 2012 10:59 am
Location: Dundee, Scotland

Next

Return to Developer Discussion

Who is online

Users browsing this forum: No registered users and 0 guests