These are chat archives for fiji/fiji

3rd
Aug 2016
Ignacio Arganda-Carreras
@iarganda
Aug 03 2016 08:40
Good morning everybody! Does someone know how to get a user/pass for the Java-8 update site?
I'm trying to upload a new release of the Trainable Segmentation but my usual login does not work
Florian Jug
@fjug
Aug 03 2016 09:55
@iarganda just for me to know: is the update only for the missing reference or did you also change other, more profound things?
Ignacio Arganda-Carreras
@iarganda
Aug 03 2016 12:01
@fjug nothing profound there, just some code cleaning, a few library methods and increasing the maximum number of classes in the GUI
Curtis Rueden
@ctrueden
Aug 03 2016 13:40
@iarganda Actually your IP got banned last night from too many login attempts. We will fix it later today.
Ignacio Arganda-Carreras
@iarganda
Aug 03 2016 13:57
@ctrueden Hehehe, sorry about that. I tried with my wiki login but didn't work. Was I supposed to use something else?
Curtis Rueden
@ctrueden
Aug 03 2016 14:27
@iarganda Yes, the password is a dedicated one for "personal" update sites. See: http://imagej.net/Special:ChangeUploadPassword and select "Your personal update site" if it gives you the option.
Curtis Rueden
@ctrueden
Aug 03 2016 14:34
@iarganda I think your IP bans were temporary, so please try to change your password and let me know whether you are able to do so.
Ignacio Arganda-Carreras
@iarganda
Aug 03 2016 15:01
@ctrueden it worked indeed :) It is funny because this time it only asked me once for the password... Thanks a lot! (once again and again...)
Curtis Rueden
@ctrueden
Aug 03 2016 15:01
@iarganda Great!
Curtis Rueden
@ctrueden
Aug 03 2016 16:36
@hanslovsky @fjug @stelfrich I merged a branch to SCIFIO master that fixes several issues with the TIFF format. It is still far from perfect. Maybe it is good enough for everyday use now. Or maybe not—additional fixes and bug reports welcome. FYI (as I was saying in the scifio/scifio channel), SCIFIO ultimately needs to be rebuilt, to streamline it. The TIFF logic is unfortunately overcomplex right now. We will shoot to do this some time in 2017.
Anyway, y'all can test using io.scif:scifio:0.28.0-SNAPSHOT.
@fjug At least your hyperstack flattening problem should be solved now.
Florian Jug
@fjug
Aug 03 2016 18:12
@ctrueden great… but… let me understand...
I put io.scif:scifio:0.28.0-SNAPSHOT in my POM and then? What is the ’new' way of loading, saving?
Stefan Helfrich
@stelfrich
Aug 03 2016 18:34
@fjug you should be able to use the IOService as discussed previously. Try to call IOService.save() with an Img and the file extension "tif”
This should (although @ctrueden mentioned some problems with sample images over in the SCIFIO channel) write TIFFs that can be read with the built-in ImageJ Opener..
(I haven’t tested yet, but will hopefully find time tomorrow to do so..)
Curtis Rueden
@ctrueden
Aug 03 2016 19:40
This message was deleted
@fjug It should be as simple as:
import io.scif.img.IO;
ImgPlus<?> img = IO.openImgs("myInputImage.tif").get(0);
IO.saveImg("myOutputImage.tif", img);
Or as @stelfrich says, you can use a SciJava service, if you have e.g. a SciJava-style command. I would recommend the DatasetIOService (the IOService mentioned by Stefan should also work).
Jean-Yves Tinevez
@tinevez
Aug 03 2016 19:48
@ctrueden I just created a trackmate-core repo under the fiji organisation.
I shamelessly copied the pom from TrackMate, including the eventuality of a Jenkins job.
Tell me if everything is ok.
I picked the MIT license for now as it is the permissive license recommended by Github, but am open to suggestions.
Curtis Rueden
@ctrueden
Aug 03 2016 21:18
@tinevez Sounds good. MIT is OK. My personal favorite permissive license right now is the ISC License because it is very concise. But it really doesn't matter.
Jean-Yves Tinevez
@tinevez
Aug 03 2016 21:19
Thanks @ctrueden . I am far from done - I still have to generate a FFTConvolution code based on imglib2-fft.
This is also a great lesson in code coupling pitfalls :/
Florian Jug
@fjug
Aug 03 2016 21:38
@stelfrich @ctrueden Please let me thank the both you very much! Very, very much! :)
I will try give it a try tomorrow!
Curtis Rueden
@ctrueden
Aug 03 2016 21:39
@fjug Thank me when it works... ;-)
Florian Jug
@fjug
Aug 03 2016 21:40
:D Deal!
One more question (it will never end… ;) )
While in Ecliplse I created my own context on the spot somehow like this:
    final Context context = new Context( OpService.class, OpMatchingService.class );
    final OpService ops = context.getService( OpService.class );
Curtis Rueden
@ctrueden
Aug 03 2016 21:41
Just for testing?
Florian Jug
@fjug
Aug 03 2016 21:41
Just out of not knowing it better...
Curtis Rueden
@ctrueden
Aug 03 2016 21:41
In which code did you embed that?
Was it a SciJava Command?

If so, you can just put:

@Parameter
private OpService ops;

and it will be injected.

Or was it an ImageJ 1.x plugin?
Or something else?
Florian Jug
@fjug
Aug 03 2016 21:42
Anyways… as soon as this code would run in Fiji, I would get some error messages saying stuff about “legacy service’ not found etc.
Fantastico!!!!!
That helps!
Curtis Rueden
@ctrueden
Aug 03 2016 21:42
Yep. You cannot have two Context at the same time with legacy ImageJ 1.x stuff active, unfortunately.
I want to fix that, but haven't had time to do so yet.
Since, you know, the whole point of contexts is so you can have more than one...
But really, you shouldn't need to make another one, almost ever.
Florian Jug
@fjug
Aug 03 2016 21:43
Currently I have a main class, let’s call it 'MyApp'
The Command itself is call ‘MyCommand’ and decorated with @Plugin( type = Command.class, headless = true, menuPath = "Plugins>Tracking>Tr2d (alpha)" )
Curtis Rueden
@ctrueden
Aug 03 2016 21:44
OK, great. So in that command, you just put the services you want as fields with @Parameter and you're done. :-)
Florian Jug
@fjug
Aug 03 2016 21:44
If in there I add the @Parameter you mentioned above it will be injected if the Command is executed, right?
Curtis Rueden
@ctrueden
Aug 03 2016 21:45
Yes, when the framework instantiates your command, it will also inject it.
Florian Jug
@fjug
Aug 03 2016 21:45
But if I would start MyApp from eclipse, injection would not happen, right?
Curtis Rueden
@ctrueden
Aug 03 2016 21:45
It would, if you start your app via the SciJava application startup mechanism. I'd need to see the main method of MyApp.
Time for commute home; my responses will be more sporadic for awhile.
Florian Jug
@fjug
Aug 03 2016 21:47
Unfiltered:
    final ImageJ temp = IJ.getInstance();
    if ( temp == null ) {
        new ImageJ();
    }

    checkGurobiAvailability();
    parseCommandLineArgs( args );

    guiFrame = new JFrame( "tr2d" );
    setImageAppIcon();

    final ImagePlus imgPlus = openStackOrProjectUserInteraction();
    final Tr2dModel model = new Tr2dModel( projectFolder, imgPlus );
    mainPanel = new Tr2dMainPanel( guiFrame, model );

    guiFrame.getContentPane().add( mainPanel );
    setFrameSizeAndCloseOperation();
    guiFrame.setVisible( true );
Sure no worries… here it is almost midnight… I should anyways go to bed… ;)
So, as I see things, my main method above is totally not doing anything you’d like me to do there.
:worried:
Curtis Rueden
@ctrueden
Aug 03 2016 22:09
How about using "new net.imagej.ImageJ ()" instead of the old ij.ImageJ?
I guess your case logic complicates things...
Oh, and you are using ij.ImagePlus anyway so it gets hairy fast.
Florian Jug
@fjug
Aug 03 2016 22:11
I use ImgePlus in some places because I make use of existing (but old) code...
I will use new net.imagej.Imagej()… and play around a bit with the whole thing… thanks for now… Enjoy your evening!
Curtis Rueden
@ctrueden
Aug 03 2016 22:12
Anyway, you can always make a new Context in your main method, then feed it to your application. Either the Tr2dMainPanel constructor, or a setter.
Florian Jug
@fjug
Aug 03 2016 22:13
Yes, this is what I started doing now...
Curtis Rueden
@ctrueden
Aug 03 2016 22:13
The point is: make a new Context (or net.imagej.ImageJ, which makes one internally) one time and then feed it everywhere you need.
And then you can do stuff like:
myContext.service(CommandService.class).run(MyCommand.class);
Or, if you have a net.imagej.ImageJ:
myImageJ.command().run(MyCommand.class);
The net.imagej.ImageJ is just a convenience wrapper—called a Gateway—around a context.
See the imagej-tutorials repo, specifically intro-to-imagej-api, for details.
Florian Jug
@fjug
Aug 03 2016 22:16
Great! Thanks for pointers… will check that.
Hmmm… I receive now ops in the Command as injected @Parameter. Then I use that one to do...
    final Img< FloatType > imgScaled =
            Tr2dApplication.ops
                    .transform()
                    .scale( img, new double[] { scaleFactor, scaleFactor, 1 }, new NearestNeighborInterpolatorFactory<>() );
And I get...
Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Invalid service: net.imagej.legacy.LegacyConsoleService
    at org.scijava.service.ServiceHelper.createExactService(ServiceHelper.java:280)
    at org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:231)
    at org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:194)
    at org.scijava.service.ServiceHelper.loadServices(ServiceHelper.java:166)
    at org.scijava.Context.<init>(Context.java:278)
    at org.scijava.Context.<init>(Context.java:234)
    at org.scijava.Context.<init>(Context.java:174)
    at org.scijava.Context.<init>(Context.java:160)
    at io.scif.img.AbstractImgIOComponent.<init>(AbstractImgIOComponent.java:57)
    at io.scif.img.ImgSaver.<init>(ImgSaver.java:103)
    at io.scif.img.IO.saveImg(IO.java:299)
… <goes on for ever> ...
Florian Jug
@fjug
Aug 03 2016 22:21
If started as standalone app I create context and OPService as posted above and it works.
Never really used all this before I feel quite overwhelmed… ;)
Anyways… I will have to go to bed now… Hear you tomorrow! Thanks again for your precious help!
Florian Jug
@fjug
Aug 03 2016 22:30
?! Ok, last thing for today… I cannot upload to a new update site called ‘Tr2d’. It worked wonderfully until like 2 min ago...
I mistyped my pwd once, then upload got stuck. Canceled and retried, now I get:
User Tr2d lack upload permissions for http://site.imagej.net/Tr2d/
How can I recover from that?
Screen Shot 2016-08-04 at 00.35.12.png
Uh… maybe not only my problem… or is it?
This image is what I see when I try to start the updater on a freshly started Fiji...
This all points at GOING TO BED! ;)