U
    §PÓhÐ  ã                   @  sL   d dl mZ d dlmZ d dlmZ ddddœdd„Zd	dd	dœd
d„ZdS )é    )Úannotations)ÚTensor)ÚNdarrayOrTensorr   Úint)ÚxÚspatial_dimÚreturnc                 C  s   | d   |¡d }|S )aá  
    Compute the root sum of squares (rss) of the data (typically done for multi-coil MRI samples)

    Args:
        x: Input tensor
        spatial_dim: dimension along which rss is applied

    Returns:
        rss of x along spatial_dim

    Example:
        .. code-block:: python

            import numpy as np
            x = torch.ones([2,3])
            # the following line prints Tensor([1.41421356, 1.41421356, 1.41421356])
            print(rss(x,spatial_dim=0))
    é   g      à?)Úsum©r   r   Zrss_x© r   úX/home/dell461/cl/sdc2/HISourceFinder-master-l/src/monai/apps/reconstruction/mri_utils.pyÚroot_sum_of_squares_t   s    r   r   c                 C  s   t | |ƒ}|S )aã  
    Compute the root sum of squares (rss) of the data (typically done for multi-coil MRI samples)

    Args:
        x: Input array/tensor
        spatial_dim: dimension along which rss is applied

    Returns:
        rss of x along spatial_dim

    Example:
        .. code-block:: python

            import numpy as np
            x = np.ones([2,3])
            # the following line prints array([1.41421356, 1.41421356, 1.41421356])
            print(rss(x,spatial_dim=0))
    )r   r   r   r   r   Úroot_sum_of_squares*   s    
r   N)Ú
__future__r   Útorchr   Úmonai.config.type_definitionsr   r   r   r   r   r   r   Ú<module>   s   