Skip to content
Snippets Groups Projects
Commit 0384e0b4 authored by Paul McCarthy's avatar Paul McCarthy :mountain_bicyclist:
Browse files

Merge branch 'master' into 'master'

MNT: renamed extract_noise to fsl_ents

See merge request fsl/fslpy!72
parents 6e6561b3 bc07af23
No related branches found
No related tags found
No related merge requests found
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
# #
# Author: Paul McCarthy <pauldmccarthy@gmail.com> # Author: Paul McCarthy <pauldmccarthy@gmail.com>
# #
"""This module defines the ``extract_noise`` script, for extracting component """This module defines the ``fsl_ents`` script, for extracting component
time series from a MELODIC ``.ica`` directory. time series from a MELODIC ``.ica`` directory.
""" """
...@@ -28,7 +28,7 @@ with warnings.catch_warnings(): ...@@ -28,7 +28,7 @@ with warnings.catch_warnings():
DTYPE = np.float64 DTYPE = np.float64
name = "extract_noise" name = "fsl_ents"
desc = 'Extract component time series from a MELODIC .ica directory' desc = 'Extract component time series from a MELODIC .ica directory'
usage = """ usage = """
{name}: {desc} {name}: {desc}
...@@ -204,7 +204,7 @@ def loadConfoundFiles(conffiles, npts): ...@@ -204,7 +204,7 @@ def loadConfoundFiles(conffiles, npts):
def main(argv=None): def main(argv=None):
"""Entry point for the ``extract_noise`` script. """Entry point for the ``fsl_ents`` script.
Identifies component time series to extract, extracts them, loads extra Identifies component time series to extract, extracts them, loads extra
confound files, and saves them out to a file. confound files, and saves them out to a file.
......
...@@ -124,7 +124,7 @@ setup( ...@@ -124,7 +124,7 @@ setup(
'imglob = fsl.scripts.imglob:main', 'imglob = fsl.scripts.imglob:main',
'atlasq = fsl.scripts.atlasq:main', 'atlasq = fsl.scripts.atlasq:main',
'atlasquery = fsl.scripts.atlasq:atlasquery_emulation', 'atlasquery = fsl.scripts.atlasq:atlasquery_emulation',
'extract_noise = fsl.scripts.extract_noise:main', 'fsl_ents = fsl.scripts.fsl_ents:main',
] ]
} }
) )
#!/usr/bin/env python #!/usr/bin/env python
# #
# test_extract_noise.py - # test_fsl_ents.py -
# #
# Author: Paul McCarthy <pauldmccarthy@gmail.com> # Author: Paul McCarthy <pauldmccarthy@gmail.com>
# #
...@@ -12,7 +12,7 @@ import numpy as np ...@@ -12,7 +12,7 @@ import numpy as np
import pytest import pytest
import fsl.utils.tempdir as tempdir import fsl.utils.tempdir as tempdir
import fsl.scripts.extract_noise as extn import fsl.scripts.fsl_ents as extn
def test_genComponentIndexList(): def test_genComponentIndexList():
...@@ -87,7 +87,7 @@ def test_loadConfoundFiles(): ...@@ -87,7 +87,7 @@ def test_loadConfoundFiles():
extn.loadConfoundFiles(conffiles, npts) extn.loadConfoundFiles(conffiles, npts)
def test_extract_noise(): def test_fsl_ents():
with tempdir.tempdir() as td: with tempdir.tempdir() as td:
...@@ -95,7 +95,7 @@ def test_extract_noise(): ...@@ -95,7 +95,7 @@ def test_extract_noise():
melmix = np.random.randint(1, 100, (100, 20)) melmix = np.random.randint(1, 100, (100, 20))
np.savetxt('melodic_mix', melmix) np.savetxt('melodic_mix', melmix)
sys.argv = ['extract_noise', td] + '-o out.txt 1 2 3'.split() sys.argv = ['fsl_ents', td] + '-o out.txt 1 2 3'.split()
extn.main() extn.main()
assert np.all(np.loadtxt('out.txt') == melmix[:, :3]) assert np.all(np.loadtxt('out.txt') == melmix[:, :3])
...@@ -115,13 +115,13 @@ def test_extract_noise(): ...@@ -115,13 +115,13 @@ def test_extract_noise():
assert np.all(np.loadtxt('out.txt') == exp) assert np.all(np.loadtxt('out.txt') == exp)
def test_extract_noise_usage(): def test_fsl_ents_usage():
with pytest.raises(SystemExit) as e: with pytest.raises(SystemExit) as e:
extn.main([]) extn.main([])
assert e.value.code == 0 assert e.value.code == 0
def test_extract_noise_badargs(): def test_fsl_ents_badargs():
with pytest.raises(SystemExit) as e: with pytest.raises(SystemExit) as e:
extn.main(['non-existent.ica', '1', '2', '3']) extn.main(['non-existent.ica', '1', '2', '3'])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment