RescaleIntensity
RescaleIntensity
Bases: NormalizationTransform
Rescale intensity values to a certain range.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
out_min_max
|
TypeDoubleFloat
|
Range \((n_{min}, n_{max})\) of output intensities. If only one value \(d\) is provided, \((n_{min}, n_{max}) = (-d, d)\). |
(0, 1)
|
percentiles
|
TypeDoubleFloat
|
Percentile values of the input image that will be mapped
to \((n_{min}, n_{max})\). They can be used for contrast
stretching, as in this scikit-image example. For example,
Isensee et al. use |
(0, 100)
|
masking_method
|
TypeMaskingMethod
|
None
|
|
in_min_max
|
TypeDoubleFloat | None
|
Range \((m_{min}, m_{max})\) of input intensities that
will be mapped to \((n_{min}, n_{max})\). If |
None
|
**kwargs
|
See |
{}
|
Examples:
>>> import torchio as tio
>>> ct = tio.ScalarImage('ct_scan.nii.gz')
>>> ct_air, ct_bone = -1000, 1000
>>> rescale = tio.RescaleIntensity(
... out_min_max=(-1, 1), in_min_max=(ct_air, ct_bone))
>>> ct_normalized = rescale(ct)
__call__(data)
Transform data and return a result of the same type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
TypeTransformInput
|
Instance of |
required |
to_hydra_config()
Return a dictionary representation of the transform for Hydra instantiation.
arguments_are_dict()
Check if main arguments are dict.
Return True if the type of all attributes specified in the
args_names have dict type.