dacapo.experiments.trainers.gp_augments ======================================= .. py:module:: dacapo.experiments.trainers.gp_augments Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/dacapo/experiments/trainers/gp_augments/augment_config/index /autoapi/dacapo/experiments/trainers/gp_augments/elastic_config/index /autoapi/dacapo/experiments/trainers/gp_augments/gamma_config/index /autoapi/dacapo/experiments/trainers/gp_augments/intensity_config/index /autoapi/dacapo/experiments/trainers/gp_augments/intensity_scale_shift_config/index /autoapi/dacapo/experiments/trainers/gp_augments/simple_config/index Classes ------- .. autoapisummary:: dacapo.experiments.trainers.gp_augments.AugmentConfig dacapo.experiments.trainers.gp_augments.ElasticAugmentConfig dacapo.experiments.trainers.gp_augments.SimpleAugmentConfig dacapo.experiments.trainers.gp_augments.GammaAugmentConfig dacapo.experiments.trainers.gp_augments.IntensityAugmentConfig dacapo.experiments.trainers.gp_augments.IntensityScaleShiftAugmentConfig Package Contents ---------------- .. py:class:: AugmentConfig Base class for gunpowder augment configurations. Each subclass of a `Augment` should have a corresponding config class derived from `AugmentConfig`. .. attribute:: _raw_key Key for raw data. Not used in this implementation. Defaults to None. .. attribute:: _gt_key Key for ground truth data. Not used in this implementation. Defaults to None. .. attribute:: _mask_key Key for mask data. Not used in this implementation. Defaults to None. .. method:: node(_raw_key=None, _gt_key=None, _mask_key=None) Get a gp.Augment node. .. py:method:: node(raw_key: gunpowder.ArrayKey, gt_key: gunpowder.ArrayKey, mask_key: gunpowder.ArrayKey) -> gunpowder.BatchFilter :abstractmethod: Get a gunpowder augment node. :param raw_key: Key for raw data. :type raw_key: gp.ArrayKey :param gt_key: Key for ground truth data. :type gt_key: gp.ArrayKey :param mask_key: Key for mask data. :type mask_key: gp.ArrayKey :returns: Augmentation node which can be incorporated in the pipeline. :rtype: gunpowder.BatchFilter :raises NotImplementedError: This method is not implemented. .. rubric:: Examples >>> node = augment_config.node(raw_key, gt_key, mask_key) .. py:class:: ElasticAugmentConfig A class that holds the configuration details for the elastic augmentations. .. attribute:: control_point_spacing Distance(in voxels per dimension) between control points for the elastic deformation. :type: List[int] .. attribute:: control_point_displacement_sigma Standard deviation of control point displacement distribution, in world coordinates. :type: List[float] .. attribute:: rotation_interval An interval to randomly sample rotation angles from (0,2PI). :type: Tuple[float, float] .. attribute:: subsample Downsample factor to perform the elastic augmentation on a grid. Default is 1. :type: int .. attribute:: uniform_3d_rotation Should 3D rotations be performed uniformly. The 'rotation_interval' will be ignored. Default is False. :type: bool .. method:: node(_raw_key=None, _gt_key=None, _mask_key=None) Returns the object of ElasticAugment with the given configuration details. .. py:attribute:: control_point_spacing :type: List[int] .. py:attribute:: control_point_displacement_sigma :type: List[float] .. py:attribute:: rotation_interval :type: Tuple[float, float] .. py:attribute:: subsample :type: int .. py:attribute:: uniform_3d_rotation :type: bool .. py:method:: node(_raw_key=None, _gt_key=None, _mask_key=None) Returns the object of ElasticAugment with the given configuration details. :param _raw_key: Unused variable, kept for future use. :param _gt_key: Unused variable, kept for future use. :param _mask_key: Unused variable, kept for future use. :returns: A ElasticAugment object configured with `control_point_spacing`, `control_point_displacement_sigma`, `rotation_interval`, `subsample` and `uniform_3d_rotation`. :rtype: ElasticAugment :raises NotImplementedError: This method is not implemented. .. rubric:: Examples >>> node = elastic_augment_config.node() .. py:class:: SimpleAugmentConfig This class is an implementation of AugmentConfig that applies simple augmentations. :param _raw_key: Key for raw data. Not used in this implementation. Defaults to None. :param _gt_key: Key for ground truth data. Not used in this implementation. Defaults to None. :param _mask_key: Key for mask data. Not used in this implementation. Defaults to None. .. method:: node(_raw_key=None, _gt_key=None, _mask_key=None) Get a gp.SimpleAugment node. .. note:: This class is a subclass of AugmentConfig. .. py:method:: node(_raw_key=None, _gt_key=None, _mask_key=None) Get a gp.SimpleAugment node. :param _raw_key: Specific key for raw data, not used in this implementation. Defaults to None. :type _raw_key: [type], optional :param _gt_key: Specific key for ground truth data, not used in this implementation. Defaults to None. :type _gt_key: [type], optional :param _mask_key: Specific key for mask data, not used in this implementation. Defaults to None. :type _mask_key: [type], optional :returns: Simple augmentation node which can be incorporated in the pipeline. :rtype: gunpowder.SimpleAugment :raises NotImplementedError: This method is not implemented. .. rubric:: Examples >>> node = simple_augment_config.node() .. py:class:: GammaAugmentConfig This class manages the configuration of gamma augmentation for a given dataset. .. attribute:: gamma_range A tuple of float values represents the min and max range of gamma noise .. attribute:: to apply on the raw data. .. method:: node() Constructs a node in the augmentation pipeline. .. py:attribute:: gamma_range :type: Tuple[float, float] .. py:method:: node(raw_key: gunpowder.ArrayKey, _gt_key=None, _mask_key=None) Constructs a node in the augmentation pipeline. :param raw_key: Key to an Array (volume) in the pipeline :type raw_key: gp.ArrayKey :param _gt_key: Ground Truth key, not used in this function. Defaults to None. :type _gt_key: gp.ArrayKey, optional :param _mask_key: Mask Key, not used in this function. Defaults to None. :type _mask_key: gp.ArrayKey, optional :returns: The augmentation method to be applied on the source data. :rtype: GammaAugment instance :raises NotImplementedError: This method is not implemented. .. rubric:: Examples >>> node = gamma_augment_config.node(raw_key) .. py:class:: IntensityAugmentConfig This class is an implementation of AugmentConfig that applies intensity augmentations. .. attribute:: scale A range within which to choose a random scale factor. :type: Tuple[float, float] .. attribute:: shift A range within which to choose a random additive shift. :type: Tuple[float, float] .. attribute:: clip Set to False if modified values should not be clipped to [0, 1] :type: bool .. method:: node(raw_key, _gt_key=None, _mask_key=None) Get a gp.IntensityAugment node. .. py:attribute:: scale :type: Tuple[float, float] .. py:attribute:: shift :type: Tuple[float, float] .. py:attribute:: clip :type: bool .. py:method:: node(raw_key: gunpowder.ArrayKey, _gt_key=None, _mask_key=None) Get a gp.IntensityAugment node. :param raw_key: Key for raw data. :type raw_key: gp.ArrayKey :param _gt_key: Specific key for ground truth data, not used in this implementation. Defaults to None. :type _gt_key: [type], optional :param _mask_key: Specific key for mask data, not used in this implementation. Defaults to None. :type _mask_key: [type], optional :returns: Intensity augmentation node which can be incorporated in the pipeline. :rtype: gunpowder.IntensityAugment :raises NotImplementedError: This method is not implemented. .. rubric:: Examples >>> node = intensity_augment_config.node(raw_key) .. py:class:: IntensityScaleShiftAugmentConfig This class is an implementation of AugmentConfig that applies intensity scaling and shifting. .. attribute:: scale A constant to scale your intensities. :type: float .. attribute:: shift A constant to shift your intensities. :type: float .. method:: node(raw_key, _gt_key=None, _mask_key=None) Get a gp.IntensityScaleShift node. .. note:: This class is a subclass of AugmentConfig. .. py:attribute:: scale :type: float .. py:attribute:: shift :type: float .. py:method:: node(raw_key: gunpowder.ArrayKey, _gt_key=None, _mask_key=None) Get a gp.IntensityScaleShift node. :param raw_key: Key for raw data. :type raw_key: gp.ArrayKey :param _gt_key: Specific key for ground truth data, not used in this implementation. Defaults to None. :type _gt_key: [type], optional :param _mask_key: Specific key for mask data, not used in this implementation. Defaults to None. :type _mask_key: [type], optional :returns: Intensity scaling and shifting node which can be incorporated in the pipeline. :rtype: gunpowder.IntensityScaleShift :raises NotImplementedError: This method is not implemented. .. rubric:: Examples >>> node = intensity_scale_shift_augment_config.node(raw_key)