Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fslpy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michiel Cottaar
fslpy
Commits
9bc7d650
Commit
9bc7d650
authored
8 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
Moved imcp/mv main scripts into a proper package, so they can be
programmatically invoked.
parent
5bf216bc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
fsl/scripts/__init__.py
+9
-0
9 additions, 0 deletions
fsl/scripts/__init__.py
fsl/scripts/imcp.py
+10
-1
10 additions, 1 deletion
fsl/scripts/imcp.py
fsl/scripts/immv.py
+9
-2
9 additions, 2 deletions
fsl/scripts/immv.py
setup.py
+6
-4
6 additions, 4 deletions
setup.py
with
34 additions
and
7 deletions
fsl/scripts/__init__.py
0 → 100644
+
9
−
0
View file @
9bc7d650
#!/usr/bin/env python
#
# __init__.py - The fsl.scripts package.
#
# Author: Paul McCarthy <pauldmccarthy@gmail.com>
#
"""
The ``fsl.scripts`` package contains all of the executable scripts provided
by ``fslpy``.
"""
This diff is collapsed.
Click to expand it.
bin/fslpy_
imcp
→
fsl/scripts/
imcp
.py
+
10
−
1
View file @
9bc7d650
#!/usr/bin/env python
#!/usr/bin/env python
#
#
# imcp - Copy image files.
# imcp
.py
- Copy image files.
#
#
# Author: Paul McCarthy <paulmc@fmrib.ox.ac.uk>
# Author: Paul McCarthy <paulmc@fmrib.ox.ac.uk>
#
#
"""
This module defines the ``imcp`` application, for copying NIFTI image
files.
The :func:`main` function is essentially a wrapper around the
:func:`fsl.utils.imcp.imcp` function - see its documentation for more details.
"""
from
__future__
import
print_function
from
__future__
import
print_function
...
@@ -33,6 +39,9 @@ def main(argv=None):
...
@@ -33,6 +39,9 @@ def main(argv=None):
:func:`fsl.utils.imcp.imcp` function on each input.
:func:`fsl.utils.imcp.imcp` function on each input.
"""
"""
if
argv
is
None
:
argv
=
sys
.
argv
[
1
:]
if
len
(
argv
)
<
2
:
if
len
(
argv
)
<
2
:
print
(
usage
)
print
(
usage
)
sys
.
exit
(
1
)
sys
.
exit
(
1
)
...
...
This diff is collapsed.
Click to expand it.
bin/fslpy_
immv
→
fsl/scripts/
immv
.py
+
9
−
2
View file @
9bc7d650
#!/usr/bin/env python
#!/usr/bin/env python
#
#
# immv - Move image files.
# immv
.py
- Move image files.
#
#
# Author: Paul McCarthy <paulmc@fmrib.ox.ac.uk>
# Author: Paul McCarthy <paulmc@fmrib.ox.ac.uk>
#
#
"""
This module defines the ``immv`` application, for moving NIFTI image
files.
The :func:`main` function is essentially a wrapper around the
:func:`fsl.utils.imcp.immv` function - see its documentation for more details.
"""
from
__future__
import
print_function
from
__future__
import
print_function
...
@@ -53,7 +60,7 @@ def main(argv=None):
...
@@ -53,7 +60,7 @@ def main(argv=None):
for
src
in
srcs
:
for
src
in
srcs
:
try
:
try
:
imcp
.
immv
(
src
,
dest
,
useDefaultExt
=
True
,
move
=
True
)
imcp
.
immv
(
src
,
dest
,
useDefaultExt
=
True
)
except
Exception
as
e
:
except
Exception
as
e
:
print
(
e
)
print
(
e
)
...
...
This diff is collapsed.
Click to expand it.
setup.py
+
6
−
4
View file @
9bc7d650
...
@@ -60,8 +60,10 @@ setup(
...
@@ -60,8 +60,10 @@ setup(
tests_require
=
[
'
pytest
'
,
'
pytest-runner
'
],
tests_require
=
[
'
pytest
'
,
'
pytest-runner
'
],
test_suite
=
'
tests
'
,
test_suite
=
'
tests
'
,
scripts
=
[
entry_points
=
{
op
.
join
(
'
bin
'
,
'
fslpy_imcp
'
),
'
console_scripts
'
:
[
op
.
join
(
'
bin
'
,
'
fslpy_immv
'
),
'
fslpy_imcp = fsl.scripts.imcp:main
'
,
]
'
fslpy_immv = fsl.scripts.immv:main
'
]
}
)
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment