dacapo.experiments.datasplits.datasets.arrays.intensity_array ============================================================= .. py:module:: dacapo.experiments.datasplits.datasets.arrays.intensity_array Classes ------- .. autoapisummary:: dacapo.experiments.datasplits.datasets.arrays.intensity_array.IntensitiesArray Module Contents --------------- .. py:class:: IntensitiesArray(array_config) This is wrapper another array that will normalize intensities to the range (0, 1) and convert to float32. Use this if you have your intensities stored as uint8 or similar and want your model to have floats as input. .. attribute:: array_config The config object for the array :type: ArrayConfig .. attribute:: min The minimum intensity value in the array :type: float .. attribute:: max The maximum intensity value in the array :type: float .. method:: __getitem__ Returns the intensities normalized to the range (0, 1) .. rubric:: Notes The array_config must be an ArrayConfig object. The min and max values are used to normalize the intensities. All intensities are converted to float32. .. py:attribute:: name .. py:property:: attrs Returns the attributes of the source array :returns: The attributes of the source array :rtype: dict :raises ValueError: If the attributes is not a dictionary .. rubric:: Examples >>> intensities_array.attrs {'resolution': (1.0, 1.0, 1.0), 'unit': 'micrometer'} .. rubric:: Notes The attributes are the same as the source array .. py:property:: axes Returns the axes of the source array :returns: The axes of the source array :rtype: str :raises ValueError: If the axes is not a string .. rubric:: Examples >>> intensities_array.axes 'zyx' .. rubric:: Notes The axes are the same as the source array .. py:property:: dims :type: int Returns the dimensions of the source array :returns: The dimensions of the source array :rtype: int :raises ValueError: If the dimensions is not an integer .. rubric:: Examples >>> intensities_array.dims 3 .. rubric:: Notes The dimensions are the same as the source array .. py:property:: voxel_size :type: funlib.geometry.Coordinate Returns the voxel size of the source array :returns: The voxel size of the source array :rtype: Coordinate :raises ValueError: If the voxel size is not a Coordinate object .. rubric:: Examples >>> intensities_array.voxel_size Coordinate(x=1.0, y=1.0, z=1.0) .. rubric:: Notes The voxel size is the same as the source array .. py:property:: roi :type: funlib.geometry.Roi Returns the region of interest of the source array :returns: The region of interest of the source array :rtype: Roi :raises ValueError: If the region of interest is not a Roi object .. rubric:: Examples >>> intensities_array.roi Roi(offset=(0, 0, 0), shape=(10, 20, 30)) .. rubric:: Notes The region of interest is the same as the source array .. py:property:: writable :type: bool Returns whether the array is writable :returns: Whether the array is writable :rtype: bool :raises ValueError: If the array is not writable .. rubric:: Examples >>> intensities_array.writable False .. rubric:: Notes The array is not writable because it is a virtual array created by modifying another array on demand. .. py:property:: dtype Returns the data type of the array :returns: The data type of the array :rtype: type :raises ValueError: If the data type is not a type .. rubric:: Examples >>> intensities_array.dtype numpy.float32 .. rubric:: Notes The data type is always float32 .. py:property:: num_channels :type: int Returns the number of channels in the source array :returns: The number of channels in the source array :rtype: int :raises ValueError: If the number of channels is not an integer .. rubric:: Examples >>> intensities_array.num_channels 3 .. rubric:: Notes The number of channels is the same as the source array .. py:property:: data Returns the data of the source array :returns: The data of the source array :rtype: np.ndarray :raises ValueError: If the data is not a numpy array .. rubric:: Examples >>> intensities_array.data array([[[0.1, 0.2, 0.3], [0.4, 0.5, 0.6]], [[0.7, 0.8, 0.9], [1.0, 1.1, 1.2]]]) .. rubric:: Notes The data is the same as the source array