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
7d4af4a5
Commit
7d4af4a5
authored
15 years ago
by
Saad Jbabdi
Browse files
Options
Downloads
Patches
Plain Diff
fixed rand() bug in randfib=2
parent
20165ae8
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tractvolsx.h
+7
-7
7 additions, 7 deletions
tractvolsx.h
with
7 additions
and
7 deletions
tractvolsx.h
+
7
−
7
View file @
7d4af4a5
...
@@ -128,26 +128,26 @@ namespace TRACTVOLSX{
...
@@ -128,26 +128,26 @@ namespace TRACTVOLSX{
///////new xyz values from probabilistic interpolation
///////new xyz values from probabilistic interpolation
int
newx
,
newy
,
newz
;
int
newx
,
newy
,
newz
;
float
tmp
=
rand
();
tmp
/=
float
(
RAND_MAX
);
float
tmp
=
(
float
)
rand
()
/
float
(
RAND_MAX
);
if
(
tmp
>
pcx
)
if
(
tmp
>
pcx
)
newx
=
fx
;
newx
=
fx
;
else
else
newx
=
cx
;
newx
=
cx
;
tmp
=
rand
();
tmp
/=
float
(
RAND_MAX
);
tmp
=
(
float
)
rand
()
/
float
(
RAND_MAX
);
if
(
tmp
>
pcy
)
if
(
tmp
>
pcy
)
newy
=
fy
;
newy
=
fy
;
else
else
newy
=
cy
;
newy
=
cy
;
tmp
=
rand
();
tmp
/=
float
(
RAND_MAX
);
tmp
=
(
float
)
rand
()
/
float
(
RAND_MAX
);
if
(
tmp
>
pcz
)
if
(
tmp
>
pcz
)
newz
=
fz
;
newz
=
fz
;
else
else
newz
=
cz
;
newz
=
cz
;
ColumnVector
th_ph_f
(
3
);
ColumnVector
th_ph_f
(
3
);
float
samp
=
rand
();
samp
/=
float
(
RAND_MAX
);
float
samp
=
(
float
)
rand
()
/
float
(
RAND_MAX
);
samp
=
round
(
samp
*
((
*
thsamples
[
0
]).
tsize
()
-
1
));
samp
=
round
(
samp
*
((
*
thsamples
[
0
]).
tsize
()
-
1
));
float
theta
=
0
,
phi
=
0
;
float
theta
=
0
,
phi
=
0
;
float
dotmax
=
0
,
dottmp
=
0
;
float
dotmax
=
0
,
dottmp
=
0
;
...
@@ -167,7 +167,7 @@ namespace TRACTVOLSX{
...
@@ -167,7 +167,7 @@ namespace TRACTVOLSX{
fibst
=
0
;
fibst
=
0
;
}
}
else
{
else
{
float
rtmp
=
rand
()
/
float
(
RAND_MAX
)
*
float
(
fibvec
.
size
()
-
1
);
float
rtmp
=
(
float
)
rand
()
/
float
(
RAND_MAX
)
*
float
(
fibvec
.
size
()
-
1
);
fibst
=
fibvec
[
(
int
)
round
(
rtmp
)
];
fibst
=
fibvec
[
(
int
)
round
(
rtmp
)
];
}
}
...
@@ -188,9 +188,9 @@ namespace TRACTVOLSX{
...
@@ -188,9 +188,9 @@ namespace TRACTVOLSX{
else
{
else
{
float
fsumtmp2
=
0
;
float
fsumtmp2
=
0
;
int
fib
=
0
;
int
fib
=
0
;
float
rtmp
=
rand
()
/
float
(
RAND_MAX
);
float
rtmp
=
(
float
)
rand
()
/
float
(
RAND_MAX
);
while
(
fsumtmp2
<
rtmp
){
while
(
fsumtmp2
<
=
rtmp
){
float
ft
=
(
*
fsamples
[
fib
])(
int
(
newx
),
int
(
newy
),
int
(
newz
),
int
(
samp
));
float
ft
=
(
*
fsamples
[
fib
])(
int
(
newx
),
int
(
newy
),
int
(
newz
),
int
(
samp
));
if
(
ft
>
opts
.
fibthresh
.
value
()){
if
(
ft
>
opts
.
fibthresh
.
value
()){
fsumtmp2
+=
(
ft
/
fsumtmp
);
fsumtmp2
+=
(
ft
/
fsumtmp
);
...
...
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