Permalink
Browse files

Add wrapper for transformed ROIs

  • Loading branch information...
awalter17 committed Dec 20, 2016
1 parent f1cc7aa commit 35086cf17a7250f889ba3418a5f12b06a7579a65
Showing with 41 additions and 0 deletions.
  1. +41 −0 src/main/java/net/imglib2/roi/util/RealIntervalView.java
@@ -0,0 +1,41 @@
package net.imglib2.roi.util;
import net.imglib2.AbstractRealInterval;
import net.imglib2.RealInterval;
import net.imglib2.RealRandomAccess;
import net.imglib2.RealRandomAccessible;
import net.imglib2.RealRandomAccessibleRealInterval;
/**
* Puts {@link RealInterval} boundaries on a given {@link RealRandomAccessible}.
*
* @author Alison Walter
*/
public class RealIntervalView< T > extends AbstractRealInterval implements RealRandomAccessibleRealInterval< T >
{
private final RealRandomAccessible< T > source;
public RealIntervalView( final RealInterval interval, final RealRandomAccessible< T > source )
{
super( interval );
this.source = source;
}
@Override
public RealRandomAccess< T > realRandomAccess()
{
return source.realRandomAccess();
}
@Override
public RealRandomAccess< T > realRandomAccess( final RealInterval interval )
{
return source.realRandomAccess( interval );
}
public RealRandomAccessible< T > getSource()
{
return source;
}
}

0 comments on commit 35086cf

Please sign in to comment.