tedana.utils.check_t2s_values

check_t2s_values(t2s_map)[source]

Check and convert T2* map values to milliseconds.

This function checks if a precalculated T2* map is in seconds (expected per BIDS convention) or milliseconds. Typical brain T2* values at 3T are approximately 0.015-0.070 seconds (15-70 ms).

Parameters:

t2s_map (array_like) – T2* map values to check. Expected to be in seconds per BIDS convention.

Returns:

array_like – T2* map values converted to milliseconds for internal use.

Raises:

ValueError – If T2* values appear to be in unexpected units.

Notes

The heuristic used is:

  • If median non-zero T2* < 1: values are assumed to be in seconds (correct per BIDS), converted to milliseconds and returned

  • If median non-zero T2* >= 1 and < 1000: values are assumed to be in milliseconds already, a warning is logged, and values are returned as-is

  • If median non-zero T2* >= 1000: values are considered invalid

This function is designed to handle the common case where users provide T2* maps in milliseconds rather than seconds, which can cause severely biased optimal combination weighting.