Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Michiel Cottaar
gyral_structure
Commits
c795e05f
Commit
c795e05f
authored
Jan 07, 2020
by
Michiel Cottaar
Browse files
ENH: bring back option to have uniform density at surface
parent
1ae45c43
Pipeline
#4857
canceled with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
gyral_structure/scripts/gs_fit
View file @
c795e05f
...
...
@@ -32,7 +32,8 @@ parser.add_argument('-s2', '--second_rbf', default=7., type=float,
help
=
'RBF Dipole size during the second optimisation step in mm (default: 7)'
)
parser
.
add_argument
(
'-td'
,
'--target_density'
,
help
=
'GIFTI (.shape.gii) file with the target surface density in number of streamlines per vertex '
'(default: uniform per unit of cortical volume)'
)
'(default: uniform per unit of cortical volume).'
'Can be set to "white", "mid", or "pial" to be uniform on that surface.'
)
parser
.
add_argument
(
'--ignore_bad_dyads'
,
action
=
'store_true'
,
help
=
'ignore alignment constraint for voxels where the dyad is undefined'
)
args
=
parser
.
parse_args
()
...
...
@@ -76,6 +77,10 @@ white_surf = CorticalMesh.read(args.white)[surf_mask]
if
args
.
target_density
is
None
:
target_density
=
Cortex
([
white_surf
,
CorticalMesh
.
read
(
args
.
pial
)[
surf_mask
]]).
wedge_volume
()
elif
args
.
target_density
in
(
'white'
,
'mid'
,
'pial'
):
fn
=
getattr
(
args
,
'mid_thickness'
if
args
.
target_density
==
'mid'
else
args
.
target_density
)
surf
=
CorticalMesh
.
read
(
fn
)[
surf_mask
]
target_density
=
surf
.
size_faces
()
else
:
target_density_vertex
=
nib
.
load
(
args
.
target_density
).
darrays
[
0
].
data
[
surf_mask
]
target_density
=
white_surf
.
graph_connection_point
().
T
.
dot
(
target_density_vertex
)
/
3.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment