We're Hiring!

.NET and bio-formats issues

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.

.NET and bio-formats issues

Postby ThierryUK » Sun May 19, 2013 4:28 pm

Dear all,

I am currently working on a C# application (windows, .NET, visual c#, 32 bitys), and I'd like to use bio-format as an universal way to load images generated by automated imaging platform. To do so I downloaded bio-formats.jar as well as loci_tools.jar and converted them as dll using ikvmc. Expect a long list of warning during the conversion everything seems fine. Those .dll have been referenced in my project, and as a test, I tryed to load JPEG and TIFF files using the basic following piece of code:

loci.formats.@in.TiffReader MyTiffReader = new loci.formats.@in.TiffReader();
MyTiffReader.setId(FileName);

everything is working well except that it takes forever to load a regular image (more than 30 sec. for a 300*300, 1 band image)... The same thing is happening for JPG !! I tryed more a less everthing to fix this, but nothing is changing !!
Does anybody experienced the same issue ?

Thanks for your help.

Thierry
ThierryUK
 
Posts: 2
Joined: Sun May 19, 2013 4:16 pm

Re: .NET and bio-formats issues

Postby mlinkert » Tue May 21, 2013 3:30 pm

Hi Thierry,

am currently working on a C# application (windows, .NET, visual c#, 32 bitys), and I'd like to use bio-format as an universal way to load images generated by automated imaging platform. To do so I downloaded bio-formats.jar as well as loci_tools.jar and converted them as dll using ikvmc.


Note that if you have loci_tools.jar, bio-formats.jar is not necessary as it is included in loci_tools.jar.

Expect a long list of warning during the conversion everything seems fine. Those .dll have been referenced in my project, and as a test, I tryed to load JPEG and TIFF files using the basic following piece of code:

loci.formats.@in.TiffReader MyTiffReader = new loci.formats.@in.TiffReader();
MyTiffReader.setId(FileName);

everything is working well except that it takes forever to load a regular image (more than 30 sec. for a 300*300, 1 band image)... The same thing is happening for JPG !! I tryed more a less everthing to fix this, but nothing is changing !!
Does anybody experienced the same issue ?


I would suggest first isolating whether this is an issue in Bio-Formats itself, or only when using the .dlls from ikvmc. If you download bftools.zip from http://www.openmicroscopy.org/site/prod ... /downloads, follow the instructions at the top of https://www.openmicroscopy.org/site/sup ... index.html, and then run:

Code: Select all
showinf -nopix test-file-name.tiff


...then the initialization time (among other things) should be shown. If the time you see there is similar to what you see with your C# application, then this would need to be addressed in Bio-Formats itself. If showinf gives you a much smaller initialization time, then the issue is somewhere in ikvmc/.NET. This thread on the ikvm-devel list suggests that running an application in debug mode can contribute to performance problems:

http://comments.gmane.org/gmane.comp.ja ... devel/2893

so I'd suggest trying to run the application in release mode and seeing if that makes a difference (if you haven't already).

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

Re: .NET and bio-formats issues

Postby ThierryUK » Tue May 21, 2013 4:42 pm

Dear Melissa,

thanks a lot for your help. After trying what you suggested, I did not notice any change (release, debug etc...).
However, I figured out something weird by mistake:
If I run the compiled application (release or debug) directly (not through the Visual editor) after a regular initialization time, everything seems to work fine !
So, I did not really got it, but that's good enough for me right now.
Thanks again,

Thierry
ThierryUK
 
Posts: 2
Joined: Sun May 19, 2013 4:16 pm


Return to Developer Discussion

Who is online

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