Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Jan Eglinger
    @imagejan
    @ctrueden ok
    A possibility might be to have a function that takes the current ColorTable8 and convert into a 3-channel RAI first...
    Curtis Rueden
    @ctrueden
    However, at the moment, it does not do anything smart.
    You could use an ImgLib2 Converters utility method to massage the data into a multi-channel view.
    Jan Eglinger
    @imagejan
    I see
    Curtis Rueden
    @ctrueden
    There are multiple places where color tables can end up being used: in an ImgLib2 Converter would be one of them.
    The other would be the CompositeXYProjector that is used by the SJJK as well as the ImageJ2 modern UI.
    The CompositeXYProjector lets you use whatever color table you want for each channel.
    Jan Eglinger
    @imagejan
    I’ll check it out...
    Thanks for the pointers.
    Curtis Rueden
    @ctrueden
    I was trying to whip up some code in Jupyter... but it takes a while.
    Hadrien Mary
    @hadim
    Ideally we need a Jupyterlab/Notebook extension that get the image data from the kernel and display them with a nice JS widget.
    Kyle I S Harrington
    @kephale
    ^^^ seconded. that display code includes some dependencies that hopefully will get factored out of SJJK
    Curtis Rueden
    @ctrueden
    Argh mime types. I wrote some code that lets you pass your own LUTs, but it just ends up dumping base64-encoded data as a string. I tried leaving off that step and just returning the BufferedImage directly, but that also doesn't work
    #@ OpService ops
    
    import net.imglib2.converter.RealLUTConverter
    import net.imglib2.display.projector.composite.CompositeXYProjector
    import net.imglib2.display.screenimage.awt.ARGBScreenImage
    import net.imagej.notebook.ImageJNotebookService.ValueScaling
    import org.scijava.notebook.converter.NotebookConverters
    
    display = { source, luts, xAxis, yAxis, cAxis, scaling, pos ->
        image = ops.transform().zeroMinView(source)
    
        w = xAxis >= 0 ? (int) image.dimension(xAxis) : 1
        h = yAxis >= 0 ? (int) image.dimension(yAxis) : 1
        c = cAxis >= 0 ? (int) image.dimension(cAxis) : 1
        target = new ARGBScreenImage(w, h)
        converters = []
    
        full = scaling == ValueScaling.FULL ||
            scaling == ValueScaling.AUTO && isNarrowType(source);
    
        if (full) {
            // scale the intensities based on the full range of the type
            min = image.firstElement().getMinValue()
            max = image.firstElement().getMaxValue()
        } else {
            // scale the intensities based on the sample values
            ii = ops.transform().flatIterableView(source)
            minMax = ops.stats().minMax(ii)
            min = minMax.getA().getRealDouble()
            max = minMax.getB().getRealDouble()
        }
    
        for (int i = 0; i < c; i++) {
            converters.add(new RealLUTConverter(min, max, luts[i]))
        }
        proj = new CompositeXYProjector(image, target, converters, cAxis);
        if (pos != null && pos.length > 0) proj.setPosition(pos)
        proj.setComposite(true)
        proj.map()
    
        // Convert to PNG
        return NotebookConverters.toPNG(target.image())
    }
    
    import net.imglib2.img.array.ArrayImgs
    import net.imagej.display.ColorTables
    
    w = 256; h = 192
    bytes = new byte[w * h]
    for (y=0; y<h; y++) {
        for (x=0; x<w; x++) {
            bytes[y * w + x] = (x + y) & 0xff
        }
    }
    source = ArrayImgs.unsignedBytes(bytes, w, h, 1)
    luts = [ ColorTables.FIRE ]
    
    display(source, luts, 0, 1, 2, ValueScaling.FULL, [] as long[])
    The right thing to do is probably for ImageJNotebookService.display(Dataset) to extract the LUTs and pass those to a new RAIToPNG that accepts the LUTs. But we have to be careful with LUT indices. They correspond to Dataset plane indices which are nontrivial to reason about.
    I really need to work on SJC now, so I'll leave it there.
    Jan Eglinger
    @imagejan
    Thanks a lot, @ctrueden, that’s already of great help!
    matrixbot
    @matrixbot
    superusercode test
    superusercode Does ImageJ have an official IRC channel?
    Niko Ehrenfeuchter
    @ehrenfeu
    @matrixbot you kind of found it (although it's not IRC) - but note that this is primarily intended for developer's discussions, for help with using ImageJ the official ImageJ Forum is a much better location...
    If you're desperate for IRC you could try https://irc.gitter.im/ but note that it's officially beta
    matrixbot
    @matrixbot
    superusercode I'll just continue accessing through matrix then
    Jan Eglinger
    @imagejan
    ImageJ Logo.gif
    How about a new splash screen animation?
    Gabriel Einsdorf
    @gab1one
    oh cool
    Max Leiter
    @MaxLeiter
    ehrenfeu: fitter has an IRC gateway
    gitter*
    I use it and it works quite well
    Max Leiter
    @MaxLeiter
    oh, just saw ehrenfeu mentioned it
    Niko Ehrenfeuchter
    @ehrenfeu
    Never mind, good to hear there's a working solution. Haven't been on IRC any more for probably five years by now...
    Max Leiter
    @MaxLeiter
    huh, funny that matrix bot is matrix <=> gitter <=> IRC
    matrixbot
    @matrixbot
    superusercode That's exactly why I'm using it
    superusercode What client are you using?
    matrixbot
    @matrixbot
    superusercode also, if you want to use gitter through matrix, here the room https://riot.im/app/#/room/#ImageJ:matrix.org
    Hadrien Mary
    @hadim
    @bnorthan : Nice post on the forum. Can I suggest you to delete my branch? Now that build system has been integrated to master, it's not really useful. Also you should gitignore native/lib as it is supposed to be a temporary folder to store generated libraries before integration in platform dependant package.
    Curtis Rueden
    @ctrueden
    @imagejan I'm not sure why, but that animation makes me feel uneasy! Like being squashed in a factory. Maybe I've played too many video games where you are running around on conveyor belts dodging pistons.
    But in general I am all for animated splash screens. Especially once we switch to a Java-based launcher.
    Gabriel Einsdorf
    @gab1one
    Yes the animation looks a bit like a sheet of metal being hammered
    Brian Northan
    @bnorthan
    @hadim I'd like to keep your branch around for a while. It's much simpler, than master, and it does not require installing MKL to build it. I think it would be useful, if someone just wanted to try out the YacuDecu deconvolution, without having to worry about all the other stuff.
    Hadrien Mary
    @hadim
    Ok I get it.
    Curtis Rueden
    @ctrueden
    Maybe we should go multimodule on ops-experiments?
    Then you can have different explorations with different deps.
    Hadrien Mary
    @hadim
    Good idea and once something is stable and "easy to build" (at least on CI services) we can push it to a ops-deconvolution repo.
    Curtis Rueden
    @ctrueden
    :+1:
    Hadrien Mary
    @hadim
    @ctrueden do you know when you gonna release the next version of ops, 0.40.0? Trying to get rid of some RequireReproducibleBuilds errors since I am using SNAPSHOT deps.
    By the way I tried to use <enforcer.skip>true</enforcer.skip> but I still get the error.
    Putting <enforcer.skip>true</enforcer.skip> directly in the pom.xml works for now.
    amirffff
    @amirffff
    Hi everyone
    doese someone here at the momen?