Commit 47312c74 authored by Simon Maretzke's avatar Simon Maretzke
Browse files

Merge branch 'master' of gitlab.gwdg.de:irp/holotomotoolbox

parents 5c6e6b77 c518cb80
Pipeline #286583 passed with stage
in 53 seconds
# HoloTomoToolbox
## Documentation
See the [online-documentation](https://irp.pages.gwdg.de/holotomotoolbox/) and code examples in [examples/](examples/).
......@@ -40,6 +42,29 @@ cd docs/
make html
```
## How to cite ?
When using this toolbox in an academic work, please cite:
L. M. Lohse, A.-L. Robisch, M. Töpperwien, S. Maretzke, M. Krenkel, J. Hagemann, and T. Salditt, **A phase-retrieval toolbox for X-ray holography and tomography**,
Journal of Synchrotron Radiation **27**, 852-859 (2020). doi:https://doi.org/10.1107/S1600577520002398
```
@article{Lohse_2020,
doi = {10.1107/s1600577520002398},
year = 2020,
month = {apr},
publisher = {International Union of Crystallography ({IUCr})},
volume = {27},
number = {3},
pages = {852--859},
author = {Leon M. Lohse and Anna-Lena Robisch and Mareike Töpperwien and Simon Maretzke and Martin Krenkel and Johannes Hagemann and Tim Salditt},
title = {A phase-retrieval toolbox for X-ray holography and tomography},
journal = {Journal of Synchrotron Radiation}
}
```
## Contributing
[MATLAB Style Guidelines 2.0](http://www.datatool.com/downloads/MatlabStyle2%20book.pdf)
......@@ -109,8 +109,8 @@ html_logo = 'IRP_Logo.png'
html_static_path = ['_static']
def setup(app):
app.add_stylesheet('custom.css')
app.add_css_file('custom.css')
# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
......@@ -186,7 +186,6 @@ matlab_src_dir = os.path.abspath('../..')
primary_domain = 'mat'
highlight_language = 'matlab'
# -- Options for todo extension ----------------------------------------------
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True
# -- bibtex extension --------------------------------------------------------
bibtex_bibfiles = ['literature.bib',]
......@@ -5,26 +5,24 @@
@Article{Cloetens_APL_1999,
author = {P. Cloetens and W. Ludwig and J. Baruchel and D. Van Dyck and J. Van Landuyt and J. P. Guigay and M. Schlenker},
title = {Holotomography: Quantitative phase tomography with micrometer resolution using hard synchrotron radiation x rays},
title = {{Holotomography: Quantitative phase tomography with micrometer resolution using hard synchrotron radiation x rays}},
journal = {Applied Physics Letters},
year = {1999},
volume = {75},
number = {19},
pages = {2912--2914},
month = {nov},
doi = {10.1063/1.125225},
publisher = {{AIP} Publishing},
}
@Article{Zabler_RoSI_2005,
author = {S. Zabler and P. Cloetens and J.-P. Guigay and J. Baruchel and M. Schlenker},
title = {Optimization of phase contrast imaging using hard x rays},
title = {{Optimization of phase contrast imaging using hard x rays}},
journal = {Review of Scientific Instruments},
year = {2005},
volume = {76},
number = {7},
pages = {073705},
month = {jul},
doi = {10.1063/1.1960797},
eid = {073705},
publisher = {{AIP} Publishing},
......@@ -32,41 +30,63 @@
@Article{Turner_OE_2004,
author = {L. D. Turner and B. B. Dhal and J. P. Hayes and A. P. Mancuso and K. A. Nugent and D. Paterson and R. E. Scholten and C. Q. Tran and A. G. Peele},
title = {X-ray phase imaging: Demonstration of extended conditions with homogeneous objects},
title = {{X-ray phase imaging: Demonstration of extended conditions with homogeneous objects}},
journal = {Optics Express},
year = {2004},
volume = {12},
number = {13},
pages = {2960--2965},
month = {jun},
doi = {10.1364/opex.12.002960},
publisher = {The Optical Society},
}
@Article{Goldstein_SIAM_2014,
author = {T. Goldstein and B. O'Donoghue and S. Setzer and Richard Baraniuk},
title = {{Fast Alternating Direction Optimization Methods}},
journal = {SIAM J. Imaging Sci.},
year = {2014},
volume = {7},
number = {3},
pages = {1588-1623},
doi = {10.1137/120896219},
}
% 3D-CTF
@article{Ruhlandt_ActaA_2016,
title = {Three-dimensional propagation in near-field tomographic X-ray phase retrieval},
author = {Ruhlandt, Aike and Salditt, Tim},
journal = {Acta Crystallographica Section A: Foundations and Advances},
volume = {72},
number = {2},
pages = {215--221},
year = {2016},
publisher = {International Union of Crystallography}
}
% HoloTIE
@Article{Krenkel_OE_2013,
author = {M. Krenkel and M. Bartels and T. Salditt},
title = {Transport of intensity phase reconstruction to solve the twin image problem in holographic x-ray imaging},
title = {{Transport of intensity phase reconstruction to solve the twin image problem in holographic x-ray imaging}},
journal = {Optics Express},
year = {2013},
volume = {21},
number = {2},
pages = {2220--2235},
month = {jan},
doi = {10.1364/oe.21.002220},
publisher = {The Optical Society},
}
@Article{Krenkel_ACSA_2017,
author = {Martin Krenkel and Mareike Toepperwien and Frauke Alves and Tim Salditt},
title = {Three-dimensional single-cell imaging with X-ray waveguides in the holographic regime},
title = {{Three-dimensional single-cell imaging with X-ray waveguides in the holographic regime}},
journal = {Acta Crystallographica Section A Foundations and Advances},
year = {2017},
volume = {73},
number = {4},
pages = {282--292},
month = {jun},
doi = {10.1107/s2053273317007902},
publisher = {International Union of Crystallography ({IUCr})},
}
......@@ -74,27 +94,25 @@
% MBA
@Article{Groso_APL_2006,
author = {A. Groso and M. Stampanoni and R. Abela and P. Schneider and S. Linga and R. Müller},
title = {Phase contrast tomography: An alternative approach},
author = {A. Groso and M. Stampanoni and R. Abela and P. Schneider and S. Linga and R. M{\"u}ller},
title = {{Phase contrast tomography: An alternative approach}},
journal = {Applied Physics Letters},
year = {2006},
volume = {88},
number = {21},
pages = {214104},
month = {may},
doi = {10.1063/1.2207221},
publisher = {{AIP} Publishing},
}
@Article{Groso_OE_2006,
author = {A. Groso and R. Abela and M. Stampanoni},
title = {Implementation of a fast method for high resolution phase contrast tomography},
title = {{Implementation of a fast method for high resolution phase contrast tomography}},
journal = {Optics Express},
year = {2006},
volume = {14},
number = {18},
pages = {8103--8110},
month = sep,
doi = {10.1364/oe.14.008103},
publisher = {The Optical Society},
}
......@@ -103,13 +121,12 @@
@Article{Paganin_JoM_2002,
author = {D. Paganin and S. C. Mayo and T. E. Gureyev and P. R. Miller and S. W. Wilkins},
title = {Simultaneous phase and amplitude extraction from a single defocused image of a homogeneous object},
title = {{Simultaneous phase and amplitude extraction from a single defocused image of a homogeneous object}},
journal = {Journal of Microscopy},
year = {2002},
volume = {206},
number = {1},
pages = {33--40},
month = {apr},
doi = {10.1046/j.1365-2818.2002.01010.x},
language = {eng},
publisher = {Wiley},
......@@ -117,15 +134,14 @@
% BAC
@Article{Witte_JotOSoAAOaIS_2009,
@Article{Witte_JOSAA_2009,
author = {Yoni De Witte and Matthieu Boone and Jelle Vlassenbroeck and Manuel Dierick and Luc Van Hoorebeke},
title = {Bronnikov-aided correction for x-ray computed tomography},
title = {{Bronnikov-aided correction for x-ray computed tomography}},
journal = {Journal of the Optical Society of America A},
year = {2009},
volume = {26},
number = {4},
pages = {890--894},
month = {mar},
doi = {10.1364/josaa.26.000890},
publisher = {The Optical Society},
}
......@@ -135,26 +151,24 @@
@Article{Neumann_AM_1949,
author = {John Von Neumann},
title = {On Rings of Operators. Reduction Theory},
title = {{On Rings of Operators. Reduction Theory}},
journal = {The Annals of Mathematics},
year = {1949},
volume = {50},
number = {2},
pages = {401--485},
month = {apr},
doi = {10.2307/1969463},
publisher = {{JSTOR}},
}
@Article{Hagemann_APL_2018,
author = {J. Hagemann and M. Töpperwien and T. Salditt},
title = {Phase retrieval for near-field X-ray imaging beyond linearisation or compact support},
author = {J. Hagemann and M. T{\"o}pperwien and T. Salditt},
title = {{Phase retrieval for near-field X-ray imaging beyond linearisation or compact support}},
journal = {Applied Physics Letters},
year = {2018},
volume = {113},
number = {4},
pages = {041109},
month = {jul},
doi = {10.1063/1.5029927},
publisher = {{AIP} Publishing},
}
......@@ -169,24 +183,49 @@
volume = {21},
number = {1},
pages = {37--50},
month = {nov},
doi = {10.1088/0266-5611/21/1/004},
publisher = {{IOP} Publishing},
}
% IRP
@Article{Ruhlandt_Phys.Rev.A_2014,
author = {Ruhlandt, A. and Krenkel, M. and Bartels, M. and Salditt, T.},
title = {{Three-dimensional phase retrieval in propagation-based phase-contrast imaging}},
journal = {Phys. Rev. A},
year = {2014},
volume = {89},
issue = {3},
pages = {033847},
doi = {10.1103/PhysRevA.89.033847},
}
% mHIO
@article{Giewekemeyer_PRA_2011,
title={X-ray propagation microscopy of biological cells using waveguides as a quasipoint source},
author={Giewekemeyer, K and Kr{\"u}ger, SP and Kalbfleisch, S and Bartels, M and Beta, Carsten and Salditt, T},
journal={Physical Review A},
volume={83},
number={2},
pages={023804},
year={2011},
publisher={APS}
}
%%%%%%%%%%%%%%%%% Tomography %%%%%%%%%%%%%%%%%%%
% ASTRA toolbox
@Article{Aarle_OE_2016,
author = {Wim van Aarle and Willem Jan Palenstijn and Jeroen Cant and Eline Janssens and Folkert Bleichrodt and Andrei Dabravolski and Jan De Beenhouwer and K. Joost Batenburg and Jan Sijbers},
title = {Fast and flexible X-ray tomography using the {ASTRA} toolbox},
title = {{Fast and flexible X-ray tomography using the ASTRA toolbox}},
journal = {Optics Express},
year = {2016},
volume = {24},
number = {22},
pages = {25129--25147},
month = {oct},
doi = {10.1364/oe.24.025129},
publisher = {The Optical Society},
}
......@@ -198,7 +237,6 @@
year = {2015},
volume = {157},
pages = {35--47},
month = {oct},
doi = {10.1016/j.ultramic.2015.05.002},
publisher = {Elsevier {BV}},
}
......@@ -211,18 +249,10 @@
volume = {176},
number = {2},
pages = {250--253},
month = {nov},
doi = {10.1016/j.jsb.2011.07.017},
publisher = {Elsevier {BV}},
}
@InProceedings{Palenstijn_2013,
author = {Palenstijn, Willem Jan and Batenburg, K Joost and Sijbers, Jan},
title = {The ASTRA tomography toolbox},
booktitle = {13th International Conference on Computational and Mathematical Methods in Science and Engineering. CMMSE},
year = {2013},
}
% Ring removal
@Article{Ketcham_PS_2006,
......@@ -232,7 +262,6 @@
year = {2006},
volume = {6318},
pages = {63180O-63180O-7},
month = {aug},
booktitle = {Developments in X-Ray Tomography V},
doi = {10.1117/12.680939},
editor = {Ulrich Bonse},
......@@ -240,34 +269,38 @@
}
@Article{Muench_OE_2009,
author = {Beat Münch and Pavel Trtik and Federica Marone and Marco Stampanoni},
title = {Stripe and ring artifact removal with combined wavelet-Fourier filtering},
author = {Beat M{\"u}nch and Pavel Trtik and Federica Marone and Marco Stampanoni},
title = {{Stripe and ring artifact removal with combined wavelet-Fourier filtering}},
journal = {Optics Express},
year = {2009},
volume = {17},
number = {10},
pages = {8567--8591},
month = {may},
doi = {10.1364/oe.17.008567},
publisher = {The Optical Society},
}
%%%%%%%%%%%%%%%%% Contributions %%%%%%%%%%%%%%%%%%%
% dftregistration
%%%%%%%%%%%%%%%%% Image Processing %%%%%%%%%%%%%%%%%
@Article{Heel_JSB_2005,
author = {Marin van Heel and Michael Schatz},
title = {Fourier shell correlation threshold criteria},
journal = {J. Struct. Biol.},
year = {2005},
volume = {151},
number = {3},
pages = {250--262},
doi = {10.1016/j.jsb.2005.05.009},
}
@Article{Guizar-Sicairos_OL_2008,
author = {Manuel Guizar-Sicairos and Samuel T. Thurman and James R. Fienup},
title = {Efficient subpixel image registration algorithms},
journal = {Optics Letters},
year = {2008},
volume = {33},
number = {2},
pages = {156--158},
month = {jan},
doi = {10.1364/ol.33.000156},
publisher = {The Optical Society},
%%%%%%%%%%%%%%%%% Abschlussarbeiten %%%%%%%%%%%%%%%%
@PhdThesis{Ruhlandt_Diss_2017,
author = {Ruhlandt, Aike},
title = {{Time-resolved X-ray phase-contrast tomography}},
year = {2017},
school = {Universit\"at G\"ottingen},
}
%%%%%%%%%%%%%%%%% Contributions %%%%%%%%%%%%%%%%%%%
@Article{Voelz_AO_2009,
author = {David G. Voelz and Michael C. Roggemann},
......@@ -277,26 +310,16 @@
volume = {48},
number = {32},
pages = {6132},
month = {nov},
doi = {10.1364/ao.48.006132},
owner = {llohse},
publisher = {The Optical Society},
timestamp = {2019.05.16},
}
@Article{Guersoy_JoSR_2014,
author = {Dog{\textasciicaron}a Gürsoy and Francesco De Carlo and Xianghui Xiao and Chris Jacobsen},
title = {{TomoPy}: a framework for the analysis of synchrotron~tomographic data},
journal = {Journal of Synchrotron Radiation},
year = {2014},
volume = {21},
number = {5},
pages = {1188--1193},
month = {aug},
doi = {10.1107/s1600577514013939},
owner = {llohse},
publisher = {International Union of Crystallography ({IUCr})},
timestamp = {2019.05.16},
@book{Teich_1991_Photonics,
author = {Teich, Malvin Carl and Saleh, Bea},
title = {Fundamentals of photonics},
publisher = {John Wiley \& Sons},
year = {1991}
}
@Comment{jabref-meta: databaseType:bibtex;}
List of referenced articles
---------------------------
.. bibliography:: ../../literature.bib
.. bibliography::
:style: plain
%%
p.data_size = [2048 2048];
p.roiSize = [1700 1700]*1;
p.recSize = [2048 2048]*2;
p.positions = [519 521]-133; %mm slider positions, - sliderpos1 + defocus distance
% 4070 = 509 mm distance to goldi, 133 focal length
p.num_distances = 1;
% p.num_images = 1720;
p.z02 = 19.661e9;
p.lambda = 1.2398/11; %nm
p.det_pixel = 6500;
p.xcorr(1:4) = 51;
p.scale_fac = 1;
p = calc_Fresnel_geometry(p);
p.M./p.M(1)
p.xcorr
%%
p.fadeSet = fadeoutImage();
p.fadeSet.method = 'rectangle';
p.fadeSet.ellipseSize = [0.49 0.49];
p.fadeSet.windowShift = [0 0];
p.fadeSet.transitionLength = 20;
p.fadeSet.numSegments = 100;
% p.fadeSet.fadeToVal = 1;
%%
if(do_refractive) %refractive settings
%% magnitude
p.PMset = PFresnelMagnitude.defaultSettings();
p.PMset.projectionOrder = 'averagedRefractive';
% p.PMset.projectionOrder = 'cyclicRefractive';
% PMset.projectionOrder = 'sequential';
% tmp = true(p.data_size);
% tmp = padToSize(tmp, p.recSize, 0);
% p.PMset.applicationMask = repmat(tmp, [1 1 1]);
p.PMset.useGPU = 1;
p.PMset.singlePrecision = true;
p.PMset.representation = 'refractive';
p.PMset.doMErrors = 1;
p.PMset.plotIterates = 0;
p.PMset.plotInterval = 100;
%% refractive
p.refractiveSet = PRefractive.defaultSettings();
p.refractiveSet.ImagNegativeScaleFactor = 0;
p.refractiveSet.deltaOverBeta = [];
p.refractiveSet.minReal = -100;
p.refractiveSet.maxReal = 0;
p.refractiveSet.minImag = -0;
p.refractiveSet.maxImag = 1e-3;
p.refractiveSet.fwhmImag = 2;
p.refractiveSet.fwhmReal = 2;
p.refractiveSet.periodicBoundaries = 0;
p.refractiveSet.roiSize = p.roiSize*1.1;
p.refractiveSet.recSize = p.recSize;
%% support adaption
p.suppAdaptSet = PSupportAdaption.defaultSettings();
p.suppAdaptSet.doRefractive = 1;
p.suppAdaptSet.plotIterates = 1;
p.suppAdaptSet.plotInterval = 10;
p.suppAdaptSet.valueOutsideSupp = 0;
% p.suppAdaptSet.supportThreshold = 0.06;
p.suppAdaptSet.supportThreshold = 0.04;
p.suppAdaptSet.firstAdaption = 10;
p.suppAdaptSet.dilateValue = 5;
p.suppAdaptSet.erodeValue = 5;
% p.suppAdaptSet.
%% algorithm options
p.algSet = projectionAlgorithm.defaultSettings();
p.algSet.doRefractive = true;
p.algSet.doMErrors = 0;
p.algSet.roiSize = p.roiSize;
p.algSet.doConvergenceHistory = 1;
p.algSet.iterations = 2000;
p.algSet.useGPU = 1;
p.algSet.plotIterates = 1;
p.algSet.addMomentum = 0;
p.algSet.plotInterval = 100;
p.algSet.algorithm = 'NAG';%%
p.algSet.abortThreshold = -7.0;
p.algSet.eta = 1;
p.algSet.gamma = 1;
p.algSet.accelerationFrequency = 1;
end
%% amp/pha settings
if(~do_refractive)
%% magnitude
p.PMset = PFresnelMagnitude.defaultSettings();
p.PMset.projectionOrder = 'averaged';
p.PMset.useGPU = 1;
p.PMset.singlePrecision = true;
p.PMset.doMErrors = 1;
p.PMset.plotIterates = 0;
p.PMset.plotInterval = 10;
%% constraints
p.conSet = PConstraints.defaultSettings();
p.conSet.upperAmplitude = 1.0101;
p.conSet.lowerAmplitude = 0.553;
p.conSet.smoothAmplitudesBy = 0;
p.conSet.smoothPhasesBy = 0;
p.conSet.projectOnNegativity = 0;
p.conSet.unwrapPhases = 0;
%% support adaption
p.suppAdaptSet = PSupportAdaption.defaultSettings();
p.suppAdaptSet.plotIterates = 1;
p.suppAdaptSet.plotInterval = 50;
p.suppAdaptSet.valueOutsideSupp = 1;
p.suppAdaptSet.supportThreshold = 0.01;
p.suppAdaptSet.firstAdaption = 50;
p.suppAdaptSet.dilateValue = 5;
p.suppAdaptSet.erodeValue = 5;
%% algorithm options
p.algSet = projectionAlgorithm.defaultSettings();
p.algSet.doMErrors = 0;
p.algSet.roiSize = p.roiSize;
p.algSet.doConvergenceHistory = 1;
p.algSet.iterations = 2000;
p.algSet.useGPU = 1;
p.algSet.plotIterates = 1;
p.algSet.addMomentum = 1;
p.algSet.plotInterval = 100;
p.algSet.algorithm = 'NAG';%%
p.algSet.abortThreshold = -10.0;
p.algSet.eta = 1.1;
p.algSet.gamma = 0.9;
p.algSet.accelerationStartAt = 2;
p.algSet.accelerationFrequency = 1;
end
\ No newline at end of file
% this function calculates the common parameters to calculate the Fresnel
% transformation for a multi distance propagation data set.
% Author: JH 58408 mJD
function p = calc_Fresnel_geometry(p)
if ~isfield(p, 'num_distances')
p.num_distances = numel(p.positions);
end
if ~isfield(p, 'scale_fac')
p.scale_fac = 1;
end
% initialize cell arrays
p.M = zeros(1, p.num_distances);
p.F_calc = zeros(1, p.num_distances);
p.z01 = zeros(1, p.num_distances);
p.z12 = zeros(1, p.num_distances);
p.z_eff = zeros(1, p.num_distances);
p.dxeff = zeros(1, p.num_distances);
if(~isfield(p, 'xcorr'))
p.xcorr = zeros(p.num_distances, 1);
end
% calculate parameters for each distance
for k=1:p.num_distances
p.z01(1, k) = (p.positions(1, k) + p.xcorr(1, k))*1e6;
p.z12(1, k) = p.z02-p.z01(1, k);
p.M(1, k) = p.z02/p.z01(1, k);
p.z_eff(1, k) = p.z12(1, k)/p.M(1, k);
p.dxeff(1, k) = (p.det_pixel* 1/p.scale_fac)/p.M(1, k);
p.F_calc(1, k)= p.dxeff(1, k).^2/(p.z_eff(1, k)*p.lambda);
end
p.F_rescaled = p.F_calc .* (p.M ./ max(p.M)).^2;
end
\ No newline at end of file
% wrapper function to evaluate phaseunwrapper.
% TO DO: add syntax for single argument function call
function [unwrap] = eval_unwrap(p_psi, a_psi, seed)
% p_psi = gather(angle(psi));
% a_psi = gather(abs(psi));