Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 12:41
    arve0 closed #32
  • 09:52
    imagejan commented #249
  • 09:45
    imagejan edited #249
  • 03:10
    lindensmith opened #249
  • Apr 03 13:43

    tpietzsch on master

    clean up (compare)

  • Apr 02 15:58

    tpietzsch on mastodon-1.0.0-beta-15

    [maven-release-plugin] prepare … (compare)

  • Apr 02 15:58

    tpietzsch on master

    Bump to next development cycle … (compare)

  • Apr 02 15:53

    tpietzsch on update-bdv-core

    (compare)

  • Apr 02 15:53

    tpietzsch on master

    Update ui-behaviour version to … WIP: adopt new BDV UI Fix key event dispatch All sho… and 1 more (compare)

  • Apr 02 15:53
    tpietzsch closed #114
  • Apr 02 15:53
    tpietzsch opened #114
  • Apr 02 15:52

    tpietzsch on update-bdv-core

    Update ui-behaviour version to … WIP: adopt new BDV UI Fix key event dispatch All sho… and 1 more (compare)

  • Apr 02 15:50

    tpietzsch on generalize-plugin-annotations

    (compare)

  • Apr 02 15:50

    tpietzsch on absolute-paths

    (compare)

  • Apr 02 15:50

    tpietzsch on master

    POM: update dependency versions… Maintain the absolute/relative … Don't just fail when opening a … (compare)

  • Apr 02 15:50
    tpietzsch closed #113
  • Apr 02 15:49

    tpietzsch on master

    Use more general type in all @P… Merge pull request #112 from ma… (compare)

  • Apr 02 15:49
    tpietzsch closed #112
  • Mar 31 10:47
    tpietzsch synchronize #113
  • Mar 31 10:47

    tpietzsch on absolute-paths

    POM: update dependency versions… Maintain the absolute/relative … Don't just fail when opening a … (compare)

tpietzsch
@tpietzsch
But that is more an implementation detail of the current sources
(but pretty reliable)
otherwise: BdvFunctions.show(mySpimData); returns a List<BdvStackSource<?>>
you can use the BdvSource.removeFromBdv() for each of the BdvStackSource and then use BdvFunctions.show(mySpimData, Bdv.options().addTo(...)); to add them again
NicoKiaru
@NicoKiaru
Ok, since I'm working with 2d slice scanners file, there's no (or a single) timepoint. I'll try the other option.
tpietzsch
@tpietzsch
Depending on whether its a window or just a panel:
the window will probably close when all sources are removed
so maybe BdvFunctions.show(mySpimData, Bdv.options().addTo(...));
before you remove the old sources
NicoKiaru
@NicoKiaru

There is a CacheService backed by a weak hash map, into which you can put that stuff.

I wasn't aware of the CacheService, and I didn't know what a WeakHashMap was. That looks incredibly useful!

Kyle I S Harrington
@kephale
@maarzt labkit is looking fantastic these days. has anything been developed for applying the classifiers trained with labkit in a headless way (e.g., train on my laptop, segment on a cluster)?
oh, Others > Batch segment images, i can find the corresponding code
Christian "Tischi" Tischer
@tischi
@tpietzsch @NicoKiaru would it be feasible and useful to implement a BdvFunctions.show( SourceAndConverter )? I think that would be very useful to, e.g., give users the possibility to use own LUTs for displaying data in the Bdv. Currently, to achieve this, one needs to construct oneself a Source<ARGBType> and then call BdvFunctions.show( Source<ARGBType> ). This works fine in principle, but the actual pixel values in Bdv are then from 0 to 255 and do not reflect the real data anymore, which I think is not ideal.
NicoKiaru
@NicoKiaru
Actually, related to the point @tischi suggest : I try to implement a bigdataviewer- scijava repo, and one problem I came across is the following : when you perform processing, you want to act on the 'real' source, but when you want to display it, you want a 'volatile source' (or a converter (Volatile)ARGBType, as @tischi said). To circumvent this issue, I wanted to use the CacheService with WeakHashMap in order to be always able to retrieve the source and the volatile source (and potentially the RGBified source), one form another. But I don't know if it's a good idea. If you think it is, I'll go for it. If you plan to implement extra stuff in BdvFunctionsor in the new BigDataViewer UI which will make my efforts obsolete very fast, I'd rather not do it.
Philipp Hanslovsky
@hanslovsky
@tischi sounds like a great pull request :smile:
@NicoKiaru In Paintera I keep track of the data and volatile sources. In particular, I implemented an interface DataSource<T, V> extends Source<V> that provides both the data and volatile voxels. (As it extends Source, you could just pass it into a regular BDV if you wanted to)
Also, @tpietzsch is on vacation right now.
Christian "Tischi" Tischer
@tischi

Also, @tpietzsch is on vacation right now.

Maybe I better way until he is back before working on the PR? Because I think we talked about this before and I am not sure what his latest plans were...

Christian "Tischi" Tischer
@tischi

when you perform processing, you want to act on the 'real' source, but when you want to display it, you want a 'volatile source' (or a converter (Volatile)ARGBType

This was partly my point of suggesting to work more with SourceAndConverter objects, because you would have the Source holding the actual data together with the Converter< R, VolatileARGBType > that can be used for rendering. The job of actually applying the Converter to the Source could then be delegated to be done inside Bdv, because outside Bdv it anyway isn't useful?!

However, one limitation with this idea is here: https://forum.image.sc/t/bigdataviewer-blending-modes/28568/8
For my applications, I seem to need to also specify a special VolatileARGBType out-of-bounds value, which is currently not part of the Converter but of the Source....

NicoKiaru
@NicoKiaru
@tischi, ok, if I understand correctly, there's no need to keep an extra volatile source, because you can do everything using the VolatileARGBType, right ?
NicoKiaru
@NicoKiaru
@hanslovsky cool! I fear a bit the fact, that I'm wrapping many times the source (Source -> AffineTransformedSource -> WarpedSource (-> DataSource)). But that looks like a very good solution. (this interface, right ? https://github.com/saalfeldlab/paintera/blob/master/src/main/java/org/janelia/saalfeldlab/paintera/data/DataSource.java). However why is your function getDataSource(int t, int level); returning a RandomAccessibleInterval ? Why not a Source ?
Philipp Hanslovsky
@hanslovsky
Because all the shared meta data (transforms, etc) are stored within a single source, that way.
And I can just query the data or volatile as I need it
NicoKiaru
@NicoKiaru
Ah I see, so you track somewhere else the list of sources which should be transformed in an identical manner ?
Philipp Hanslovsky
@hanslovsky
Each source (and data source) has its own transform in my use case. It's just a matter of accessing data and volatile voxels in a consistent way
NicoKiaru
@NicoKiaru
Ok, I'll have to think about it, thanks for the explanations
Christian "Tischi" Tischer
@tischi
@NicoKiaru I discussed this once with Tobias and I think the conclusion was that one usually only needs Volatile pixels types within the Bdv for rendering, such that you can rotate a volume quickly, even is the data is not yet loaded (i.e. not valid). For any sort of computation one typically wants to have the actual valid data. Thus, I think, one way of seeing the issue is that we would never have to care about Volatile data outside Bdv, but upon saying BdvFuntion.show( source ), Bdv would internally VolatileViews.wrapAsVolatile( ... ) for you. Currently however there are some limitations, e.g. VolatileViews.wrapAsVolatile( ) is only implemented for RandomAccessible and not for a Source and also VolatileViews.wrapAsVolatile( ) does not always work, e.g. if the RAI is internally derived from too complicated Views and Converters. With the help of @hanslovsky I added some functionality to VolatileViews.wrapAsVolatile( ) to make it cover more scenarios, see e.g. https://github.com/tischi/fiji-plugin-bigDataProcessor2/blob/master/src/main/java/de/embl/cba/bdp2/volatiles/VolatileViews.java#L186 but there are still cases where it cannot handle it.
NicoKiaru
@NicoKiaru
cool! Thanks @tischi that's very good to know. Maybe we can work on this Source wrapping in BdvFunctions @tischi ? Would this class be generic enough ? https://github.com/BIOP/bigdataviewer-bioformats/blob/master/src/main/java/ch/epfl/biop/bdv/bioformats/bioformatssource/VolatileBdvSource.java
For now, while waiting for BdvFunctions to wrap a Source into a volatile Source, I think we have to keep the (optional) wrapping in the bigdataviewer-bioformats repo.
NicoKiaru
@NicoKiaru
Something which is not clear to me is the image loader: outside of BdvFunctions, it seems that a SetupLoader which extends an AbstractViewerSetupImgLoader should also provide a Volatile source. As a consequence the source volatile wrapping has to be done internally to the repository anyway.
Christian "Tischi" Tischer
@tischi

it seems that a SetupLoader which extends an AbstractViewerSetupImgLoader should also provide a Volatile source.

This is exactly the kind of stuff I was also just thinking about. To me, right now it seems as if there are two ways to provide Volatile pixels: (a) via the SetupLoader logic and (b) via this kind of logic: https://github.com/tischi/fiji-plugin-bigDataProcessor2/blob/master/src/main/java/de/embl/cba/bdp2/volatiles/VolatileViews.java#L118 where a CachedCellImg can be made to return Volatile pixel values. Honestly, I think I would need a Skype, probably with someone like @tpietzsch or @hanslovsky and a white-board to draw how all these things are connected :-)

Philipp Hanslovsky
@hanslovsky

The SetupLoader existed before the CachedCellImg. I use CachedCellImgs exclusively because it is extremely convenient. There may be benefits of SetupLoader that I am not aware of.

VolatileViews.wrapAsVolatile should be sufficient for any/most standard ImgLib2 native types. It gets a little more tricky when more complex types are being used, e.g. LabelMultisetType in Paintera, or Composite<T> vector-like types.

Christian "Tischi" Tischer
@tischi
@hanslovsky very interesting! Do you use SpimData at all? Or do you mainly work with Source?
Philipp Hanslovsky
@hanslovsky
I do not use SpimData, only Source.
Curtis Rueden
@ctrueden
@tpietzsch This article reminds me of all the equality semantics woes we have when composing multiple interfaces. :grin:
tpietzsch
@tpietzsch
@tischi @NicoKiaru Quick explanation of the volatile/non-volatile stuff:
There is ViewerSetupImgLoader. It extends BasicMultiResolutionSetupImgLoader and adds methods
RandomAccessibleInterval<V> getVolatileImage( final int timepointId, final int level, ImgLoaderHint... hints );
V getVolatileImageType();
on top of the existing
RandomAccessibleInterval< T > getImage( final int timepointId, final int level, ImgLoaderHint... hints );
T getImageType();
tpietzsch
@tpietzsch
So it can provide both volatile and non-volatile version of each image (types would be eg T == UnsignedByteType and V == VolatileUnsignedByteType
The implicit idea is that both images are backed by the same data, just that the non-volatile version blocks when invalid data is encountered until that data is loaded. So for example, if a pixel is accesses in the non-volatile image, that pixel is then automatically already valid in the volatile version. (This is the same with VolatileViews.wrapAsVolatile btw).
tpietzsch
@tpietzsch
The BDV will show sources of any type. The Bdv knows about sources always as SourceAndConverter (because for rendering there must be a converter from the source's pixel type to ARGB).
SourceAndConverter has a method
SourceAndConverter< ? extends Volatile< T > > asVolatile();
that returns a volatile version of the source(andconverter) if it exists.
(otherwise asVolatile returns null)
The idea is that always the non-volatile version is added to the BDV, maybe with the volatile version nested underneath
This way, if somebody takes the source and does image processing, movie rendering, etc, they get the non-volatile version and there are no surprises.
The renderer will ask for the asVolatile() version, and, if it exists, use that.
With the VolatileViews.wrapAsVolatile this idea was a bit weakened, because now you effectively add a volatile source directly (with nothing non-volatile on top of it)
tpietzsch
@tpietzsch
It would be probably good, to
(1) make a way to expose adding SourceAndConverter in the vistools BdvFunctions, and
(2) make some version of VolatileViews.wrapAsVolatile that constructs a volatile view, creates appropriate RGBA converters, and then wraps it with the original RandomAccessible into a non-volatile/volatile SourceAndConverter pair. The code for all of these steps is there, it just needs to be reorganized and exposed...
Curtis Rueden
@ctrueden
I sometimes come across posts/comments/discussions like this one: "what would python integration offer that isn’t already taken care of by cupy/Numba/pytorch/tensorflow etc".