Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pydr
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
FSL
pydr
Commits
8550b7f1
Commit
8550b7f1
authored
1 year ago
by
Fidel Alfaro Almagro
Browse files
Options
Downloads
Patches
Plain Diff
Allowing the code to be run without a cluster
parent
b6e13885
No related branches found
No related tags found
1 merge request
!4
Allowing the code to be run without a cluster
Pipeline
#23300
skipped
Stage: fsl-ci-build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pydr/__init__.py
+1
-1
1 addition, 1 deletion
pydr/__init__.py
pydr/dr.py
+28
-18
28 additions, 18 deletions
pydr/dr.py
with
29 additions
and
19 deletions
pydr/__init__.py
+
1
−
1
View file @
8550b7f1
#!/usr/bin/env python
__version__
=
'
0.1.
2
'
__version__
=
'
0.1.
3
'
This diff is collapsed.
Click to expand it.
pydr/dr.py
+
28
−
18
View file @
8550b7f1
...
...
@@ -140,13 +140,13 @@ def calc_spec(timeseries, TR=0.392, nfft=1024):
def
dr_single_subject
(
func
:
str
,
map
:
str
,
timecourse
:
str
,
grp_map
:
str
,
amplitude
:
str
=
None
,
spectra
:
str
=
None
,
func_smooth
:
str
=
None
func
:
str
,
map
:
str
,
timecourse
:
str
,
grp_map
:
str
,
amplitude
:
str
=
None
,
spectra
:
str
=
None
,
func_smooth
:
str
=
None
):
assert_env
(
'
FSLDIR
'
)
...
...
@@ -245,7 +245,7 @@ def dr_single_subject(
np
.
savetxt
(
spectra
,
spec
,
delimiter
=
'
\t
'
,
fmt
=
'
%.6f
'
)
def
dr
(
files
,
grp_maps
,
workdir
):
def
dr
(
files
,
grp_maps
,
workdir
,
submit_to_cluster
=
True
):
assert_env
(
'
FSLDIR
'
)
assert_env
(
'
FSLOUTPUTTYPE
'
)
...
...
@@ -308,14 +308,24 @@ def dr(files, grp_maps, workdir):
logger
.
info
(
cmd
)
fpr
.
write
(
cmd
+
'
\n
'
)
fsl_sub
=
[
'
fsl_sub
'
,
'
-T
'
,
'
1400
'
,
'
-l
'
,
f
'
{
workdir
}
/logs
'
,
'
--export
'
,
f
'
FSLDIR=
{
os
.
environ
[
"
FSLDIR
"
]
}
'
,
'
--export
'
,
f
'
FSLOUTPUTTYPE=
{
os
.
environ
[
"
FSLOUTPUTTYPE
"
]
}
'
,
'
-t
'
,
f
'
{
workdir
}
/logs/dr_commands.txt
'
,
]
# Run all commands sequentially in case user does not want to run them in the cluster
if
not
submit_to_cluster
:
with
open
(
f
'
{
workdir
}
/logs/dr_commands.txt
'
,
'
r
'
)
as
fpr
:
for
command
in
fpr
.
readlines
():
logger
.
info
(
'
'
.
join
(
command
))
output
=
run
(
command
)
print
(
output
)
logger
.
info
(
'
'
.
join
(
fsl_sub
))
run
(
fsl_sub
)
# Run all commands in the cluster with fsl_sub
else
:
command
=
[
'
fsl_sub
'
,
'
-T
'
,
'
1400
'
,
'
-l
'
,
f
'
{
workdir
}
/logs
'
,
'
--export
'
,
f
'
FSLDIR=
{
os
.
environ
[
"
FSLDIR
"
]
}
'
,
'
--export
'
,
f
'
FSLOUTPUTTYPE=
{
os
.
environ
[
"
FSLOUTPUTTYPE
"
]
}
'
,
'
-t
'
,
f
'
{
workdir
}
/logs/dr_commands.txt
'
,
]
logger
.
info
(
'
'
.
join
(
command
))
run
(
command
)
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