Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
irp
HoloTomoToolbox
Commits
82235c9d
Commit
82235c9d
authored
Jun 12, 2020
by
paulphilipp.meyer
Browse files
merged and resolved the conflict in readSpec.m
parents
c9754628
7d25c0e3
Pipeline
#139457
passed with stage
in 1 minute and 40 seconds
Changes
8
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
82235c9d
# HoloTomoToolbox
## How to cite ?
when using this toolbox, please cite:
A phase-retrieval toolbox for X-ray holography and tomography
Leon M. Lohse, Anna-Lena Robisch, Mareike Töpperwien, Simon Maretzke, Martin Krenkel, Johannes Hagemann, and Tim Salditt
Journal of Synchrotron Radiation 27, 852-859 (2020).
https://doi.org/10.1107/S1600577520002398
## Documentation
See the
[
online-documentation
](
https://irp.pages.gwdg.de/holotomotoolbox/
)
and code examples in
[
examples/
](
examples/
)
.
...
...
functions/imageProcessing/alignment/rotateImage.m
View file @
82235c9d
...
...
@@ -67,6 +67,10 @@ function imTransformed = rotateImage(im, rotAngleDegree, settings)
% You should have received a copy of the GNU General Public License
% along with this program. If not, see <http://www.gnu.org/licenses/>.
if
nargin
==
0
imTransformed
=
rmfield
(
shiftRotateMagnifyImage
,
'invertTransform'
);
return
end
if
nargin
<
3
settings
=
struct
;
end
...
...
functions/imageProcessing/alignment/shiftImage.m
View file @
82235c9d
...
...
@@ -66,6 +66,10 @@ function imTransformed = shiftImage(im, shifts, settings)
% You should have received a copy of the GNU General Public License
% along with this program. If not, see <http://www.gnu.org/licenses/>.
if
nargin
==
0
imTransformed
=
rmfield
(
shiftRotateMagnifyImage
,
'invertTransform'
);
return
end
if
nargin
<
3
settings
=
struct
;
end
...
...
functions/imageProcessing/alignment/shiftRotateImage.m
View file @
82235c9d
...
...
@@ -87,6 +87,10 @@ function imTransformed = shiftRotateImage(im, shifts, rotAngleDegree, settings)
% You should have received a copy of the GNU General Public License
% along with this program. If not, see <http://www.gnu.org/licenses/>.
if
nargin
==
0
imTransformed
=
shiftRotateMagnifyImage
;
return
end
if
nargin
<
4
settings
=
struct
;
end
...
...
functions/imageProcessing/artefactRemoval/removeStripes.m
View file @
82235c9d
...
...
@@ -17,16 +17,14 @@ function [imCorr, corr2D] = removeStripes(imToCorr,settings)
%
% Other Parameters
% ----------------
% rangeTop : Default =
1:100
% Range at the top of the image to average.
% rangeTop : Default =
[]
% Range at the top of the image to average.
[] results in the top most 4%
% rangeBottom : Default = []
% Range at the bottom of the image to average. [] results in the bottom most 100
% pixels of the image.
% rangeLeft : Default = 1:100
% Range at the left edge of the image to average.
% Range at the bottom of the image to average. [] results in the bottom most 4%
% rangeLeft : Default = []
% Range at the left edge of the image to average. [] results in the left most 4%
% rangeRight : Default = []
% Range at the right edge of the image to average. [] results in the right most
% 100 pixels of the image.
% Range at the right edge of the image to average. [] results in the right most 4%
% windowSize : Default = 5
% Window size for smoothing the profile via a moving mean.
% direction : Default = 'vertical'
...
...
functions/inputOutput/readSpec.m
View file @
82235c9d
...
...
@@ -41,7 +41,6 @@ if(nargin < 2)
% find available scans in specified file
list_scans
(
file
)
return
error
(
'Not enough input arguments: specify filepath, scan number and column'
);
end
if
(
nargin
<
3
)
...
...
functions/phaseRetrieval/holographic/phaserec_nonlinTikhonov.m
View file @
82235c9d
...
...
@@ -236,7 +236,8 @@ F = NonlinearPhaseContrastOperator(N, fresnelNumbers, parOp);
% Tikhonov functional(f) = || F(f) - holograms ||_2^2 + 2*|| regWeights * fft2(f) ||_2^2,
% where regWeights contains the same Fourier-space regularization weights as used in phaserec_ctf
% (note that "*" denotes composition of Operators/functionals in the following statements)
regWeightsTimes2
=
2
*
ctfRegWeights
(
N
,
mean
(
fresnelNumbers
,
2
),
settings
.
lim1
,
settings
.
lim2
,
useGPU
);
regWeightsTimes2
=
2
*
ctfRegWeights
(
N
,
mean
(
fresnelNumbers
,
2
),
settings
.
lim1
,
settings
.
lim2
,
...
useGPU
,
2
*
numHolos
);
TikhonovFunctional
=
NormSqFunctional
*
(
F
-
holograms
)
...
+
NormSqFunctional
(
@
(
f
)
real
(
ifft2
(
regWeightsTimes2
.*
fft2
(
f
))));
...
...
functions/phaseRetrieval/holographic/private/ctfRegWeights.m
View file @
82235c9d
function
regWeights
=
ctfRegWeights
(
sizeHolo
,
fresnelNumbers
,
lim1
,
lim2
,
gpuFlag
)
function
regWeights
=
ctfRegWeights
(
sizeHolo
,
fresnelNumbers
,
lim1
,
lim2
,
gpuFlag
,
lim3
)
% Computes a regularization weights in Fourier space, suitable for regularized inversion
% of the CTF and similar reconstruction methods. The main idea, originally proposed by
% Peter Cloetens, is to create a mask that smoothly transitions from one (typically low)
...
...
@@ -32,11 +32,27 @@ xi = cell([ndim,1]);
[
xi
{:}]
=
fftfreq
(
sizeHolo
,
1
);
XiSqDivFresnel
=
0
;
for
jj
=
1
:
ndim
XiSqDivFresnel
=
XiSqDivFresnel
+
gpuArrayIf
(
xi
{
jj
},
gpuFlag
)
.^
2
.
/
(
2
*
pi
^
2
*
fresnelNumbers
(
jj
));
xi
{
jj
}
=
gpuArrayIf
(
xi
{
jj
},
gpuFlag
);
XiSqDivFresnel
=
XiSqDivFresnel
+
xi
{
jj
}
.^
2
.
/
(
2
*
pi
^
2
*
fresnelNumbers
(
jj
));
end
sigma
=
(
sqrt
(
2
)
-
1
)
/
2
;
w
=
1
/
2
*
erfc
((
sqrt
(
XiSqDivFresnel
)
-
1
)
/
(
sqrt
(
2
)
*
sigma
));
regWeights
=
lim1
.*
w
+
lim2
.*
(
1
-
w
);
% Additional regularization level for spatial frequencies beyond the
% numerical aperture of the optical system. Only relevant for
% deeply holographic data
if
nargin
==
6
fresnelNumbersFOV
=
fresnelNumbers
(:)
.*
sizeHolo
(:)
.^
2
;
freqCutoffFOV
=
pi
.*
(
fresnelNumbersFOV
.
/
sizeHolo
(:));
wCutoffFOV
=
1
;
XiSqDivCutoffFOV
=
0
;
for
jj
=
1
:
ndim
XiSqDivCutoffFOV
=
XiSqDivCutoffFOV
+
(
xi
{
jj
}
.
/
freqCutoffFOV
(
jj
))
.^
2
;
wCutoffFOV
=
wCutoffFOV
.*
(
0.5
.*
erfc
((
abs
(
xi
{
jj
})
.
/
freqCutoffFOV
(
jj
)
-
1
)
.
/
0.1
));
end
regWeights
=
wCutoffFOV
.*
regWeights
+
(
1
-
wCutoffFOV
)
.*
lim3
;
end
end
Write
Preview
Markdown
is supported
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