dacapo.experiments.datasplits.datasets.arrays.intensity_array
Classes
This is wrapper another array that will normalize intensities to |
Module Contents
- class dacapo.experiments.datasplits.datasets.arrays.intensity_array.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.
- array_config
The config object for the array
- Type:
- min
The minimum intensity value in the array
- Type:
float
- max
The maximum intensity value in the array
- Type:
float
- __getitem__()
Returns the intensities normalized to the range (0, 1)
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.
- name
- property attrs
- Returns the attributes of the source array
- Returns:
The attributes of the source array
- Return type:
dict
- Raises:
ValueError – If the attributes is not a dictionary
Examples
>>> intensities_array.attrs {'resolution': (1.0, 1.0, 1.0), 'unit': 'micrometer'}
Notes
The attributes are the same as the source array
- property axes
- Returns the axes of the source array
- Returns:
The axes of the source array
- Return type:
str
- Raises:
ValueError – If the axes is not a string
Examples
>>> intensities_array.axes 'zyx'
Notes
The axes are the same as the source array
- property dims: int
Returns the dimensions of the source array
- Returns:
The dimensions of the source array
- Return type:
int
- Raises:
ValueError – If the dimensions is not an integer
Examples
>>> intensities_array.dims 3
Notes
The dimensions are the same as the source array
- property voxel_size: funlib.geometry.Coordinate
Returns the voxel size of the source array
- Returns:
The voxel size of the source array
- Return type:
Coordinate
- Raises:
ValueError – If the voxel size is not a Coordinate object
Examples
>>> intensities_array.voxel_size Coordinate(x=1.0, y=1.0, z=1.0)
Notes
The voxel size is the same as the source array
- property roi: funlib.geometry.Roi
Returns the region of interest of the source array
- Returns:
The region of interest of the source array
- Return type:
Roi
- Raises:
ValueError – If the region of interest is not a Roi object
Examples
>>> intensities_array.roi Roi(offset=(0, 0, 0), shape=(10, 20, 30))
Notes
The region of interest is the same as the source array
- property writable: bool
Returns whether the array is writable
- Returns:
Whether the array is writable
- Return type:
bool
- Raises:
ValueError – If the array is not writable
Examples
>>> intensities_array.writable False
Notes
The array is not writable because it is a virtual array created by modifying another array on demand.
- property dtype
- Returns the data type of the array
- Returns:
The data type of the array
- Return type:
type
- Raises:
ValueError – If the data type is not a type
Examples
>>> intensities_array.dtype numpy.float32
Notes
The data type is always float32
- property num_channels: int
Returns the number of channels in the source array
- Returns:
The number of channels in the source array
- Return type:
int
- Raises:
ValueError – If the number of channels is not an integer
Examples
>>> intensities_array.num_channels 3
Notes
The number of channels is the same as the source array
- property data
- Returns the data of the source array
- Returns:
The data of the source array
- Return type:
np.ndarray
- Raises:
ValueError – If the data is not a numpy array
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]]])
Notes
The data is the same as the source array