コード例 #1
0
ファイル: crosscorr.py プロジェクト: Peichao/thunder
    def getTransform(self, im):
        """
        Compute the planar displacement between an image or volume and reference.

        Overrides method from CrossCorr.

        For 3D data (volumes), this will compute a separate 2D displacement for each plane.
        For 2D data (images), this will compute the displacement for the single plane
        (and will be the same as using CrossCorr).

        Parameters
        ----------
        im : ndarray
            The image or volume
        """
        from thunder.registration.transformation import PlanarDisplacement

        delta = []

        if im.ndim == 2:
            delta.append(computeDisplacement(im, self.reference))
        else:
            for z in range(0, im.shape[2]):
                delta.append(computeDisplacement(im[:, :, z], self.reference[:, :, z]))

        return PlanarDisplacement(delta)
コード例 #2
0
ファイル: crosscorr.py プロジェクト: yonglehou/thunder
    def getTransform(self, im):
        """
        Compute the planar displacement between an image or volume and reference.

        Overrides method from CrossCorr.

        For 3D data (volumes), this will compute a separate 2D displacement for each plane.
        For 2D data (images), this will compute the displacement for the single plane
        (and will be the same as using CrossCorr).

        Parameters
        ----------
        im : ndarray
            The image or volume
        """
        from thunder.registration.transformation import PlanarDisplacement

        delta = []

        if im.ndim == 2:
            delta.append(computeDisplacement(im, self.reference))
        else:
            for z in range(0, im.shape[2]):
                delta.append(
                    computeDisplacement(im[:, :, z], self.reference[:, :, z]))

        return PlanarDisplacement(delta)
コード例 #3
0
ファイル: crosscorr.py プロジェクト: Peichao/thunder
    def getTransform(self, im):
        """
        Compute displacement between an image or volume and reference.

        Displacements are computed using the dimensionality of the inputs,
        so will be 2D for images and 3D for volumes.

        Parameters
        ----------
        im : ndarray
            The image or volume
        """

        from thunder.registration.transformation import Displacement

        delta = computeDisplacement(im, self.reference)

        return Displacement(delta)
コード例 #4
0
ファイル: crosscorr.py プロジェクト: yonglehou/thunder
    def getTransform(self, im):
        """
        Compute displacement between an image or volume and reference.

        Displacements are computed using the dimensionality of the inputs,
        so will be 2D for images and 3D for volumes.

        Parameters
        ----------
        im : ndarray
            The image or volume
        """

        from thunder.registration.transformation import Displacement

        delta = computeDisplacement(im, self.reference)

        return Displacement(delta)