public final class DiscCursor<T extends RealType<T>> extends DomainCursor<T>
size
calibration, origin, position
cursor, hasNext, img
Constructor and Description |
---|
DiscCursor(Image<T> img,
float[] center,
float radius)
Construct a
DiscCursor on an image, using the spatial calibration
stored in the image and a default OutOfBoundsStrategyValueFactory
to handle off-bounds locations. |
DiscCursor(Image<T> img,
float[] center,
float radius,
float[] calibration)
Construct a
DiscCursor on an image with a given spatial calibration,
using a default OutOfBoundsStrategyValueFactory to handle off-bounds locations. |
DiscCursor(Image<T> img,
float[] center,
float radius,
float[] calibration,
OutOfBoundsStrategyFactory<T> outOfBoundsFactory)
Construct a
DiscCursor on an image with a given spatial calibration. |
DiscCursor(Image<T> img,
Localizable centerCursor,
float radius)
Construct a
DiscCursor on an, using the spatial calibration
stored in the image and a default OutOfBoundsStrategyValueFactory
to handle off-bounds locations. |
DiscCursor(Image<T> img,
Localizable centerCursor,
float radius,
float[] calibration)
Construct a
DiscCursor on an image, using the given spatial calibration
and a default OutOfBoundsStrategyValueFactory
to handle off-bounds locations. |
DiscCursor(Image<T> img,
Localizable centerCursor,
float radius,
float[] calibration,
OutOfBoundsStrategyFactory<T> outOfBoundsFactory)
Construct a
DiscCursor on an image with a given spatial calibration
and a given OutOfBoundsStrategyFactory to handle off-bounds locations. |
Modifier and Type | Method and Description |
---|---|
void |
fwd() |
int |
getNPixels()
Return the number of pixels this cursor will iterate on (or, the number of iterations
it will do before exhausting).
|
double |
getPhi()
Return the azimuth of the spherical coordinates of this cursor, with respect
to its center.
|
void |
reset() |
void |
setSize(float size)
Change the radius of the disc this cursor iterates on.
|
getDistanceSquared, getPhysicalRelativeCoordinates, getRelativePosition, moveCenterTo, moveCenterToCoordinates, moveCenterToPosition
close, createPositionArray, fwd, getArrayIndex, getDimensions, getDimensions, getImage, getNumDimensions, getPosition, getPosition, getPosition, getPositionAsString, getStorageContainer, getStorageIndex, getType, hasNext, isActive, iterator, next, remove, setDebug
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining
forEach, spliterator
public DiscCursor(Image<T> img, float[] center, float radius, float[] calibration, OutOfBoundsStrategyFactory<T> outOfBoundsFactory)
DiscCursor
on an image with a given spatial calibration.img
- the imagecenter
- the disc center, in physical unitsradius
- the disc radius, in physical unitscalibration
- the spatial calibration (pixel size); if null
,
a calibration of 1 in all directions will be usedoutOfBoundsFactory
- the OutOfBoundsStrategyFactory
that will be used to handle off-bound locationspublic DiscCursor(Image<T> img, float[] center, float radius, float[] calibration)
DiscCursor
on an image with a given spatial calibration,
using a default OutOfBoundsStrategyValueFactory
to handle off-bounds locations.img
- the imagecenter
- the disc center, in physical unitsradius
- the disc radius, in physical unitscalibration
- the spatial calibration (pixel size); if null
,
a calibration of 1 in all directions will be usedpublic DiscCursor(Image<T> img, float[] center, float radius)
DiscCursor
on an image, using the spatial calibration
stored in the image and a default OutOfBoundsStrategyValueFactory
to handle off-bounds locations.img
- the imagecenter
- the disc center, in physical unitsradius
- the disc radius, in physical unitsImage.setCalibration(float[])
public DiscCursor(Image<T> img, Localizable centerCursor, float radius, float[] calibration, OutOfBoundsStrategyFactory<T> outOfBoundsFactory)
DiscCursor
on an image with a given spatial calibration
and a given OutOfBoundsStrategyFactory
to handle off-bounds locations.
The center of the disc is set by the Localizable
given in argument.img
- the imagecenterCursor
- the localizable object which position will set the disc centerradius
- the disc radius, in physical unitscalibration
- the spatial calibration (pixel size); if null
,
a calibration of 1 in all directions will be usedpublic DiscCursor(Image<T> img, Localizable centerCursor, float radius, float[] calibration)
DiscCursor
on an image, using the given spatial calibration
and a default OutOfBoundsStrategyValueFactory
to handle off-bounds locations. The center of the disc
is set by the Localizable
given in argument.img
- the imagecenterCursor
- the cursor which position will set the disc centerradius
- the disc radius, in physical unitspublic DiscCursor(Image<T> img, Localizable centerCursor, float radius)
DiscCursor
on an, using the spatial calibration
stored in the image and a default OutOfBoundsStrategyValueFactory
to handle off-bounds locations. The center of the disc
is set by the Localizable
given in argument.img
- the imagecenterCursor
- the localizable object which position will set the disc centerradius
- the disc radius, in physical unitspublic void setSize(float size)
setSize
in class DomainCursor<T extends RealType<T>>
size
- the radius to set, in physical units.public int getNPixels()
AbstractSpecialCursor
DiscCursordc = new DiscCursor(img, center, 5); int arrraySize = sc.getNPixels(); float[] pixelVal = new float[arraySize]; int index = 0; while (sc.hasNext()) { sc.fwd(); pixelVal[index] = sc.getType().getRealFloat(); index++; }
getNPixels
in class AbstractSpecialCursor<T extends RealType<T>>
public final double getPhi()
In cylindrical coordinates, the azimuth is the angle measured between the X axis and the line OM where O is the sphere center and M is the cursor location
public void reset()
public void fwd()
Copyright © 2015–2021 Fiji. All rights reserved.