Skip to content

Logpolar full pipeline test #595

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 44 commits into from
Jun 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
718757d
corrections to bigdata tests
dkazanc May 6, 2025
ec8fba7
corrections2
dkazanc May 6, 2025
31b0697
corrections3
dkazanc May 6, 2025
c9b7145
corrections4
dkazanc May 6, 2025
2239795
corrections5
dkazanc May 6, 2025
ba2f5b2
increasing tolerance fpr denoising
dkazanc May 7, 2025
be39225
Merge branch 'main' into testsbig
dkazanc May 12, 2025
d42c0bb
fixing the denoising test
dkazanc May 14, 2025
9001186
change1
dkazanc May 15, 2025
0b0cbcf
renaming directive changes
dkazanc May 15, 2025
fcc2515
tests bug update1
dkazanc May 19, 2025
5349e9f
tests bug update2
dkazanc May 19, 2025
e2fe12a
tests bug update3
dkazanc May 19, 2025
013d075
tests big update3
dkazanc May 19, 2025
73564d4
tests big update4
dkazanc May 19, 2025
d726a15
tests big update5
dkazanc May 19, 2025
d904f2f
tests big update6
dkazanc May 19, 2025
1dd46ae
docuemntation updates
dkazanc May 19, 2025
ea64185
tests big update7
dkazanc May 19, 2025
0b1a40a
tests big update8
dkazanc May 19, 2025
01d02fc
tests big update9
dkazanc May 19, 2025
577b3d0
tests big update10
dkazanc May 19, 2025
28dd47b
tests big update11
dkazanc May 20, 2025
5af73d1
Merge branch 'main' into testsbig
dkazanc May 20, 2025
690a4aa
Merge branch 'main' into testsbig
dkazanc May 20, 2025
1de1ee6
fixing small data tests
dkazanc May 20, 2025
5d1d89b
fixing ui_layer tests triggered by the conftest changes
dkazanc May 20, 2025
6e67013
adding logpolar test
dkazanc May 22, 2025
2ffa761
Update docs/source/pipelines/yaml.rst
dkazanc May 27, 2025
516fcf4
remove unused fixture in conftest
dkazanc May 28, 2025
a3cd7cb
logpolar pipeline test added
dkazanc May 29, 2025
e683726
Merge branch 'main' into logpolar_bigtests
dkazanc May 29, 2025
1543ae6
Merge branch 'main' into logpolar_bigtests
dkazanc Jun 12, 2025
74b21c0
debug saving
dkazanc Jun 13, 2025
0c0617a
remove debugging
dkazanc Jun 13, 2025
8061b48
testfix
dkazanc Jun 13, 2025
66681ca
testfix2
dkazanc Jun 13, 2025
04d7173
some tests corrections
dkazanc Jun 13, 2025
d6febeb
conftest fix
dkazanc Jun 13, 2025
00289ba
conftest fix2
dkazanc Jun 13, 2025
3d4c0ad
Merge branch 'main' into logpolar_bigtests
dkazanc Jun 30, 2025
f4158df
tests fixing1
dkazanc Jun 30, 2025
7665ad1
tests fixing2
dkazanc Jun 30, 2025
c3b82ea
applying fortmatting
dkazanc Jun 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,11 @@ def FBP3d_tomobar():
return "docs/source/pipelines_full/FBP3d_tomobar.yaml"


@pytest.fixture
def LPRec3d_tomobar():
return "docs/source/pipelines_full/LPRec3d_tomobar.yaml"


@pytest.fixture
def FBP2d_astra():
return "docs/source/pipelines_full/FBP2d_astra.yaml"
Expand Down Expand Up @@ -310,6 +315,12 @@ def FBP3d_tomobar_distortion_i13_179623_npz():
)


@pytest.fixture
def LPRec3d_tomobar_i12_119647_npz():
# 10 slices numpy array
return np.load("tests/test_data/raw_data/i12/LPRec3d_tomobar_i12_119647.npz")


@pytest.fixture
def pipeline_sweep_FBP3d_tomobar_i13_177906_tiffs():
# several tiff files
Expand Down
67 changes: 67 additions & 0 deletions tests/test_pipeline_big.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,73 @@ def test_pipe_FBP3d_tomobar_i12_119647_preview(
# ########################################################################


@pytest.mark.full_data
def test_pipe_LPRec3d_tomobar_i12_119647_preview(
get_files: Callable,
cmd,
i12_119647,
LPRec3d_tomobar,
LPRec3d_tomobar_i12_119647_npz,
output_folder,
):

change_value_parameters_method_pipeline(
LPRec3d_tomobar,
method=[
"standard_tomo",
],
key=[
"preview",
],
value=[
{"detector_y": {"start": 900, "stop": 1200}},
],
)

cmd.pop(4) #: don't save all
cmd.insert(5, i12_119647)
cmd.insert(7, LPRec3d_tomobar)
cmd.insert(8, output_folder)

subprocess.check_output(cmd)

files = get_files(output_folder)

#: check the generated reconstruction (hdf5 file)
h5_files = list(filter(lambda x: ".h5" in x, files))
assert len(h5_files) == 1

# load the pre-saved numpy array for comparison bellow
data_gt = LPRec3d_tomobar_i12_119647_npz["data"]
axis_slice = LPRec3d_tomobar_i12_119647_npz["axis_slice"]
(slices, sizeX, sizeY) = np.shape(data_gt)

step = axis_slice // (slices + 2)
# store for the result
data_result = np.zeros((slices, sizeX, sizeY), dtype=np.float32)

path_to_data = "data/"
h5_file_name = "LPRec3d_tomobar"
for file_to_open in h5_files:
if h5_file_name in file_to_open:
h5f = h5py.File(file_to_open, "r")
index_prog = step
for i in range(slices):
data_result[i, :, :] = h5f[path_to_data][:, index_prog, :]
index_prog += step
h5f.close()
else:
message_str = f"File name with {h5_file_name} string cannot be found."
raise FileNotFoundError(message_str)

residual_im = data_gt - data_result
res_norm = np.linalg.norm(residual_im.flatten()).astype("float32")
assert res_norm < 0.02


# ########################################################################


@pytest.mark.full_data
def test_pipe_FBP2d_astra_i12_119647_preview(
get_files: Callable,
Expand Down