Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tvb-root
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
Container registry
Model registry
Operate
Environments
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
Michiel van der Vlag
tvb-root
Commits
f4df578c
Commit
f4df578c
authored
5 years ago
by
Marmaduke Woodman
Browse files
Options
Downloads
Patches
Plain Diff
initial idea of freesurfer analyzer, lacks adapter
I want to start adding funcitonality
parent
3a77e83f
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
scientific_library/tvb/analyzers/freesurfer.py
+21
-0
21 additions, 0 deletions
scientific_library/tvb/analyzers/freesurfer.py
scientific_library/tvb/datatypes/volumes.py
+18
-0
18 additions, 0 deletions
scientific_library/tvb/datatypes/volumes.py
with
39 additions
and
0 deletions
scientific_library/tvb/analyzers/freesurfer.py
0 → 100644
+
21
−
0
View file @
f4df578c
import
os.path
import
subprocess
from
tvb.datatypes.volumes
import
Volume
,
VolumeInFile
,
FreeSurferSubject
from
tvb.basic.neotraits.api
import
HasTraits
,
Attr
class
FreeSurferRun
(
HasTraits
):
input_T1
=
Volume
(
label
=
"
Input T1.
"
)
def
evaluate
(
self
):
vol
:
VolumeInFile
=
VolumeInFile
.
from_volume
(
self
.
input_T1
)
path
=
vol
.
file_path
tmp_dir
=
'
/tmp/tvb-fs
'
cmd
=
'
freesurfer -i {} -all -s {}
'
proc
=
subprocess
.
Popen
(
cmd
.
format
(
path
,
'
tvb
'
).
split
(),
env
=
{
'
SUBJECTS_DIR
'
:
tmp_dir
},
stderr
=
subprocess
.
STDIN
,
stdin
=
subprocess
.
PIPE
,
)
proc
.
wait
()
return
FreeSurferSubject
(
subject_folder
=
os
.
path
.
join
(
tmp_dir
,
'
tvb
'
))
\ No newline at end of file
This diff is collapsed.
Click to expand it.
scientific_library/tvb/datatypes/volumes.py
+
18
−
0
View file @
f4df578c
...
...
@@ -53,3 +53,21 @@ class Volume(HasTraits):
"
Voxel size
"
:
self
.
voxel_size
,
"
Units
"
:
self
.
voxel_unit
}
class
VolumeInFile
(
Volume
):
"""
Volume in a file.
"""
file_path
=
Attr
(
str
,
label
=
"
Path to data files.
"
)
@classmethod
def
from_volume
(
self
,
vol
:
Volume
):
raise
NotImplemented
class
FreeSurferSubject
(
HasTraits
):
"""
Analysis of volume by FreeSurfer
"""
subject_folder
=
Volume
(
label
=
"
Input data for analysis.
"
)
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