Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
BIP
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
BIP
Commits
3a8bcfaf
Commit
3a8bcfaf
authored
2 years ago
by
Fidel Alfaro Almagro
Browse files
Options
Downloads
Patches
Plain Diff
Fixing a bug in the FreeSurfer call
parent
11709dc5
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
bip/data/FileTree.tree
+2
-2
2 additions, 2 deletions
bip/data/FileTree.tree
bip/ext_wrappers/freesurfer.py
+3
-3
3 additions, 3 deletions
bip/ext_wrappers/freesurfer.py
bip/pipelines/struct_FS/FS_proc.py
+25
-7
25 additions, 7 deletions
bip/pipelines/struct_FS/FS_proc.py
with
30 additions
and
12 deletions
bip/data/FileTree.tree
LFS
+
2
−
2
View file @
3a8bcfaf
No preview for this file type
This diff is collapsed.
Click to expand it.
bip/ext_wrappers/freesurfer.py
+
3
−
3
View file @
3a8bcfaf
...
...
@@ -28,11 +28,11 @@ def recon_all(subjects_dir, directive, subjid, infile, FLAIR=None, **kwargs):
os
.
environ
[
"
SUBJECTS_DIR
"
]
=
subjects_dir
cmd
=
[
'
recon-all
'
,
"
-
"
+
directive
+
"
-s
"
+
subjid
]
cmd
+=
[
"
-i
"
+
subjects_dir
+
"
/
"
+
infile
]
cmd
=
[
'
recon-all
'
,
"
-
"
+
directive
+
"
-s
"
+
subjid
]
cmd
+=
[
"
-i
"
+
subjects_dir
+
"
/
"
+
infile
]
if
FLAIR
:
cmd
+=
[
"
-FLAIR
"
+
subjects_dir
+
"
/
"
+
FLAIR
+
"
-FLAIRpial
"
]
cmd
+=
[
"
-FLAIR
"
+
subjects_dir
+
"
/
"
+
FLAIR
+
"
-FLAIRpial
-debug
"
]
return
cmd
...
...
This diff is collapsed.
Click to expand it.
bip/pipelines/struct_FS/FS_proc.py
+
25
−
7
View file @
3a8bcfaf
...
...
@@ -11,9 +11,11 @@
#
import
os
import
shutil
import
logging
import
subprocess
from
pipe_tree
import
In
,
Out
,
Ref
from
bip
import
ext_wrappers
#
from bip import ext_wrappers
from
bip.utils
import
redirect_logging
log
=
logging
.
getLogger
(
__name__
)
...
...
@@ -22,15 +24,31 @@ def run(ctx,
T1_unbiased
:
In
,
T2_FLAIR_unbiased
:
In
(
optional
=
True
),
logs_dir
:
Ref
,
FreeSurfer_dir
:
Ref
,
rh_entorhinal_exvivo_label
:
Out
):
with
redirect_logging
(
'
FS_proc
'
,
outdir
=
logs_dir
):
opt_T2_FLAIR
=
None
if
os
.
path
.
exists
(
FreeSurfer_dir
):
shutil
.
rmtree
(
FreeSurfer_dir
)
subjects_dir
=
os
.
getcwd
()
os
.
environ
[
"
SUBJECTS_DIR
"
]
=
subjects_dir
+
"
/
"
+
ctx
.
subject
cmd
=
'
recon-all -all -s FreeSurfer -i
'
+
subjects_dir
+
"
/
"
+
T1_unbiased
if
os
.
path
.
exists
(
T2_FLAIR_unbiased
):
opt_T2_FLAIR
=
T2_FLAIR_unbiased
cmd
+=
"
-FLAIR
"
+
subjects_dir
+
"
/
"
+
T2_FLAIR_unbiased
+
"
-FLAIRpial
"
try
:
returned_val
=
subprocess
.
call
(
cmd
,
shell
=
True
)
print
(
returned_val
)
except
Exception
as
e
:
print
(
'
Command:
'
+
cmd
)
print
(
'
Exception type:
\t
'
+
str
(
type
(
e
)))
print
(
'
Exception args:
\t
'
+
str
(
e
.
args
))
print
(
'
Exception message:
\t
'
+
str
(
e
))
ext_wrappers
.
recon_all
(
subjects_dir
=
os
.
getcwd
(),
directive
=
"
all
"
,
subjid
=
"
FreeSurfer
"
,
infile
=
T1_unbiased
,
FLAIR
=
opt_T2_FLAIR
)
print
(
"
PATATA
"
)
#ext_wrappers.recon_all(subjects_dir=os.getcwd(),
# directive="all", subjid="FreeSurfer",
# infile=T1_unbiased, FLAIR=opt_T2_FLAIR)
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