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
f92f6af2
Commit
f92f6af2
authored
Nov 18, 2019
by
Michiel Cottaar
Browse files
BUG: give target density in # of streamlines to streamline density
parent
20e6797e
Pipeline
#4759
passed with stage
in 6 minutes and 23 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
gyral_structure/scripts/gs_fit
View file @
f92f6af2
...
...
@@ -31,7 +31,7 @@ parser.add_argument('-s1', '--first_rbf', default=20., type=float,
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 '
help
=
'GIFTI (.shape.gii) file with the target surface density
in number of streamlines per vertex
'
'(default: uniform per unit of cortical volume)'
)
parser
.
add_argument
(
'--ignore_bad_dyads'
,
action
=
'store_true'
,
help
=
'ignore alignment constraint for voxels where the dyad is undefined'
)
...
...
@@ -85,11 +85,14 @@ else:
white_normal
=
white_surf
.
normal
().
T
white_radial
=
cost
.
orient
.
VonMises
(
white_request
,
field
=
white_normal
)
/
white_request
.
npos
white_density
=
cost
.
dens
.
TargetInner
(
white_request
,
field
=
white_normal
,
target_inner
=
target_density
)
/
white_request
.
npos
white_density
=
cost
.
dens
.
TargetInner
(
white_request
,
field
=
white_normal
,
target_inner
=
target_density
/
white_surf
.
size_faces
())
/
white_request
.
npos
if
args
.
mid_thickness
is
not
None
:
mid_normal
=
CorticalMesh
.
read
(
args
.
mid_thickness
)[
surf_mask
].
normal
().
T
mid_surf
=
CorticalMesh
.
read
(
args
.
mid_thickness
)[
surf_mask
]
mid_normal
=
mid_surf
.
normal
().
T
mid_radial
=
cost
.
orient
.
VonMises
(
mid_request
,
field
=
mid_normal
)
/
mid_request
.
npos
mid_uniform
=
cost
.
dens
.
TargetInner
(
mid_request
,
field
=
mid_normal
,
target_inner
=
target_density
)
/
mid_request
.
npos
mid_uniform
=
cost
.
dens
.
TargetInner
(
mid_request
,
field
=
mid_normal
,
target_inner
=
target_density
/
mid_surf
.
size_faces
())
/
mid_request
.
npos
radial
=
0.5
*
(
white_radial
+
mid_radial
)
density
=
0.5
*
(
white_density
+
mid_uniform
)
else
:
...
...
@@ -112,7 +115,7 @@ mm_max = ref_img.affine[:3, :3].dot(voxel_max) + ref_img.affine[:3, -1]
masked_pial
=
CorticalMesh
.
read
(
args
.
pial
)[
surf_mask
]
points_pial
=
masked_pial
.
vertices
[:,
masked_pial
.
faces
].
mean
(
1
).
T
charge_pial
=
-
white_request
.
size
()
*
target_density
charge_pial
=
target_density
charge_max
=
-
np
.
atleast_1d
(
charge_pial
.
sum
())
...
...
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