v1.0.0-rc.40
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
#include "HDF5DataFilePluginROI.h"
|
||||
#include "../include/spdlog/fmt/fmt.h"
|
||||
#include "HDF5NXmx.h"
|
||||
#include "HDF5DataFilePluginImageStats.h"
|
||||
|
||||
HDF5DataFile::HDF5DataFile(const StartMessage &msg, uint64_t in_file_number) {
|
||||
file_number = in_file_number;
|
||||
@@ -34,6 +35,7 @@ HDF5DataFile::HDF5DataFile(const StartMessage &msg, uint64_t in_file_number) {
|
||||
plugins.emplace_back(std::make_unique<HDF5DataFilePluginAzInt>(msg.az_int_bin_to_q));
|
||||
plugins.emplace_back(std::make_unique<HDF5DataFilePluginXFEL>());
|
||||
plugins.emplace_back(std::make_unique<HDF5DataFilePluginMX>(msg.max_spot_count));
|
||||
plugins.emplace_back(std::make_unique<HDF5DataFilePluginImageStats>());
|
||||
}
|
||||
|
||||
std::optional<HDF5DataFileStatistics> HDF5DataFile::Close() {
|
||||
@@ -81,18 +83,28 @@ HDF5DataFile::~HDF5DataFile() {
|
||||
|
||||
void HDF5DataFile::CreateFile(const DataMessage& msg) {
|
||||
HDF5Dcpl dcpl;
|
||||
HDF5DataType data_type(msg.image.pixel_depth_bytes, msg.image.pixel_is_signed);
|
||||
|
||||
xpixel = msg.image.xpixel;
|
||||
ypixel = msg.image.ypixel;
|
||||
bool pixel_signed;
|
||||
|
||||
dcpl.SetCompression(msg.image.algorithm, JFJochBitShuffleCompressor::DefaultBlockSize);
|
||||
HDF5DataType data_type(msg.image.GetMode());
|
||||
|
||||
xpixel = msg.image.GetWidth();
|
||||
ypixel = msg.image.GetHeight();
|
||||
|
||||
dcpl.SetCompression(msg.image.GetCompressionAlgorithm(), JFJochBitShuffleCompressor::DefaultBlockSize);
|
||||
dcpl.SetChunking( {1, ypixel, xpixel});
|
||||
if (msg.image.pixel_is_signed) {
|
||||
if (msg.image.pixel_depth_bytes == 2)
|
||||
switch (msg.image.GetMode()) {
|
||||
case CompressedImageMode::Int8:
|
||||
dcpl.SetFillValue8(INT8_MIN);
|
||||
break;
|
||||
case CompressedImageMode::Int16:
|
||||
dcpl.SetFillValue16(INT16_MIN);
|
||||
else
|
||||
break;
|
||||
case CompressedImageMode::Int32:
|
||||
dcpl.SetFillValue32(INT32_MIN);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
data_file = std::make_unique<HDF5File>(tmp_filename);
|
||||
@@ -126,7 +138,7 @@ void HDF5DataFile::Write(const DataMessage &msg, uint64_t image_number) {
|
||||
}
|
||||
|
||||
nimages++;
|
||||
data_set->WriteDirectChunk(msg.image.data, msg.image.size, {image_number, 0, 0});
|
||||
data_set->WriteDirectChunk(msg.image.GetCompressed(), msg.image.GetCompressedSize(), {image_number, 0, 0});
|
||||
|
||||
for (auto &p: plugins)
|
||||
p->Write(msg, image_number);
|
||||
|
||||
Reference in New Issue
Block a user