pydicom.valuerep.ISfloat¶
- class pydicom.valuerep.ISfloat(val: str | float | Decimal, validation_mode: int | None = None)[source]¶
Store value for an element with VR IS as
float.Stores original integer string for exact rewriting of the string originally read or stored.
Note: By the DICOM standard, IS can only be an
int, however, it is not uncommon to see float IS values. This class is used if the config settings allow non-strict reading.Generally, use
ISto create IS values, this is returned instead if the value cannot be represented as anint. SeeISfor details of the parameters and return values.Methods
__init__(val[, validation_mode])as_integer_ratio()Return integer ratio.
conjugate()Return self, the complex conjugate of any float.
fromhex()Create a floating-point number from a hexadecimal string.
hex()Return a hexadecimal representation of a floating-point number.
is_integer()Return True if the float is an integer.
Attributes
imagthe imaginary part of a complex number
realthe real part of a complex number