[ImageJ-devel] loading imageJ instance with full Services

Mohamed Tleis mohammedtleis at hotmail.com
Thu Jul 4 10:03:57 CDT 2013


Dear Curtis,

 > there is nothing "wrong" per se with calling "imagej.Main.launch()" 
if what you really want is for the ImageJ application to pop up. So no 
worries there.
That is good news, it is exactly what I am trying to do.

I wrote previously :
"If I use this instance to open an lsm image with 2 channels, the image 
isn't loaded properly, only one channel is visable and trying to split 
channels will ask me for arguments and won't be done."

When I was trying to regenerate the problem with minimal code, I figured 
out that the problem was due to wrong loading of imageJ in the following 
way:

public class launchij2 {
     launchij2()
     {
         ImageJ ij = new ImageJ();
         ij = imagej.Main.launch();
     }

     public static void main(String args[])
     {
         new launchij2();
     }
}

I learned that <ij = mageJ.Main.launch();> doesn't replace the <ij = new 
ImageJ();>; but somehow mix things together. Is this an expected behaviour?

Best Regards,
Mohamed Tleis

On 06/25/2013 09:03 PM, Curtis Rueden wrote:
> Hi Mohamed and everyone,
>
> I agree with Johannes that using "new ImageJ()" is better for 
> programmatic use, in that it is more flexible. That said, there is 
> nothing "wrong" per se with calling "imagej.Main.launch()" if what you 
> really want is for the ImageJ application to pop up. So no worries there.
>
> As for your reported problem, I have a couple of questions:
>
> > If I use this instance to open an lsm image with 2 channels
>
> Please note that ImageJ2 does not support LSM out of the box. You need 
> either Bio-Formats or LSM_Reader for that (which at the moment are 
> ImageJ1 plugins, and will be run using the IJ2's legacy layer). If you 
> open an LSM with File > Open right now, I believe it will open as a 
> vanilla TIFF file, which may not read all the metadata, and may 
> misinterpret some Zeiss-specific image parameters.
>
> > Note that opening the imageJ from the provided executable works fine.
>
> Hmm, you mean if you launch ImageJ2 from the launcher, then open your 
> LSM file, it behaves as expected? Then there may indeed be a bug 
> lurking here somewhere. Do you have a sample non-working image file 
> you can upload via the Help > Upload Sample Image command? That, along 
> with specific brief instructions about what doesn't work, would be 
> very helpful to diagnose and fix the problem.
>
> Thanks,
> Curtis
>
>
> On Mon, Jun 24, 2013 at 9:54 AM, Mohamed Tleis 
> <mohammedtleis at hotmail.com <mailto:mohammedtleis at hotmail.com>> wrote:
>
>     Dear Developers,
>
>     from inside my code I am calling imageJ through
>
>     ImageJ ij = new ImageJ.Main.launch();
>
>     If I use this instance to open an lsm image with 2 channels, the
>     image isn't loaded properly, only one channel is visable and
>     trying to split channels will ask me for arguments and won't be done.
>     Note that opening the imageJ from the provided executable works
>     fine. I suppose the launch method needs some arguments to be
>     passed. Can you please show me an example to how to do this?
>
>     Best Regards,
>     M. Tleis
>
>     _______________________________________________
>     ImageJ-devel mailing list
>     ImageJ-devel at imagej.net <mailto:ImageJ-devel at imagej.net>
>     http://imagej.net/mailman/listinfo/imagej-devel
>
>



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://imagej.net/pipermail/imagej-devel/attachments/20130704/60b2a08b/attachment.html>


More information about the ImageJ-devel mailing list