take TR units into account
@@ -503,6 +503,9 @@ def plot_melodic_components(melodic_dir, in_file, tr=None,
in_nii = nb.load(in_file)
if not tr:
tr = in_nii.header.get_zooms()[3]
+ units = in_nii.header.get_xyzt_units()
+ if units and units[-1] == 'msec':
+ tr = tr/1000.0
from nilearn.input_data import NiftiMasker
from nilearn.plotting import plot_roi
