Commit e9e49a98 authored by payno's avatar payno
Browse files

[hdf5converter] check dataset.name to filter detector named XXX_sino

parent 66b9359c
Pipeline #44149 passed with stages
in 4 minutes and 16 seconds
......@@ -120,7 +120,7 @@ def get_nx_detectors(node: h5py.Group) -> tuple:
if isinstance(subnode, h5py.Group) and "NX_class" in subnode.attrs:
if subnode.attrs["NX_class"] == "NXdetector":
if "data" in subnode and hasattr(subnode["data"], "ndim"):
if subnode["data"].ndim == 3:
if subnode["data"].ndim == 3 and not subnode.name.endswith("_sino"):
nx_detectors.append(subnode)
nx_detectors = sorted(nx_detectors, key=lambda det: det.name)
return tuple(nx_detectors)
......@@ -137,7 +137,11 @@ def guess_nx_detector(node: h5py.Group) -> tuple:
nx_detectors = []
for _, subnode in node.items():
if isinstance(subnode, h5py.Group) and "data" in subnode:
if isinstance(subnode["data"], h5py.Dataset) and subnode["data"].ndim == 3:
if (
isinstance(subnode["data"], h5py.Dataset)
and subnode["data"].ndim == 3
and not subnode.name.endswith("_sino")
):
nx_detectors.append(subnode)
nx_detectors = sorted(nx_detectors, key=lambda det: det.name)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment