Class BoundingBoxReorientation
java.lang.Object
net.preibisch.mvrecon.process.boundingbox.BoundingBoxReorientation
- All Implemented Interfaces:
BoundingBoxEstimation
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBoundingBoxReorientation(SpimData2 spimData, ArrayList<net.imglib2.RealLocalizable> points, double percent, boolean testRotations, List<mpicbg.spim.data.sequence.ViewId> viewIdsToApply) BoundingBoxReorientation(SpimData2 spimData, List<mpicbg.spim.data.sequence.ViewId> viewIdsForEstimation, String label, boolean useCorresponding, double percent, boolean testRotations, List<mpicbg.spim.data.sequence.ViewId> viewIdsToApply) BoundingBoxReorientation(SpimData2 spimData, List<mpicbg.spim.data.sequence.ViewId> viewIdsForEstimation, HashMap<mpicbg.spim.data.sequence.ViewId, ? extends Collection<? extends net.imglib2.RealLocalizable>> points, double percent, boolean testRotations, List<mpicbg.spim.data.sequence.ViewId> viewIdsToApply) -
Method Summary
Modifier and TypeMethodDescriptionprotected net.imglib2.util.Pair<net.imglib2.realtransform.AffineTransform3D, double[]> protected net.imglib2.util.Pair<double[], double[]> static ArrayList<net.imglib2.RealLocalizable> extractPoints(String label, boolean useCorresponding, boolean transform, List<mpicbg.spim.data.sequence.ViewId> viewIds, SpimData2 data) Gets point locations in local or global coordinatesstatic ArrayList<net.imglib2.RealLocalizable> extractPoints(HashMap<mpicbg.spim.data.sequence.ViewId, ? extends Collection<? extends net.imglib2.RealLocalizable>> pointsIn, List<mpicbg.spim.data.sequence.ViewId> viewIdsForEstimation, SpimData2 spimData) static Transform3DgetRotation(Vector3d v0, Vector3d v1) Computes a Transform3D that will rotate vector v0 into the direction of vector v1.static final doublesquareDistance(double p1x, double p1y, double p1z, double p2x, double p2y, double p2z) protected net.imglib2.util.Pair<Double, double[]> testAxis(Vector3d v, List<net.imglib2.RealLocalizable> points) Test one major axis for the minimal bounding box volume required
-
Field Details
-
reorientationDescription
-
-
Constructor Details
-
BoundingBoxReorientation
public BoundingBoxReorientation(SpimData2 spimData, List<mpicbg.spim.data.sequence.ViewId> viewIdsForEstimation, HashMap<mpicbg.spim.data.sequence.ViewId, ? extends Collection<? extends net.imglib2.RealLocalizable>> points, double percent, boolean testRotations, List<mpicbg.spim.data.sequence.ViewId> viewIdsToApply) - Parameters:
spimData- - the spimdata objectviewIdsForEstimation- - which ViewIds to use for BoundingBox determinationpoints- - a Map linking a list of locations of points to each ViewId used for estimationpercent- - extend/shrink the computed bounding box by the specified percentage (e.g. 10%, -%5, etc.)testRotations- - if free rotations should be allowed in order to reorient the sample and minimize the bounding box. Warning: this will preconcatenate another rigid transform to all views listed in viewIdsToApplyviewIdsToApply- - only used if testRotations==true, these are the views the identified rotation minimizing the bounding box size will be applied to
-
BoundingBoxReorientation
public BoundingBoxReorientation(SpimData2 spimData, List<mpicbg.spim.data.sequence.ViewId> viewIdsForEstimation, String label, boolean useCorresponding, double percent, boolean testRotations, List<mpicbg.spim.data.sequence.ViewId> viewIdsToApply) -
BoundingBoxReorientation
public BoundingBoxReorientation(SpimData2 spimData, ArrayList<net.imglib2.RealLocalizable> points, double percent, boolean testRotations, List<mpicbg.spim.data.sequence.ViewId> viewIdsToApply)
-
-
Method Details
-
estimate
- Specified by:
estimatein interfaceBoundingBoxEstimation
-
determineOptimalBoundingBox
protected net.imglib2.util.Pair<net.imglib2.realtransform.AffineTransform3D,double[]> determineOptimalBoundingBox() -
testAxis
protected net.imglib2.util.Pair<Double,double[]> testAxis(Vector3d v, List<net.imglib2.RealLocalizable> points) Test one major axis for the minimal bounding box volume required- Parameters:
v- - normalized vectorpoints- - all points- Returns:
- - the volume and minX, minY, minZ, maxX, maxY, maxZ as Pair
-
getRotation
Computes a Transform3D that will rotate vector v0 into the direction of vector v1. Note: vectors MUST be normalized for this to work!- Parameters:
v0- - vector 0v1- - vector 1- Returns:
- the transform
-
squareDistance
public static final double squareDistance(double p1x, double p1y, double p1z, double p2x, double p2y, double p2z) -
determineSizeSimple
-
extractPoints
public static ArrayList<net.imglib2.RealLocalizable> extractPoints(String label, boolean useCorresponding, boolean transform, List<mpicbg.spim.data.sequence.ViewId> viewIds, SpimData2 data) Gets point locations in local or global coordinates- Parameters:
label- - which label to useuseCorresponding- - use only corresponding points?transform- - transform the points? Yes for Bounding box, no for PSF extractionviewIds- - which viewIds to processdata- - the SpimData object- Returns:
- - a list of RealLocalizable objects
-
extractPoints
public static ArrayList<net.imglib2.RealLocalizable> extractPoints(HashMap<mpicbg.spim.data.sequence.ViewId, ? extends Collection<? extends net.imglib2.RealLocalizable>> pointsIn, List<mpicbg.spim.data.sequence.ViewId> viewIdsForEstimation, SpimData2 spimData)
-