Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DCT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
graintracking
DCT
Commits
6b6d40f7
Commit
6b6d40f7
authored
8 years ago
by
Nicola Vigano
Browse files
Options
Downloads
Patches
Plain Diff
PSF/OTF: fixed OTF application for the case where circular convolution might be an issue
Signed-off-by:
Nicola Vigano
<
nicola.vigano@esrf.fr
>
parent
4abe1865
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
zUtil_Imaging/GtPSF.m
+13
-3
13 additions, 3 deletions
zUtil_Imaging/GtPSF.m
zUtil_Imaging/gtOTFGetMeasured.m
+5
-5
5 additions, 5 deletions
zUtil_Imaging/gtOTFGetMeasured.m
with
18 additions
and
8 deletions
zUtil_Imaging/GtPSF.m
+
13
−
3
View file @
6b6d40f7
...
...
@@ -11,6 +11,7 @@ classdef GtPSF < handle
image_size
=
[];
use_otf
=
true
;
otf_padding
=
0
;
data_type
=
'single'
;
end
...
...
@@ -95,11 +96,15 @@ classdef GtPSF < handle
num_psfs
=
size
(
psf
,
2
);
psf_edge
=
(
size
(
psf
,
1
)
-
1
)
/
2
;
otf
=
zeros
([
self
.
image_size
(
1
),
num_psfs
,
self
.
image_size
(
2
)],
self
.
data_type
);
self
.
otf_padding
=
psf_edge
;
comp_img_size
=
[
self
.
image_size
(
1
)
+
2
*
psf_edge
,
...
num_psfs
,
self
.
image_size
(
2
)
+
2
*
psf_edge
];
otf
=
zeros
(
comp_img_size
,
self
.
data_type
);
center_otf
=
floor
(
self
.
image_size
/
2
)
+
1
;
lims_otf_lower
=
center_otf
-
psf_edge
;
lims_otf_upper
=
center_otf
+
psf_edge
;
lims_otf_lower
=
center_otf
;
lims_otf_upper
=
center_otf
+
2
*
psf_edge
;
otf
(
lims_otf_lower
(
1
):
lims_otf_upper
(
1
),
:,
lims_otf_lower
(
2
):
lims_otf_upper
(
2
))
=
psf
;
...
...
@@ -152,6 +157,8 @@ classdef GtPSF < handle
end
function
imgs
=
apply_otf
(
self
,
imgs
,
is_direct
)
imgs
=
padarray
(
imgs
,
[
self
.
otf_padding
,
0
,
self
.
otf_padding
]);
imgs
=
ifftshift
(
imgs
,
1
);
imgs
=
ifftshift
(
imgs
,
3
);
...
...
@@ -177,6 +184,9 @@ classdef GtPSF < handle
imgs
=
fftshift
(
imgs
,
3
);
imgs
=
real
(
imgs
);
imgs
=
imgs
((
self
.
otf_padding
+
1
):(
end
-
self
.
otf_padding
),
:,
...
(
self
.
otf_padding
+
1
):(
end
-
self
.
otf_padding
));
end
function
imgs
=
apply_psf
(
self
,
imgs
,
is_direct
)
...
...
This diff is collapsed.
Click to expand it.
zUtil_Imaging/gtOTFGetMeasured.m
+
5
−
5
View file @
6b6d40f7
...
...
@@ -13,11 +13,11 @@ function [otf, psf] = gtOTFGetMeasured(opt, varargin)
% 8: for testing
% 9: for fits
% Optional Input:
%
m
: number of row samples
%
n : number of column samples
%
oversampling : samplerate is fixed by oversamp, sigmas expressed in pixels,
%
changing n changes the width of the window and sampling rat
e
%
in frequency space
%
size
: number of
column/
row samples
%
oversampling : samplerate is fixed by oversampling, sigmas expressed in
%
pixels, changing size changes the width of the window and sampling
%
rate in frequency spac
e
%
p
: user specified fitting parameters
%
% Derived from a modified version of the function: mncf from
% Wolfgang/Peter's matlab functions
...
...
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