Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
load_varian
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
load_varian
Commits
7d0b362b
Commit
7d0b362b
authored
20 years ago
by
Stuart Clare
Browse files
Options
Downloads
Patches
Plain Diff
Fixed entghost bug
parent
a37e4aa0
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
entghost.c
+10
-5
10 additions, 5 deletions
entghost.c
process.c
+1
-1
1 addition, 1 deletion
process.c
with
11 additions
and
6 deletions
entghost.c
+
10
−
5
View file @
7d0b362b
...
...
@@ -190,14 +190,16 @@ void phase_correct(float *in, float *out, int ppl, int lpi,int nseg,float ph1)
double
calc_entropy
(
float
*
data
,
long
imsize
)
{
long
l
;
double
s
;
double
s
,
t
;
int
hist
[
100
];
calc_hist
(
data
,
imsize
,
egr_min
,
egr_max
,
100
,
hist
);
s
=
0
;
for
(
l
=
0
;
l
<
100
;
l
++
){
s
-=
((
double
)
hist
[
l
]
/
imsize
)
*
log
((
double
)
hist
[
l
]
/
imsize
);
t
=
((
double
)
hist
[
l
]
/
(
double
)
imsize
)
*
log
((
double
)
hist
[
l
]
/
(
double
)
imsize
);
if
(
!
isnan
(
t
))
s
-=
t
;
}
return
(
s
/
log
(
100
.
0
));
}
...
...
@@ -330,12 +332,12 @@ void iepi_entropy_ghost_reduction(float *data,int ppl,int lpi,int ipv,int nseg)
egr_ppl
=
ppl
;
egr_lpi
=
lpi
;
egr_seg
=
nseg
;
egr_tmp
=
(
float
*
)
malloc
(
ppl
*
lpi
*
2
*
sizeof
(
float
));
ColumnVector
result
(
4
*
nseg
);
ColumnVector
tol
(
4
*
nseg
);
ColumnVector
bound
(
4
*
nseg
);
result
=
0
;
tol
=
0
.
01
;
bound
=
10
;
...
...
@@ -344,14 +346,15 @@ void iepi_entropy_ghost_reduction(float *data,int ppl,int lpi,int ipv,int nseg)
egr_data
=
&
data
[
i
*
ppl
*
lpi
*
2
];
result
=
0
;
egr_calc
=
0
;
optimise
(
result
,
nseg
*
3
,
tol
,
iepi_cost_function
,
iter
,
100
,
bound
);
optimise
(
result
,
nseg
*
4
,
tol
,
iepi_cost_function
,
iter
,
100
,
bound
);
iepi_rephase
(
egr_data
,
egr_data
,
ppl
,
lpi
,
nseg
,
result
);
//cout << result.t();
}
free
(
egr_tmp
);
}
float
iepi_cost_function
(
const
ColumnVector
&
input
)
{
egr_tmp
=
(
float
*
)
calloc
(
egr_ppl
*
egr_lpi
*
2
,
sizeof
(
float
));
iepi_rephase
(
egr_data
,
egr_tmp
,
egr_ppl
,
egr_lpi
,
egr_seg
,
input
);
image_fftw_c
(
egr_tmp
,
egr_ppl
,
egr_lpi
,
1
,
1
);
lv_modulus
(
egr_tmp
,
egr_ppl
*
egr_lpi
*
2
);
...
...
@@ -362,6 +365,8 @@ float iepi_cost_function(const ColumnVector& input)
egr_calc
=
1
;
}
float
e
=
calc_entropy
(
egr_tmp
,
egr_ppl
*
egr_lpi
);
free
(
egr_tmp
);
return
(
e
);
}
...
...
This diff is collapsed.
Click to expand it.
process.c
+
1
−
1
View file @
7d0b362b
...
...
@@ -592,7 +592,7 @@ int process(char *infile,char *outfile,struct flags *proc)
/* S T A R T O F M A I N P R O C E S S I N G L O O P */
/* ==================================================================== */
/* ==================================================================== */
/* Loop over volumes */
maxset
=
0
;
for
(
i
=
proc
->
start
;
i
<
proc
->
start
+
proc
->
num
;
i
++
){
...
...
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