Skip to content

Commit

Permalink
slight lint
Browse files Browse the repository at this point in the history
  • Loading branch information
casperdcl committed Sep 11, 2024
1 parent 585f580 commit 4bda727
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion SIRF_data_preparation/Mediso_NEMA_IQ/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ cd Mediso_NEMA_IQ/
# trim sinograms to avoid "corner" problems in mult_factors
# TODO for next data: use 30 (as some problems remain)
for f in additive_term.hs mult_factors.hs prompts.hs; do
SSRB -t 20 $f $orgpath/sinograms/$f;
SSRB -t 20 $f $orgpath/sinograms/$f
done
# alternative if we don't need to trim
#cp -rp $orgpath/sinograms/* .
Expand Down
5 changes: 3 additions & 2 deletions SIRF_data_preparation/Mediso_NEMA_IQ/prepare.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Set NaNs to zero in additive_term
import sirf.STIR
import numpy as np

import sirf.STIR

additive = sirf.STIR.AcquisitionData('additive_term.hs')
add_arr = additive.as_array()
add_arr = np.nan_to_num(add_arr)
new_add = additive.clone()
new_add.fill(add_arr)
new_add.write('additive_term.hs')

4 changes: 2 additions & 2 deletions SIRF_data_preparation/plot_BSREM_metrics.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#%%
# %%
# """Preliminary file to check evolution of metrics as well as pass_index"""
# %load_ext autoreload
# %autoreload 2
Expand Down Expand Up @@ -71,7 +71,7 @@
reference_image = STIR.ImageData(str(datadir / 'iter_final.hv'))
qm = QualityMetrics(reference_image, data.whole_object_mask, data.background_mask, tb_summary_writer=None,
voi_mask_dict=data.voi_masks)
#%% get update ("iteration") numbers from objective functions
# %% get update ("iteration") numbers from objective functions
last_iteration = int(objs[-1, 0] + .5)
# find interval(don't use last value, as that interval can be smaller)
iteration_interval = int(objs[-2, 0] - objs[-3, 0] + .5)
Expand Down
3 changes: 2 additions & 1 deletion petric.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ def keys(self):

class MetricsWithTimeout(cil_callbacks.Callback):
"""Stops the algorithm after `seconds`"""
def __init__(self, seconds=600, outdir=OUTDIR, transverse_slice=None, coronal_slice=None, sagittal_slice=None, **kwargs):
def __init__(self, seconds=600, outdir=OUTDIR, transverse_slice=None, coronal_slice=None, sagittal_slice=None,
**kwargs):
super().__init__(**kwargs)
self._seconds = seconds
self.callbacks = [
Expand Down

0 comments on commit 4bda727

Please sign in to comment.