Package mpicbg.stitching
Class PairWiseStitchingImgLib
java.lang.Object
mpicbg.stitching.PairWiseStitchingImgLib
Pairwise Stitching of two ImagePlus using ImgLib1 and PhaseCorrelation.
It deals with aligning two slices (2d) or stacks (3d) having an arbitrary
amount of channels. If the ImagePlus contains several time-points it will
only consider the first time-point as this requires global optimization of
many independent 2d/3d <-> 2d/3d alignments.
- Author:
- Stephan Preibisch (stephan.preibisch@gmx.de)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends mpicbg.imglib.type.numeric.RealType<T>>
booleanaverageAllChannels(mpicbg.imglib.image.Image<T> target, int[] offset, ij.ImagePlus imp, int timepoint) Averages all channels into the target image.protected static <T extends mpicbg.imglib.type.numeric.RealType<T>,S extends mpicbg.imglib.type.numeric.RealType<S>>
voidaverageAllChannels(mpicbg.imglib.image.Image<T> target, ArrayList<mpicbg.imglib.image.Image<S>> sources, int[] offset) Averages all channels into the target image.static booleancanWrapIntoImgLib(ij.ImagePlus imp, ij.gui.Roi roi, int channel) Determines if this imageplus with these parameters can be wrapped directly into anImage<T>.static <T extends mpicbg.imglib.type.numeric.RealType<T>,S extends mpicbg.imglib.type.numeric.RealType<S>>
PairWiseStitchingResultcomputePhaseCorrelation(mpicbg.imglib.image.Image<T> img1, mpicbg.imglib.image.Image<S> img2, int numPeaks, boolean subpixelAccuracy) static <T extends mpicbg.imglib.type.numeric.RealType<T>>
booleanfillInChannel(mpicbg.imglib.image.Image<T> target, int[] offset, ij.ImagePlus imp, int channel, int timepoint) Averages all channels into the target image.static <T extends mpicbg.imglib.type.numeric.RealType<T>>
mpicbg.imglib.image.Image<T> getImage(ij.ImagePlus imp, ij.gui.Roi roi, mpicbg.imglib.image.ImageFactory<T> imgFactory, int channel, int timepoint) return anImage<T>as input for the PhaseCorrelation.protected static ij.gui.RoigetWrappedImageFloat(ij.ImagePlus imp, int channel, int timepoint) return anImageofFloatTypeas input for the PhaseCorrelation.getWrappedImageUnsignedByte(ij.ImagePlus imp, int channel, int timepoint) return anImageofUnsignedByteTypeas input for the PhaseCorrelation.getWrappedImageUnsignedShort(ij.ImagePlus imp, int channel, int timepoint) return anImageofUnsignedShortTypeas input for the PhaseCorrelation.static <T extends mpicbg.imglib.type.numeric.RealType<T>,S extends mpicbg.imglib.type.numeric.RealType<S>>
PairWiseStitchingResultperformStitching(mpicbg.imglib.image.Image<T> img1, mpicbg.imglib.image.Image<S> img2, StitchingParameters params) static PairWiseStitchingResultstitchPairwise(ij.ImagePlus imp1, ij.ImagePlus imp2, ij.gui.Roi roi1, ij.gui.Roi roi2, int timepoint1, int timepoint2, StitchingParameters params)
-
Constructor Details
-
PairWiseStitchingImgLib
public PairWiseStitchingImgLib()
-
-
Method Details
-
stitchPairwise
public static PairWiseStitchingResult stitchPairwise(ij.ImagePlus imp1, ij.ImagePlus imp2, ij.gui.Roi roi1, ij.gui.Roi roi2, int timepoint1, int timepoint2, StitchingParameters params) -
performStitching
public static <T extends mpicbg.imglib.type.numeric.RealType<T>,S extends mpicbg.imglib.type.numeric.RealType<S>> PairWiseStitchingResult performStitching(mpicbg.imglib.image.Image<T> img1, mpicbg.imglib.image.Image<S> img2, StitchingParameters params) -
computePhaseCorrelation
public static <T extends mpicbg.imglib.type.numeric.RealType<T>,S extends mpicbg.imglib.type.numeric.RealType<S>> PairWiseStitchingResult computePhaseCorrelation(mpicbg.imglib.image.Image<T> img1, mpicbg.imglib.image.Image<S> img2, int numPeaks, boolean subpixelAccuracy) -
getImage
public static <T extends mpicbg.imglib.type.numeric.RealType<T>> mpicbg.imglib.image.Image<T> getImage(ij.ImagePlus imp, ij.gui.Roi roi, mpicbg.imglib.image.ImageFactory<T> imgFactory, int channel, int timepoint) return anImage<T>as input for the PhaseCorrelation.- Parameters:
imp- - theImagePlusimgFactory- - theImageFactorydefining wher to put it intochannel- - which channel (if channel=0 means average all channels)timepoint- - which timepoint- Returns:
- - the
Imageor null if it was not an ImagePlus.GRAY8, ImagePlus.GRAY16 or ImagePlus.GRAY32
-
averageAllChannels
public static <T extends mpicbg.imglib.type.numeric.RealType<T>> boolean averageAllChannels(mpicbg.imglib.image.Image<T> target, int[] offset, ij.ImagePlus imp, int timepoint) Averages all channels into the target image. The size is given by the dimensions of the target image, the offset (if applicable) is given by an extra field- Parameters:
target- - the target Imageoffset- - the offset of the area (might be [0,0] or [0,0,0])imp- - the input ImagePlustimepoint- - for which timepoint- Returns:
- true if successful, false if the ImagePlus type was unknow
-
fillInChannel
public static <T extends mpicbg.imglib.type.numeric.RealType<T>> boolean fillInChannel(mpicbg.imglib.image.Image<T> target, int[] offset, ij.ImagePlus imp, int channel, int timepoint) Averages all channels into the target image. The size is given by the dimensions of the target image, the offset (if applicable) is given by an extra field- Parameters:
target- - the target Imageoffset- - the offset of the area (might be [0,0] or [0,0,0])imp- - the input ImagePlustimepoint- - for which timepoint- Returns:
- true if successful, false if the ImagePlus type was unknow
-
averageAllChannels
protected static <T extends mpicbg.imglib.type.numeric.RealType<T>,S extends mpicbg.imglib.type.numeric.RealType<S>> void averageAllChannels(mpicbg.imglib.image.Image<T> target, ArrayList<mpicbg.imglib.image.Image<S>> sources, int[] offset) Averages all channels into the target image. The size is given by the dimensions of the target image, the offset (if applicable) is given by an extra field- Parameters:
target- - the target Imagesources- - a list of input Imagesoffset- - the offset of the area (might be [0,0] or [0,0,0])
-
getWrappedImageUnsignedByte
public static mpicbg.imglib.image.Image<mpicbg.imglib.type.numeric.integer.UnsignedByteType> getWrappedImageUnsignedByte(ij.ImagePlus imp, int channel, int timepoint) return anImageofUnsignedByteTypeas input for the PhaseCorrelation. If no rectangular roi is selected, it will only wrap the existing ImagePlus!- Parameters:
imp- - theImagePluschannel- - which channel (if channel=0 means average all channels)timepoint- - which timepoint- Returns:
- - the
Imageor null if it was not an ImagePlus.GRAY8 or if channel = 0
-
getWrappedImageUnsignedShort
public static mpicbg.imglib.image.Image<mpicbg.imglib.type.numeric.integer.UnsignedShortType> getWrappedImageUnsignedShort(ij.ImagePlus imp, int channel, int timepoint) return anImageofUnsignedShortTypeas input for the PhaseCorrelation. If no rectangular roi is selected, it will only wrap the existing ImagePlus!- Parameters:
imp- - theImagePluschannel- - which channel (if channel=0 means average all channels)timepoint- - which timepoint- Returns:
- - the
Imageor null if it was not an ImagePlus.GRAY16 or if channel = 0
-
getWrappedImageFloat
public static mpicbg.imglib.image.Image<mpicbg.imglib.type.numeric.real.FloatType> getWrappedImageFloat(ij.ImagePlus imp, int channel, int timepoint) return anImageofFloatTypeas input for the PhaseCorrelation. If no rectangular roi is selected, it will only wrap the existing ImagePlus!- Parameters:
imp- - theImagePluschannel- - which channel (if channel=0 means average all channels)timepoint- - which timepoint- Returns:
- - the
Imageor null if it was not an ImagePlus.GRAY32 or if channel = 0
-
canWrapIntoImgLib
Determines if this imageplus with these parameters can be wrapped directly into anImage<T>. This is important, because if we would wrap the first but not the second image, they would have differentImageFactorys- Parameters:
imp- - the ImagePlusroi-channel- - which channel (if channel=0 means average all channels)- Returns:
- true if it can be wrapped, otherwise false
-
getOnlyRectangularRoi
-