From f7399c0285b4bdc35bd65985066520bc61f61dab Mon Sep 17 00:00:00 2001 From: Jonathan Wright Date: Tue, 15 Oct 2024 17:15:16 +0200 Subject: [PATCH 1/2] allow user to select the filter --- ImageD11/sinograms/roi_iradon.py | 11 ++++++++--- ImageD11/sinograms/sinogram.py | 5 ++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ImageD11/sinograms/roi_iradon.py b/ImageD11/sinograms/roi_iradon.py index 28f765b4..98e9cc8f 100644 --- a/ImageD11/sinograms/roi_iradon.py +++ b/ImageD11/sinograms/roi_iradon.py @@ -526,8 +526,13 @@ def correct_recon_central_zingers(recon, radius=25): def run_iradon(sino, angles, pad=20, shift=0, - workers=1, mask=None, - apply_halfmask=False, mask_central_zingers=False, central_mask_radius=25): + workers=1, + mask=None, + apply_halfmask=False, + mask_central_zingers=False, + central_mask_radius=25, + filter_name='hamming', + ): """Applies an iradon to a sinogram, with an optional pad Calculates scaled-up output size from pad value Applies projection shifts of shift @@ -550,7 +555,7 @@ def run_iradon(sino, angles, pad=20, shift=0, mask=mask, output_size=outsize, projection_shifts=np.full(sino.shape, shift), - filter_name='hamming', + filter_name=filter_name, interpolation='linear', workers=workers) diff --git a/ImageD11/sinograms/sinogram.py b/ImageD11/sinograms/sinogram.py index 77ed6d2b..d43f16d2 100644 --- a/ImageD11/sinograms/sinogram.py +++ b/ImageD11/sinograms/sinogram.py @@ -252,7 +252,10 @@ def recon(self, iradon -> ImageD11.sinograms.roi_iradon.run_iradon { pad=20, shift=0, workers=1, mask=None, - apply_halfmask=False, mask_central_zingers=False, central_mask_radius=25 } + apply_halfmask=False, + mask_central_zingers=False, + central_mask_radius=25, + filter_name='hamming'} mlem : ImageD11.sinograms.roi_iradon.run_mlem { mask=None, pad=20, shift=0, workers=1, niter=20, apply_halfmask=False, mask_central_zingers=False, central_mask_radius=25 } From 9b0669b0216a872e40ed0aa12196a606a9b800e7 Mon Sep 17 00:00:00 2001 From: Jonathan Wright Date: Tue, 15 Oct 2024 17:15:36 +0200 Subject: [PATCH 2/2] bugfix --- ImageD11/sinograms/dataset.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ImageD11/sinograms/dataset.py b/ImageD11/sinograms/dataset.py index 6f8fc3c0..9852a09d 100644 --- a/ImageD11/sinograms/dataset.py +++ b/ImageD11/sinograms/dataset.py @@ -523,7 +523,7 @@ def get_monitor(self, name="fpico6"): lo, hi = [int(v) for v in slc[1:-1].split(":")] mon = hin[snum]["measurement"][name][lo:hi] else: - mon = hin[snum]["measurement"][name][:] + mon = hin[scan]["measurement"][name][:] monitor.append(mon) self.monitor = np.concatenate(monitor).reshape(self.shape) return self.monitor