o
    iܔ                     @  s  d dl mZ d dlZd dlZd dlZd dlZd dlmZmZm	Z	m
Z
 d dlZd dlZd dlmZ d dlmZ d dlmZ d dlmZmZmZ d dlmZmZ ed	d
e\ZZeeZeddd\Z ZG dd deZ!G dd deZ"G dd deZ#G dd deZ$G dd deZ%G dd deeZ&G dd deZ'G dd deeZ(G dd deZ)G d d! d!eZ*G d"d# d#eZ+G d$d% d%eeZ,G d&d' d'eZ-dS )(    )annotationsN)HashableMappingSequenceSized)KeysCollection)
MetaTensor)GaussianFilter)MapTransformRandomizable	Transform)min_versionoptional_importzskimage.measurez0.14.2zscipy.ndimagedistance_transform_cdt)namec                      s:   e Zd Z				dd fddZdd ZdddZ  ZS )DiscardAddGuidanced         ?NFkeysr   number_intensity_chintprobabilityfloatlabel_namesSized | Noneallow_missing_keysboolc                   s(   t  || || _|| _|pg | _dS )aE  
        Discard positive and negative points according to discard probability

        Args:
            keys: The ``keys`` parameter will be used to get and set the actual data item to transform
            number_intensity_ch: number of intensity channels
            probability: probability of discarding clicks
        N)super__init__r   discard_probabilityr   )selfr   r   r   r   r   	__class__ `/home/dell461/cl/sdc2/last_ska_mid/HISourceFinder-master-l/src/monai/apps/deepedit/transforms.pyr   &   s   zDiscardAddGuidanced.__init__c                 C  s   | j dkstjjddg| j d| j  gdrNtjt| j|jd |jd |jd ftjd	}|jd
 | j	t| j krE||| j	d df< |S tj
||gd
d}|S )Nr   TFr   pdtyper   .axis)r   nprandomchoicezeroslenr   shapefloat32r   concatenate)r    imagesignalr#   r#   r$   _apply<   s   &zDiscardAddGuidanced._applydataMapping[Hashable, np.ndarray]returndict[Hashable, np.ndarray]c                 C  s^   t |}| |D ]#}|dkr(| || }t|| tr#||| _q	|||< q	td q	|S )Nr6   z(This transform only applies to the image)dictkey_iteratorr8   
isinstancer   arrayprint)r    r9   dkey	tmp_imager#   r#   r$   __call__I   s   

zDiscardAddGuidanced.__call__)r   r   NF)
r   r   r   r   r   r   r   r   r   r   r9   r:   r;   r<   )__name__
__module____qualname__r   r8   rE   __classcell__r#   r#   r!   r$   r   $   s    r   c                      ,   e Zd Z	dd fd	d
ZdddZ  ZS )NormalizeLabelsInDatasetdNFr   r   r   dict[str, int] | Noner   r   c                   s   t  || |p
i | _dS )z
        Normalize label values according to label names dictionary

        Args:
            keys: The ``keys`` parameter will be used to get and set the actual data item to transform
            label_names: all label names
        N)r   r   r   r    r   r   r   r!   r#   r$   r   Y   s   
z"NormalizeLabelsInDatasetd.__init__r9   r:   r;   r<   c           	      C  s   t |}| |D ]I}i }t|| j}t| j ddD ]\}\}}|dkr4|||< |||| |k< |dkr<d|d< q||d< t|| t	rN||| _
q	|||< q	|S )Nr   )start
backgroundr   r   )r=   r>   r.   r1   r3   	enumerater   itemsr?   r   r@   )	r    r9   rB   rC   Znew_label_nameslabelidx	key_label	val_labelr#   r#   r$   rE   g   s    
z"NormalizeLabelsInDatasetd.__call__NF)r   r   r   rM   r   r   rF   rG   rH   rI   r   rE   rJ   r#   r#   r!   r$   rL   W   s    rL   c                      rK   )SingleLabelSelectiondNFr   r   r   Sequence[str] | Noner   r   c                   s@   t  || |p
g | _ddddddddd	d
ddddd| _dS )z
        Selects one label at a time to train the DeepEdit

        Args:
            keys: The ``keys`` parameter will be used to get and set the actual data item to transform
            label_names: all label names
        r                        	   
               )Zspleenzright kidneyzleft kidneyZgallbladderZ	esophagusZliverZstomachZaortazinferior vena cavaZportal_veinZsplenic_veinZpancreaszright adrenal glandzleft adrenal glandN)r   r   r   all_label_valuesrN   r!   r#   r$   r      s"   

zSingleLabelSelectiond.__init__r9   r:   r;   r<   c                 C  s   t |}| |D ]D}|dkrHtj| j}||d< d|| || | j| k< | j|d }||| || dk< td| d|| 	   q	t
d q	|S )	NrS   Zcurrent_labelg        r   r   zUsing label z with number: z(This transform only applies to the label)r=   r>   r.   r/   r0   r   rh   indexrA   maxwarningswarn)r    r9   rB   rC   Zt_labelZmax_label_valr#   r#   r$   rE      s   zSingleLabelSelectiond.__call__rW   )r   r   r   rZ   r   r   rF   rX   r#   r#   r!   r$   rY   }   s    rY   c                      s>   e Zd ZdZ				dd fddZdd ZdddZ  ZS )AddGuidanceSignalDeepEditdaB  
    Add Guidance signal for input image. Multilabel DeepEdit

    Based on the "guidance" points, apply Gaussian to them and add them as new channel for input image.

    Args:
        guidance: key to store guidance.
        sigma: standard deviation for Gaussian kernel.
        number_intensity_ch: channel index.
    guidancer\   r   Fr   r   strsigmar   r   r   r   c                   s$   t  || || _|| _|| _d S N)r   r   rn   rp   r   )r    r   rn   rp   r   r   r!   r#   r$   r      s   
z#AddGuidanceSignalDeepEditd.__init__c                 C  s  t |jdkr	dnd}t|tjr| n|}t|tr!t|n|}t |r"|dkrBtj	d|jd |jd |jd ftj
d}ntj	d|jd |jd ftj
d}|j}|D ]u}tt|dk reqX|dkrtdtt|d |d d }tdtt|d |d d }tdtt|d |d d }	d	|d d |||	f< qXtdtt|d |d d }tdtt|d |d d }d	|d d ||f< qXt|d dkr t|d }
tt |
j| jd
}||
dd}
|
dd}
|
   |d< |d t|d  t|d t|d   |d< |S |dkr>tj	d|jd |jd |jd ftj
d}|S tj	d|jd |jd ftj
d}|S )Nr\   r[   r   r'   r(   r)   r*   r   r   )rp   )r2   r3   r?   r.   ndarraytolistro   jsonloadsr1   r4   anyasarrayrj   minr   torchtensorr	   rp   	unsqueezesqueezedetachcpunumpy)r    r6   rn   
dimensionsr7   sshapepointp1p2p3Zsignal_tensorZpt_gaussianr#   r#   r$   _get_signal   s@   
,"     6
*"z&AddGuidanceSignalDeepEditd._get_signalr9   r:   r;   r<   c           	      C  s   t |}| |D ]K}|dkrP|| }|dd| j df }|| j }| D ]$}| ||| }tj||gdd}t|| t	rG||| _
q'|||< q'|  S td q	|S )Nr6   r   .r,   z(This transform only applies to image key)r=   r>   r   rn   r   r   r.   r5   r?   r   r@   rA   )	r    r9   rB   rC   r6   rD   rn   rU   r7   r#   r#   r$   rE      s   


z#AddGuidanceSignalDeepEditd.__call__)rn   r\   r   F)
r   r   rn   ro   rp   r   r   r   r   r   rF   )rG   rH   rI   __doc__r   r   rE   rJ   r#   r#   r!   r$   rm      s    -rm   c                      6   e Zd ZdZdd fd	d
Zdd ZdddZ  ZS )FindAllValidSlicesDeepEditdz
    Find/List all valid slices in the labels.
    Label is assumed to be a 4D Volume with shape CHWD, where C=1.

    Args:
        sids: key to store slices indices having valid label map.
    sidsFr   r   r   r   r   c                      t  || || _d S rq   r   r   r   r    r   r   r   r!   r#   r$   r        
z$FindAllValidSlicesDeepEditd.__init__c                 C  s`   i }|d   D ]%}g }t|jd D ]}|d | |d d|f v r(|| q|||< q|S )Nr   r)   r   .r   ranger3   appendr    rS   rB   r   rU   Zl_idssidr#   r#   r$   r8     s   

z"FindAllValidSlicesDeepEditd._applyr9   r:   r;   r<   c                 C     t |}| |D ]=}|dkrB|| }|jd dkrtdt|jdkr)td| ||}|d ur>t| r>||| j< |  S td q	|S NrS   r   r   z$Only supports single channel labels!r]   z$Only supports label with shape CHWD!(This transform only applies to label key	r=   r>   r3   
ValueErrorr2   r8   r   r   rA   r    r9   rB   rC   rS   r   r#   r#   r$   rE         

z$FindAllValidSlicesDeepEditd.__call__r   Fr   r   r   r   r   r   rF   rG   rH   rI   r   r   r8   rE   rJ   r#   r#   r!   r$   r   	  s
    
r   c                      H   e Zd ZdZ					dd fddZdd Zdd ZdddZ  ZS )AddInitialSeedPointDeepEditdai  
    Add random guidance as initial seed point for a given label.

    Note that the label is of size (C, D, H, W) or (C, H, W)

    The guidance is of size (2, N, # of dims) where N is number of guidance added.
    # of dims = 4 when C, D, H, W; # of dims = 3 when (C, H, W)

    Args:
        guidance: key to store guidance.
        sids: key that represents lists of valid slice indices for the given label.
        sid: key that represents the slice to add initial seed point.  If not present, random sid will be chosen.
        connected_regions: maximum connected regions to use for adding initial points.
    rn   r   r   r^   Fr   r   ro   connected_regionsr   r   r   c                   2   t  || || _|| _t | _|| _|| _d S rq   r   r   sids_keysid_keyr=   r   rn   r   r    r   rn   r   r   r   r   r!   r#   r$   r   D     	
z%AddInitialSeedPointDeepEditd.__init__c              	   C  s  t |jdkr	dnd}dg|d  | _|}|d ur*|dkr*d}|d d|f tj }|dktj}|dkr@tj|t	ddn|}t
|dkrPtd	| g }td|dkrZdn| jd D ]}}|dkr|||ktj}t|dkr||| j q`t| }	t|	d
 }
t| dkd }| jj|d|
| t|
|  d}|	| }tt||j  d }|d |d< |dks|dkr|| q`||d |d |d |g q`t|gS )Nr\   r[   r)   r   r   .      ?rP   zSLICES NOT FOUND FOR LABEL: r   sizer&   r(   )r2   r3   default_guidancer.   newaxisastyper4   measurerS   r   rj   AssertionErrorr   r   sumr   r   flattenexpwhereRr0   rw   unravel_index	transposers   )r    rS   r   rU   r   dimsblobs_labelsZpos_guidanceridxdistancer   rT   seeddstgr#   r#   r$   r8   T  s8     $  z#AddInitialSeedPointDeepEditd._applyc                 C     | | jd ur| | j |nd }| | jd ur$| | j |nd }|d ur=|r=|d u s4||vr<| jj|dd}n
td|  d }|| j|< d S NF)replacezNot slice IDs for label: getr   r   r   r0   loggerinfor   r    rB   rU   r   r   r#   r#   r$   
_randomize     &&z'AddInitialSeedPointDeepEditd._randomizer9   r:   r;   r<   c              
   C  s   t |}| |D ]a}|dkrfi }|d  D ]E}| || t|| }|dkr7d||t|d | k< nd||t|d | k< d| }t| 	|| j
||t ||< q||| j< |  S td q	|S NrS   r   rP   r   r   r   r   r=   r>   r   r   r.   copyr   rt   dumpsr8   r   r   r   r   rs   rn   rA   r    r9   rB   rC   Zlabel_guidancesrU   	tmp_labelr#   r#   r$   rE     s$   


z%AddInitialSeedPointDeepEditd.__call__rn   r   r   r^   Fr   r   rn   ro   r   ro   r   ro   r   r   r   r   rF   	rG   rH   rI   r   r   r8   r   rE   rJ   r#   r#   r!   r$   r   4  s    -r   c                      sH   e Zd ZdZ			dd fd
dZedd Zdd ZdddZ  Z	S )FindDiscrepancyRegionsDeepEditdz
    Find discrepancy between prediction and actual during click interactions during training.

    Args:
        pred: key to prediction source.
        discrepancy: key to store discrepancies found between label and prediction.
    preddiscrepancyFr   r   ro   r   r   c                   s   t  || || _|| _d S rq   )r   r   r   r   )r    r   r   r   r   r!   r#   r$   r     s   
z(FindDiscrepancyRegionsDeepEditd.__init__c                 C  s0   | | }|dk tj}|dk  tj}||gS )Nr   )r   r.   r4   )rS   r   	disparityZpos_disparityZneg_disparityr#   r#   r$   r     s   z)FindDiscrepancyRegionsDeepEditd.disparityc                 C  s   |  ||S rq   )r   )r    rS   r   r#   r#   r$   r8     s   z&FindDiscrepancyRegionsDeepEditd._applyr9   r:   r;   r<   c           
      C  s6  t |}| |D ]}|dkri }t|d  D ]q\}\}}|dkrOt|| }d|||k< |dktj}t|| j }	d|	|	|k< |	dktj}	n3t|| }d|||k< d| }|dktj}t|| j }	d|	|	|k< d|	 }	|	dktj}	| 	||	||< q||| j
< |  S td q	|S )NrS   r   rP   r   r   r   z*This transform only applies to 'label' key)r=   r>   rQ   rR   r.   r   r   r4   r   r8   r   rA   )
r    r9   rB   rC   Zall_discrepancies_rU   rV   rS   r   r#   r#   r$   rE     s2   

z(FindDiscrepancyRegionsDeepEditd.__call__)r   r   F)r   r   r   ro   r   ro   r   r   rF   )
rG   rH   rI   r   r   staticmethodr   r8   rE   rJ   r#   r#   r!   r$   r     s    
r   c                      sP   e Zd ZdZ				dd fddZdddZdd Zdd ZdddZ  Z	S )AddRandomGuidanceDeepEditdab  
    Add random guidance based on discrepancies that were found between label and prediction.

    Args:
        guidance: key to guidance source, shape (2, N, # of dim)
        discrepancy: key to discrepancy map between label and prediction shape (2, C, H, W, D) or (2, C, H, W)
        probability: key to click/interaction probability, shape (1)
    rn   r   r   Fr   r   ro   r   r   c                   sB   t  || || _|| _|| _d | _d | _d | _d | _i | _	d S rq   )
r   r   guidance_keyr   r   _will_interactis_posis_otherr   rn   )r    r   rn   r   r   r   r!   r#   r$   r     s   
z#AddRandomGuidanceDeepEditd.__init__Nc                 C  s,   || j  }| jjddg|d| gd| _d S )NTFr   r%   )r   r   r0   r   )r    r9   r   r#   r#   r$   	randomize  s   
"z$AddRandomGuidanceDeepEditd.randomizec                 C  s   t | }t| d }t| dkd }t|dkdkrQ| jj|d|| t||  d}|| }tt	||j
  d }|d |d< |S d S )Nr   r   r   r   )r   r   r.   r   r   r   r   r0   rw   r   r3   r   rs   )r    r   r   r   rT   r   r   r   r#   r#   r$   find_guidance  s   $ z(AddRandomGuidanceDeepEditd.find_guidancec                 C  sz  |d }i }t | D ]C\}\}}	|dkr5t|}
d|
|
|	k< |
dktj}
t|d |
 ||< qt|}
d|
|
|	k< d|
 }
t|d |
 ||< qt|dkrb|| | d| _	|
 D ]T}|| dkrd| _|dkrt|}
d|
|
|| k< |
dktj}
| j| | |d |
  qft|}
d|
|
|| k< d|
 }
| j| | |d |
  qfd S )Nr   rP   r   r   T2   )rQ   rR   r.   r   r   r4   r   r   r   r   r   r   rn   )r    rn   r   r   labelsZ	pos_discrZother_discrepancy_areasr   rU   rV   r   r#   r#   r$   add_guidance  s:   


 
z'AddRandomGuidanceDeepEditd.add_guidancer9   r:   r;   r<   c                 C  s  t |}|| j }|| j }| | | jr|d  D ](}|| }t|tjr,|	 n|}t|t
r8t|n|}dd |D | j|< q|d  D ]}| | j| || |d |d  qKtdd}d}g }		 tt|d  }
|
|	v rzn-|	|
 |t| j|
  }||kr|d  D ]}||	vrg | j|< qtd	|  nt|	t|d  krtd	|  nqj| j|| j< |S )
Nr   c                 S  s   g | ]}d |vr|qS )r)   r#   ).0jr#   r#   r$   
<listcomp>L  s    z7AddRandomGuidanceDeepEditd.__call__.<locals>.<listcomp>rS   r   rc   r   TzNumber of simulated clicks: )r=   r   r   r   r   r   r?   r.   rr   rs   ro   rt   ru   rn   r   r/   randintr0   listr   r2   r   r   )r    r9   rB   rn   r   rU   Ztmp_guiZ
num_clickscounterZkeep_guidanceZ	aux_labelr#   r#   r$   rE   A  sD   


$

z#AddRandomGuidanceDeepEditd.__call__)rn   r   r   F)
r   r   rn   ro   r   ro   r   ro   r   r   rq   rF   )
rG   rH   rI   r   r   r   r   r   rE   rJ   r#   r#   r!   r$   r     s    
'r   c                   @  s8   e Zd ZdZ				ddddZedd Zdd ZdS )AddGuidanceFromPointsDeepEditdaC  
    Add guidance based on user clicks. ONLY WORKS FOR 3D

    We assume the input is loaded by LoadImaged and has the shape of (H, W, D) originally.
    Clicks always specify the coordinates in (H, W, D)

    Args:
        ref_image: key to reference image to fetch current and original image details.
        guidance: output key to store guidance.
        meta_keys: explicitly indicate the key of the metadata dictionary of `ref_image`.
            for example, for data with key `image`, the metadata by default is in `image_meta_dict`.
            the metadata is a dictionary object which contains: filename, original_shape, etc.
            if None, will try to construct meta_keys by `{ref_image}_{meta_key_postfix}`.
        meta_key_postfix: if meta_key is None, use `{ref_image}_{meta_key_postfix}` to fetch the metadata according
            to the key data, default is `meta_dict`, the metadata is a dictionary object.
            For example, to handle key `image`,  read/write affine matrices from the
            metadata `image_meta_dict` dictionary's `affine` field.

    rn   N	meta_dict	ref_imagero   r   dict | None	meta_keys
str | Nonemeta_key_postfixc                 C  s&   || _ || _|p	i | _|| _|| _d S rq   )r   rn   r   r   r   )r    r   rn   r   r   r   r#   r#   r$   r     s
   

z'AddGuidanceFromPointsDeepEditd.__init__c                 C  s&   t | rt| |t }|S g S rq   )r2   r.   multiplyr   r   rs   )clicksfactorrn   r#   r#   r$   r8     s   z%AddGuidanceFromPointsDeepEditd._applyc                 C  s   t |}| jp| j d| j }t|| j tr|| j j}n||v r(|| }nt| dd|vr7td|d }t	|| j j
dd  }t|| }i }| j D ]}	||	g }
t	t|
t}
| |
|||	< qU||| j< |S )Nr   I is not found. Please check whether it is the correct the image meta key.spatial_shapez%Missing "spatial_shape" in meta_dict!r   )r=   r   r   r   r?   r   metar   RuntimeErrorr   r3   r.   r@   r   r   r   r   r   r8   rn   )r    r9   rB   meta_dict_keyr   original_shapecurrent_shaper   all_guidancesrU   r   r#   r#   r$   rE     s*   

z'AddGuidanceFromPointsDeepEditd.__call__)rn   NNr   )
r   ro   rn   ro   r   r   r   r   r   ro   )rG   rH   rI   r   r   r   r8   rE   r#   r#   r#   r$   r   n  s    
r   c                   @  s"   e Zd ZdZdddZd	d
 ZdS )$ResizeGuidanceMultipleLabelDeepEditdzA
    Resize the guidance based on cropped vs resized image.

    rn   ro   r   r;   Nonec                 C  s   || _ || _d S rq   )rn   r   )r    rn   r   r#   r#   r$   r     s   
z-ResizeGuidanceMultipleLabelDeepEditd.__init__c                 C  s   t |}|| j jdd  }d}t|| j tr|| j j}n||v r(|| }nt| d|d }t||}i }|| j	 
 D ]!}	t|| j	 |	 r]t|| j	 |	 |t ng }
|
||	< qB||| j	< |S )Nr   image_meta_dictr   r   )r=   r   r3   r?   r   r   r   r.   dividern   r   r2   r   r   r   rs   )r    r9   rB   r   r   r   r   r   r   rU   rn   r#   r#   r$   rE     s*   
"

z-ResizeGuidanceMultipleLabelDeepEditd.__call__N)rn   ro   r   ro   r;   r   )rG   rH   rI   r   r   rE   r#   r#   r#   r$   r     s    
r   c                   @  s   e Zd ZdZd	ddZdS )
SplitPredsLabeldz;
    Split preds and labels for individual evaluation

    r9   r:   r;   r<   c                 C  s   t |}| |D ]E}|dkrEt|d  D ],\}\}}|dkrC|| |d df d  |d| < |d |d df d  |d| < qq	|dkrNtd	 q	|S )
Nr   r   rP   r   .pred_rS   label_zThis is only for pred key)r=   r>   rQ   rR   r   r   )r    r9   rB   rC   rT   rU   r   r#   r#   r$   rE     s   ""
zSplitPredsLabeld.__call__NrF   )rG   rH   rI   r   rE   r#   r#   r#   r$   r     s    r   c                      r   )!AddInitialSeedPointMissingLabelsdaf  
    Add random guidance as initial seed point for a given label.
    Note that the label is of size (C, D, H, W) or (C, H, W)
    The guidance is of size (2, N, # of dims) where N is number of guidance added.
    # of dims = 4 when C, D, H, W; # of dims = 3 when (C, H, W)
    Args:
        guidance: key to store guidance.
        sids: key that represents lists of valid slice indices for the given label.
        sid: key that represents the slice to add initial seed point.  If not present, random sid will be chosen.
        connected_regions: maximum connected regions to use for adding initial points.
    rn   r   r   r^   Fr   r   ro   r   r   r   r   c                   r   rq   r   r   r!   r#   r$   r     r   z*AddInitialSeedPointMissingLabelsd.__init__c              	   C  s  t |jdkr	dnd}dg|d  | _|}|d ur*|dkr*d}|d d|f tj }|dktj}|dkr@tj|t	ddn|}g }t
|dkrR|| j ntd|dkrZdn| jd D ]}}|dkr|||ktj}t|dkr||| j q`t| }t|d	 }	t| dkd }
| jj|
d|	|
 t|	|
  d
}|| }tt||j  d }|d |d< |dks|dkr|| q`||d |d |d |g q`t|S )Nr\   r[   r)   r   r   .r   r   r   r   r(   )r2   r3   r   r.   r   r   r4   r   rS   r   rj   r   r   r   r   r   r   r   r   r   r0   rw   r   r   rs   )r    rS   r   r   r   r   Zlabel_guidancer   r   r   rT   r   r   r   r#   r#   r$   r8     s8     $  
z(AddInitialSeedPointMissingLabelsd._applyc                 C  r   r   r   r   r#   r#   r$   r   D  r   z,AddInitialSeedPointMissingLabelsd._randomizer9   r:   r;   r<   c              
   C  s   t |}| |D ]`}|dkrei }|d  D ]D}| || t|| }|dkr7d||t|d | k< nd||t|d | k< d| }t| 	|| j
|t ||< q||| j< |  S td q	|S r   r   r   r#   r#   r$   rE   O  s$   


z*AddInitialSeedPointMissingLabelsd.__call__r   r   rF   r   r#   r#   r!   r$   r     s    0r   c                      r   ) FindAllValidSlicesMissingLabelsdz
    Find/List all valid slices in the labels.
    Label is assumed to be a 4D Volume with shape CHWD, where C=1.
    Args:
        sids: key to store slices indices having valid label map.
    r   Fr   r   r   r   r   c                   r   rq   r   r   r!   r#   r$   r   q  r   z)FindAllValidSlicesMissingLabelsd.__init__c                 C  sr   i }|d   D ].}g }t|jd D ]}|d | |d d|f v r(|| q|g kr2dgd }|||< q|S )Nr   r)   r   .rc   r   r   r#   r#   r$   r8   u  s   


z'FindAllValidSlicesMissingLabelsd._applyr9   r:   r;   r<   c                 C  r   r   r   r   r#   r#   r$   rE     r   z)FindAllValidSlicesMissingLabelsd.__call__r   r   rF   r   r#   r#   r!   r$   r  i  s
    r  ).
__future__r   rt   loggingr/   rk   collections.abcr   r   r   r   r   r.   ry   monai.configr   
monai.datar   monai.networks.layersr	   monai.transforms.transformr
   r   r   monai.utilsr   r   r   r   	getLoggerrG   r   r   r   rL   rY   rm   r   r   r   r   r   r   r   r   r  r#   r#   r#   r$   <module>   s<   
3&1[+rF L*r