Skip to content

ScaleIntensityd input data type is not consistent with ScaleIntensity #1790

@yiheng-wang-nv

Description

@yiheng-wang-nv

In ScaleIntensityd, according to the doc string:

    If `minv` and `maxv` not provided, use `factor` to scale image by ``v = v * (1 + factor)``.

The parameters minv and maxv can be None that are the same as ScaleIntensity.
However, the types for these two parameters are limited to float.
It will lead to an error that if users need to use factor, the parameter will not be used actually since minv and maxv have values, the corresponding codes are as follow:

        if self.minv is not None and self.maxv is not None:
            return np.asarray(rescale_array(img, self.minv, self.maxv, img.dtype))
        if self.factor is not None:
            return np.asarray(img * (1 + self.factor), dtype=img.dtype)

Let me submit a simple PR to modify them into Optional[float].

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions