net.imglib2.Sampler Java Examples

The following examples show how to use net.imglib2.Sampler. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ConsensusWarpFieldBuilder.java    From render with GNU General Public License v2.0 6 votes vote down vote up
private int[] buildModelIndexGrid() {

        final int[] targetCellIndexes = new int[getNumberOfCells()];

        final ArrayImg<ARGBType, IntArray> target = ArrayImgs.argbs(targetCellIndexes, columnCount, rowCount);
        final KDTree<ARGBType> kdTree = new KDTree<>(consensusSetIndexSamples);
        final NearestNeighborSearch<ARGBType> nnSearchSamples = new NearestNeighborSearchOnKDTree<>(kdTree);

        final Cursor<ARGBType> targetCursor = target.localizingCursor();

        Sampler<ARGBType> sampler;
        ARGBType sampleItem;
        ARGBType targetItem;
        while (targetCursor.hasNext()) {

            targetCursor.fwd();
            nnSearchSamples.search(targetCursor);
            sampler = nnSearchSamples.getSampler();

            sampleItem = sampler.get();
            targetItem = targetCursor.get();
            targetItem.set(sampleItem);
        }

        return targetCellIndexes;
    }
 
Example #2
Source File: DerivedMatchGroup.java    From render with GNU General Public License v2.0 6 votes vote down vote up
private List<Integer> getSetIndexesForPoints(final RealPointSampleList<ARGBType> largestSetIndexSamples,
                                             final List<RealPoint> otherSetPoints) {

    final List<Integer> setIndexList = new ArrayList<>();

    final KDTree<ARGBType> kdTree = new KDTree<>(largestSetIndexSamples);
    final NearestNeighborSearch<ARGBType> nnSearchSamples = new NearestNeighborSearchOnKDTree<>(kdTree);

    Sampler<ARGBType> sampler;
    ARGBType sampleItem;
    int nnSetIndex;
    for (final RealPoint otherPoint : otherSetPoints) {
        nnSearchSamples.search(otherPoint);
        sampler = nnSearchSamples.getSampler();

        sampleItem = sampler.get();
        nnSetIndex = sampleItem.get();
        setIndexList.add(nnSetIndex);
    }

    return setIndexList;
}
 
Example #3
Source File: GameOfLife3D.java    From sciview with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private boolean alive( final Sampler<UnsignedByteType> access ) {
    return access.get().get() == ALIVE;
}
 
Example #4
Source File: AveragedRandomAccessible.java    From BigStitcher with GNU General Public License v2.0 4 votes vote down vote up
@Override
public Sampler< T > copy()
{
	return copyRandomAccess();
}
 
Example #5
Source File: BlendedExtendedMirroredRandomAccesible2.java    From BigStitcher with GNU General Public License v2.0 4 votes vote down vote up
@Override
public Sampler<T> copy() {
	return copyRandomAccess();
}
 
Example #6
Source File: BlendingRealRandomAccess.java    From BigStitcher with GNU General Public License v2.0 4 votes vote down vote up
@Override
public Sampler<FloatType> copy() { return copyRealRandomAccess(); }
 
Example #7
Source File: SlicesII.java    From imagej-ops with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Override
public Sampler<RandomAccessibleInterval<T>> copy() {
	return copyCursor();
}
 
Example #8
Source File: ShuffledView.java    From imagej-ops with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Override
public Sampler<T> copy() {
	throw new UnsupportedOperationException();
}
 
Example #9
Source File: BlendingRealRandomAccess.java    From SPIM_Registration with GNU General Public License v2.0 4 votes vote down vote up
@Override
public Sampler<FloatType> copy() { return copyRealRandomAccess(); }