bigdataviewer / bigdataviewer-vistools

Helpers to use BigDataViewer as a quick visualization tool in other projects.
BSD 2-Clause "Simplified" License
25 stars 17 forks source link

Add toSourceAndConverter convenience method #6

Closed hanslovsky closed 7 years ago

hanslovsky commented 7 years ago

I added a convenience method

public static < T extends RealType< T > > List< SourceAndConverter< T > > toSourceAndConverter(
            final RandomAccessibleInterval< T > img,
            final Converter< T, ARGBType > converter,
            final AxisOrder axisOrder,
            final AffineTransform3D sourceTransform,
            final String... names )

that creates a List< SourceAndConverter< ? > > from a RandomAccessibleInterval< T > and a Converter< T, ARGBType >: https://github.com/hanslovsky/bigdataviewer-vistools/commit/dc6433484f25c08b7360c7771475eacdc960e99b

This makes it easy, for example, to create a standalone ViewerPanel just from a RandomAccessibleInterval.

Would it make sense to add this to master?

tpietzsch commented 7 years ago

@hanslovsky as mentioned on gitter, there is a standalone ViewerPanel already. See https://github.com/bigdataviewer/bigdataviewer-vistools/blob/master/src/test/java/bdv/util/PanelExample.java

Does this make this PR obsolete?

tpietzsch commented 7 years ago

@hanslovsky ... nevertheless, this looks useful

I think it would make sense to pull it out as a common part of addStackSourceARGBType and addStackSourceRealType.

I'll look into it while merging your PRs

hanslovsky commented 7 years ago

I agree. Right now, I just have it only for RandomAccessibleInterval but it would make sense for all other cases, as well. Let me know if you want me to do that.

hanslovsky commented 7 years ago

With the recent changes in bdv-vistools this has become obsolete for me. Re-open this issue if you think it is still valid.