U
    PÓhë  ã                   @  st   d Z ddlmZ dddddgZddlmZ G d	d„ dƒZG d
d„ dƒZG dd„ dƒZG dd„ dƒZ	G dd„ dƒZ
dS )z6
A collection of generic traits for MONAI transforms.
é    )ÚannotationsÚ	LazyTraitÚInvertibleTraitÚRandomizableTraitÚMultiSampleTraitÚThreadUnsafe)ÚAnyc                   @  s<   e Zd ZdZedd„ ƒZejddœdd„ƒZedd„ ƒZd	S )
r   a¢  
    An interface to indicate that the transform has the capability to execute using
    MONAI's lazy resampling feature. In order to do this, the implementing class needs
    to be able to describe its operation as an affine matrix or grid with accompanying metadata.
    This interface can be extended from by people adapting transforms to the MONAI framework as
    well as by implementors of MONAI transforms.
    c                 C  s
   t ƒ ‚dS )z¶
        Get whether lazy evaluation is enabled for this transform instance.
        Returns:
            True if the transform is operating in a lazy fashion, False if not.
        N©ÚNotImplementedError©Úself© r   úL/home/dell461/cl/sdc2/HISourceFinder-master-l/src/monai/transforms/traits.pyÚlazy   s    zLazyTrait.lazyÚbool)Úenabledc                 C  s
   t ƒ ‚dS )z¾
        Set whether lazy evaluation is enabled for this transform instance.
        Args:
            enabled: True if the transform should operate in a lazy fashion, False if not.
        Nr	   )r   r   r   r   r   r   (   s    c                 C  s   dS )aI  
        Get whether the transform requires the input data to be up to date before the transform executes.
        Such transforms can still execute lazily by adding pending operations to the output tensors.
        Returns:
            True if the transform requires its inputs to be up to date and False if it does not
        Nr   r   r   r   r   Úrequires_current_data1   s    zLazyTrait.requires_current_dataN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Úpropertyr   Úsetterr   r   r   r   r   r      s   
c                   @  s    e Zd ZdZdddœdd„ZdS )r   zž
    An interface to indicate that the transform can be inverted, i.e. undone by performing
    the inverse of the operation performed during `__call__`.
    r   )ÚdataÚreturnc                 C  s
   t ƒ ‚d S )Nr	   )r   r   r   r   r   ÚinverseA   s    zInvertibleTrait.inverseN)r   r   r   r   r   r   r   r   r   r   ;   s   c                   @  s   e Zd ZdZdS )r   a"  
    An interface to indicate that the transform has the capability to perform
    randomized transforms to the data that it is called upon. This interface
    can be extended from by people adapting transforms to the MONAI framework as well as by
    implementors of MONAI transforms.
    N©r   r   r   r   r   r   r   r   r   E   s   c                   @  s   e Zd ZdZdS )r   a:  
    An interface to indicate that the transform has the capability to return multiple samples
    given an input, such as when performing random crops of a sample. This interface can be
    extended from by people adapting transforms to the MONAI framework as well as by implementors
    of MONAI transforms.
    Nr   r   r   r   r   r   P   s   c                   @  s   e Zd ZdZdS )r   a\  
    A class to denote that the transform will mutate its member variables,
    when being applied. Transforms inheriting this class should be used
    cautiously in a multi-thread context.

    This type is typically used by :py:class:`monai.data.CacheDataset` and
    its extensions, where the transform cache is built with multiple threads.
    Nr   r   r   r   r   r   [   s   	N)r   Ú
__future__r   Ú__all__Útypingr   r   r   r   r   r   r   r   r   r   Ú<module>   s   %
