Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Curtis Rueden
    @ctrueden
    @hadim I don't know the answer. But that question sounds super familiar. Did you ask it somewhere else? Or did someone else ask it on the forum maybe awhile back?
    Hadrien Mary
    @hadim
    @ctrueden I found nothing (Google or the forum)
    Curtis Rueden
    @ctrueden
    Maybe this thread? Not sure.
    Hadrien Mary
    @hadim
    All code there is IJ1 only
    Curtis Rueden
    @ctrueden
    For the second question: maybe Views.stack)?
    Hadrien Mary
    @hadim
    I am pretty sure the issue is related to IJ1/IJ2 conversion.
    I use this ImagePlus imp = ij.convert().convert(dataset, ImagePlus.class); to get the ImagePlus
    And getRoi return the correct Roi in jython...
    I'll have a look at Views.stack. Thanks
    Curtis Rueden
    @ctrueden
    The nice thing about Views is that it won't need to copy your pixels.
    But you'd have to rewrap it into a new Dataset afterward.
    Hadrien Mary
    @hadim
    Ok good to know.
    Curtis Rueden
    @ctrueden
    OK, regarding the getRoi being null: a Dataset cannot have a ROI. It can be part of an ImageDisplay which also includes other objects such as overlays. So if you convert directly from Dataset to ImagePlus then the resulting ImagePlus will never have a ROI.
    Hadrien Mary
    @hadim
    Ok so the only solution is to retrieve the ImagePlus via the IJ namespace I guess.
    Curtis Rueden
    @ctrueden
    Well, at the moment, the intended IJ2 way is to use the OverlayService to get the active overlay of an ImageDisplay.
    The ImageDisplay class is really more analogous to ImagePlus.
    And actually, those are what are mapped to one another internally.
    I'm not saying you should definitely do it that way right now. It might be more trouble than it is worth.
    Hadrien Mary
    @hadim
    I like trouble :-)
    Curtis Rueden
    @ctrueden
    Hehe.
    Hadrien Mary
    @hadim
    I didn't find how to get the ImageDisplay from a Dataset ?
    Should I iterate over idService.getImageDisplays() and test for each ImageDisplay ?
    Curtis Rueden
    @ctrueden
    Where are these Dataset objects coming from...?
    I guess I should read your code.
    But not tonight—I need to sleep now, sorry. :-/
    Hadrien Mary
    @hadim
    @Parameter(type = ItemIO.INPUT)
        private Dataset dataset;
    Curtis Rueden
    @ctrueden
    You can just change it to ImageDisplay ;-)
    Hadrien Mary
    @hadim
    yeah that's fine
    ok
    Curtis Rueden
    @ctrueden
    ImageDisplayService has a getActiveDataset which gives that back from the ImageDisplay.
    Hadrien Mary
    @hadim
    I would have prefer a method that specify the dataset but that's fine I'll do with getActiveDataset
    Curtis Rueden
    @ctrueden
    Well, it is possible for a Dataset to be present in multiple displays.
    And to have different overlays in each.
    Now, in the ImageJ 1.x UI that can't happen, really.
    Hadrien Mary
    @hadim
    Hum ok
    Curtis Rueden
    @ctrueden
    But the current data model allows it.
    Think of Dataset as the block of pixels, whereas a display is how you're visualizing it.
    So, Dataset has no position right now.
    Because again: two different displays could be showing it in two different places.
    In reality, there are multiple different sorts of ROIs and overlays... some might be important from the acquisition somehow, whereas others might be specified after the fact by the user—to measure a particular area, or to represent a particular segmentation, etc.
    Hadrien Mary
    @hadim
    Ok I understand
    Curtis Rueden
    @ctrueden
    So, perhaps some kinds of ROIs are saved in the original files on disk. But others, no.
    Anyway, I think if your plugin needs to know which overlay(s)/ROIs are part of the view, it needs to ask for an ImageDisplay instead of a Dataset. That is "more correct" here.
    OK, and now I am really turning in for the night. Otherwise when my kids bounce into my room at 6am I will struggle. :-) Good night @hadim!
    Hadrien Mary
    @hadim
    ahah
    Good night. Thanks.
    Hadrien Mary
    @hadim
    @ctrueden I released a version with the Method 3: Double push to master from http://imagej.net/Development_Lifecycle. It seems to be deprecated but I did it anyway since I couldn't do the other method. Let me know which method is currently used for deployment.
    Richard Domander
    @rimadoma
    I recently bumped my pom-imagej to 15.5.0, I guess something has changed since I don't need to declare runtime dependencies on JOGL anymore :smile:
    Thanks for that
    @ctrueden That mvn dependency:analyze trick you showed here yesterday became in handy. Cheers!
    Curtis Rueden
    @ctrueden
    @rimadoma :beers: !
    @hadim Double push is OK! Someday we will find a cleaner way but it works fine for now.