We're Hiring!

Display Cellomics Image (c01) on a webpage

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.

Re: Display Cellomics Image (c01) on a webpage

Postby mlinkert » Wed Dec 21, 2011 2:34 am

I finally figured out how to use class libraries in Jar files... anyway, you were right, I got ImageInfo to work with all the other packages but loci_tools was all I needed. The images were still black with default settings but I got something better with the options:
java loci.formats.tools.ImageInfo -series 1 -fast -autoscale ../cellomics_110804170001_b02f00o2.c01

It's still not what I expect though, I just get part of the image and I cannot control the scale. I think other parts of the image are in different series and I would need to combine them. The image look like there is a white filter on top of it, or the B&W colors are reversed. I tried to use -nofilter but that didnt change anything.


'-nofilter' actually affects how the metadata is displayed, and does not have anything to do with displaying the image.

Update: I think the problem is that the image is in a 12bit/pixel format and ImageInfo assumes a 16bits format, is there a way to change that?


Could you please try using the latest trunk build of loci_tools.jar, and see if that works any better? You might also try adding the '-minmax' option, to ensure that the actual minimum and maximum pixel values are used to autoscale the image.
User avatar
mlinkert
Team Member
 
Posts: 353
Joined: Fri May 29, 2009 2:12 pm
Location: Southwest Wisconsin

Re: Display Cellomics Image (c01) on a webpage

Postby alexC » Wed Dec 21, 2011 3:16 pm

I just tried the newest version of loci_tools, it works! That s great!

Right now I am trying to build a java applet that displays the BufferedImage from a modified version of ImageInfo. No luck so far...

Edit: This is how far I got with the applet:

Code: Select all
import java.applet.*;
import java.awt.*;
import loci.formats.tools.ImageInfo;
import java.awt.image.BufferedImage;
import loci.formats.FormatException;
import java.io.IOException;

public class FirstApplet extends Applet{

    public void paint(Graphics g){

        int argcount=5;
        //String filename="Somefilname";
        String filename = getParameter("cellomicsfile");
        String fast = "-fast";
        String autoscale ="-autoscale";
        String series ="-series";
        //String seriesnumber="somenumber";
        String seriesnumber = getParameter("imagenumber");
        String args[] = new String[argcount];

        args[0]=filename;
        args[1]=fast;
        args[2]=autoscale;
        args[3]=series;
        args[4]=seriesnumber;
        BufferedImage img= null;
        try{
         
            img = new loci.formats.tools.ImageInfo().testRead(args); //line 29

        }catch(FormatException esc){
            System.exit(1);
        }
        catch(IOException ioe){
            System.exit(1);
        }



        g.drawString("Welcome in Java Applet.",40,20);
        g.drawString(filename,40,60);


    }
}

There is a problem when I try to call the testread method (line 28).
Pastebin of the edited ImageInfo.java file and firefox error output (couldn't get java console to work):
http://pastebin.com/Q5HmGvGA
alexC
 
Posts: 8
Joined: Fri Dec 02, 2011 2:27 pm

Re: Display Cellomics Image (c01) on a webpage

Postby mlinkert » Mon Jan 16, 2012 7:58 pm

Hi Alex,

My apologies for not replying sooner.

Right now I am trying to build a java applet that displays the BufferedImage from a modified version of ImageInfo. No luck so far...

Edit: This is how far I got with the applet:

*snipped code*
There is a problem when I try to call the testread method (line 28).
Pastebin of the edited ImageInfo.java file and firefox error output (couldn't get java console to work):
http://pastebin.com/Q5HmGvGA


The problem here was a number of calls to System.loadLibrary(...) and System.getProperty("java.library.path") in various Bio-Formats classes, which applets do not have sufficient permissions to execute. A proposed fix is here:

http://github.com/openmicroscopy/bioformats/pull/14

...but it is not yet included in the trunk build of Bio-Formats (the trunk build will contain the fix once the above is marked as "closed"). You are certainly welcome to give it a try in the meantime by building from the 'applet-fixes' branch of the 'git@github.com:melissalinkert/bioformats' repository, as noted in the above link.

Regards,
-Melissa
User avatar
mlinkert
Team Member
 
Posts: 353
Joined: Fri May 29, 2009 2:12 pm
Location: Southwest Wisconsin

Previous

Return to Developer Discussion

Who is online

Users browsing this forum: Google [Bot] and 1 guest