diff --git a/fsl/data/vest.py b/fsl/data/vest.py index 2c60568801c9dc7ff36fedb614da56f6ab8f7fec..b0b33c73fa41ab045c849d079f52d73d40baccf6 100644 --- a/fsl/data/vest.py +++ b/fsl/data/vest.py @@ -22,7 +22,16 @@ def looksLikeVestLutFile(path): ``False`` otherwise. """ with open(path, 'rt') as f: - return f.readline().strip() == '%!VEST-LUT' + + lines = [] + for i in range(10): + line = f.readline() + if line is None: break + else: lines.append(line.strip()) + + validHeaders = ('%!VEST-LUT', '%BeginInstance', '%%BeginInstance') + + return len(lines) > 0 and lines[0] in validHeaders def loadVestLutFile(path, normalise=True):