Skip to content

Commit

Permalink
New public method ImageJVirtualStack.getSource returning the underlyi…
Browse files Browse the repository at this point in the history
…ng RandomAccessibleInterval.

There are many occasions when one wants to get the underlying RandomAccessibleInterval. Offering a public method to return
the private field "source" addresses this well, so one can write, for example:

RandomAccessibleInterval<UnsignedShortType> rai = IJ.getImage().getStack().getSource();

Or more simply from a script:

rai = IJ.getImage().getStack().getSource()
  • Loading branch information
acardona authored Nov 8, 2023
1 parent 2dc417d commit 0ee4a1c
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -222,4 +222,10 @@ protected RandomAccessibleInterval< T > getSliceZeroBasedIndex( int index )
}
return origin;
}

/** Get the underlying ImgLib2 {@link RandomAccessibleInterval}. */
public RandomAccessibleInterval< T > getSource()
{
return source;
}
}

0 comments on commit 0ee4a1c

Please sign in to comment.