Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fdt
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
FSL
fdt
Commits
57b76782
Commit
57b76782
authored
15 years ago
by
Tim Behrens
Browse files
Options
Downloads
Patches
Plain Diff
changed randfib functionality
/bin/bash: i: command not found
parent
573cbf46
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
probtrackxOptions.h
+3
-3
3 additions, 3 deletions
probtrackxOptions.h
streamlines.cc
+3
-8
3 additions, 8 deletions
streamlines.cc
tractvolsx.h
+54
-2
54 additions, 2 deletions
tractvolsx.h
with
60 additions
and
13 deletions
probtrackxOptions.h
+
3
−
3
View file @
57b76782
...
...
@@ -63,7 +63,7 @@ class probtrackxOptions {
Option
<
float
>
steplength
;
Option
<
bool
>
loopcheck
;
Option
<
bool
>
usef
;
Option
<
bool
>
randfib
;
Option
<
int
>
randfib
;
Option
<
int
>
fibst
;
Option
<
bool
>
modeuler
;
Option
<
int
>
rseed
;
...
...
@@ -200,8 +200,8 @@ class probtrackxOptions {
usef
(
string
(
"-f,--usef"
),
false
,
string
(
"Use anisotropy to constrain tracking"
),
false
,
no_argument
),
randfib
(
string
(
"--randfib"
),
false
,
string
(
"Se
lect randomly from one of the fibres
"
),
randfib
(
string
(
"--randfib"
),
0
,
string
(
"Se
t to 1 to randomly sample initial fibres. Set to 2 to sample in proportion to f
"
),
false
,
no_argument
),
fibst
(
string
(
"--fibst"
),
1
,
string
(
"Force a starting fibre for tracking - default=1, i.e. first fibre orientation"
),
...
...
This diff is collapsed.
Click to expand it.
streamlines.cc
+
3
−
8
View file @
57b76782
...
...
@@ -1001,14 +1001,9 @@ namespace TRACT{
if
(
fibst
==
-
1
){
fibst
=
0
;
//m_seeds(int(round(x)),int(round(y)),int(round(z)))-1;//fibre to start with is taken from seed volume..
}
if
(
opts
.
randfib
.
value
()){
float
tmp
=
rand
()
/
RAND_MAX
*
float
(
m_stline
.
nfibres
()
-
1
);
fibst
=
(
int
)
round
(
tmp
);
//if(tmp>0.5)
//fibst=0;
//else
//fibst=1;// fix this for > 2 fibres
}
//TB moved randfib option inside tractvols.h 28/10/2009
// This means that we have access to fsamples when figuring out fibst
// so we can choose to seed in proportion to f in that voxel.
}
// now re-orient dir using xfm transform
...
...
This diff is collapsed.
Click to expand it.
tractvolsx.h
+
54
−
2
View file @
57b76782
...
...
@@ -35,7 +35,7 @@ namespace TRACTVOLSX{
public:
//constructors::
Tractvolsx
(
const
bool
&
usefin
=
false
)
:
opts
(
probtrackxOptions
::
getInstance
()),
init_sample
(
true
),
fibst
(
1
),
usef
(
usefin
){}
Tractvolsx
(
const
bool
&
usefin
=
false
)
:
opts
(
probtrackxOptions
::
getInstance
()),
init_sample
(
true
),
fibst
(
0
),
usef
(
usefin
){}
Tractvolsx
()
:
opts
(
probtrackxOptions
::
getInstance
()){}
~
Tractvolsx
(){
for
(
unsigned
int
m
=
0
;
m
<
thsamples
.
size
();
m
++
)
...
...
@@ -155,10 +155,62 @@ namespace TRACTVOLSX{
float
dotmax
=
0
,
dottmp
=
0
;
int
fibind
=
0
;
if
(
thsamples
.
size
()
>
1
){
//more than 1 fibre
if
(
init_sample
){
//go for the specified option on the first jump
if
(
init_sample
){
//go for the specified fibre on the first jump or generate at random
if
(
opts
.
randfib
.
value
()
==
1
){
//this generates startfib at random (except for fibres where f<fibthresh)
vector
<
int
>
fibvec
;
for
(
unsigned
int
fib
=
0
;
fib
<
thsamples
.
size
();
fib
++
){
float
ft
=
(
*
fsamples
[
fib
])(
int
(
newx
),
int
(
newy
),
int
(
newz
),
int
(
samp
));
if
(
ft
>
opts
.
fibthresh
.
value
()){
fibvec
.
push_back
(
fib
);
}
}
if
(
fibvec
.
size
()
==
0
){
fibst
=
0
;
}
else
{
float
rtmp
=
rand
()
/
RAND_MAX
*
float
(
fibvec
.
size
()
-
1
);
fibst
=
fibvec
[
(
int
)
round
(
rtmp
)
];
}
}
else
if
(
opts
.
randfib
.
value
()
==
2
){
//this generates startfib with probability proportional to f (except for fibres where f<fibthresh).
//this chooses at random but in proportion to fsamples.
float
fsumtmp
=
0
;
for
(
unsigned
int
fib
=
0
;
fib
<
thsamples
.
size
();
fib
++
){
float
ft
=
(
*
fsamples
[
fib
])(
int
(
newx
),
int
(
newy
),
int
(
newz
),
int
(
samp
));
if
(
ft
>
opts
.
fibthresh
.
value
()){
fsumtmp
+=
ft
;
//count total weight of f in this voxel.
}
}
if
(
fsumtmp
==
0
){
fibst
=
0
;
}
else
{
float
fsumtmp2
=
0
;
int
fib
=
0
;
float
rtmp
=
rand
()
/
RAND_MAX
;
while
(
fsumtmp2
<
rtmp
){
float
ft
=
(
*
fsamples
[
fib
])(
int
(
newx
),
int
(
newy
),
int
(
newz
),
int
(
samp
));
if
(
ft
>
opts
.
fibthresh
.
value
()){
fsumtmp2
+=
(
ft
/
fsumtmp
);
}
fibst
=
fib
;
fib
++
;
}
}
theta
=
(
*
thsamples
[
fibst
])(
int
(
newx
),
int
(
newy
),
int
(
newz
),
int
(
samp
));
phi
=
(
*
phsamples
[
fibst
])(
int
(
newx
),
int
(
newy
),
int
(
newz
),
int
(
samp
));
init_sample
=
false
;
}
}
else
{
if
((
fabs
(
prefer_x
)
+
fabs
(
prefer_y
)
+
fabs
(
prefer_z
))
==
0
){
...
...
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