diff --git a/reader/HDF5MetadataSource.cpp b/reader/HDF5MetadataSource.cpp index bde7cd52..2109d685 100644 --- a/reader/HDF5MetadataSource.cpp +++ b/reader/HDF5MetadataSource.cpp @@ -647,6 +647,12 @@ HDF5MetadataSource::OpenResult HDF5MetadataSource::Open(const std::string &filen DetectorSetup detector = DetDECTRIS(image_size_x, image_size_y, detector_name, {}); detector.PixelSize_um(master_file->GetFloat("/entry/instrument/detector/x_pixel_size") * 1e6); + // Sensor thickness/material drive the parallax/absorption model, so take them from the file + // rather than the DetectorSetup default (NXmx stores thickness in metres). + if (master_file->Exists("/entry/instrument/detector/sensor_thickness")) + detector.SensorThickness_um(master_file->GetFloat("/entry/instrument/detector/sensor_thickness") * 1e6); + if (master_file->Exists("/entry/instrument/detector/sensor_material")) + detector.SensorMaterial(master_file->GetString("/entry/instrument/detector/sensor_material")); detector.SaturationLimit(master_file->GetInt("/entry/instrument/detector/saturation_value")); detector.MinFrameTime(std::chrono::microseconds(0)); detector.MinCountTime(std::chrono::microseconds(0));