Remove libtiff dependency + update README.md
This commit is contained in:
@@ -26,15 +26,15 @@ Instructions see [here](receiver/README.md)
|
||||
## Software
|
||||
|
||||
### Dependencies
|
||||
1. C++17 compiler and C++17 standard library (NOT provided by default RHEL 7 installation, need to install Developer Tools, tested with `devtools-11`)
|
||||
1. C++20 compiler and C++20 standard library (NOT provided by default RHEL 7 installation, need to install Developer Tools, tested with `devtools-11`)
|
||||
2. CMake version 3.21 or newer + GNU make tool
|
||||
3. HDF5 library version 1.10 or newer
|
||||
4. ZeroMQ library
|
||||
5. Google Remote Procedure Call (gRPC) - see notes below
|
||||
6. CUDA compiler version 11 or newer (spot finding, indexing, and radial integration)
|
||||
7. TIFF library with C++ bindings
|
||||
8. Mellanox OFED - Infinibands Verbs (optional)
|
||||
9. NUMA library (optional)
|
||||
7. Mellanox OFED - Infinibands Verbs (optional)
|
||||
8. NUMA library (optional)
|
||||
9. Node.js (optional) - to make frontend
|
||||
|
||||
Additional dependencies: SLS Detector Package, tinycbor (Intel) and Zstandard (Facebook) are provided as GIT submodules.
|
||||
|
||||
@@ -65,7 +65,7 @@ To compile gRPC:
|
||||
```
|
||||
git clone https://github.com/grpc/grpc
|
||||
cd grpc
|
||||
git checkout v1.41.1
|
||||
git checkout v1.53.0
|
||||
git submodule update --init
|
||||
mkdir build
|
||||
cd build
|
||||
@@ -84,7 +84,7 @@ export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/opt/grpc/lib/pkgconfig:/opt/grpc/lib64/
|
||||
Use the following commands (use `cmake` instead of `cmake3` in non-RHEL systems):
|
||||
|
||||
```
|
||||
git submodule update --init
|
||||
git submodule update --init --recursive
|
||||
mkdir build
|
||||
cd build
|
||||
cmake3 ..
|
||||
@@ -103,22 +103,13 @@ Automated test routine is then accessible as `tests/CatchTest`. There are also b
|
||||
|
||||
In addition, tests are executed to verify that datasets written by Jungfraujoch are readable with XDS Durin plugin and CrystFEL. Input files for these programs are placed in `xds_durin` and `crystfel` folders. See `.gitlab-ci.yml` for details.
|
||||
|
||||
## Building web user interface
|
||||
### Dependencies
|
||||
For web user interface:
|
||||
1. Node.js
|
||||
2. Web server, e.g. Apache httpd
|
||||
3. Web grpc
|
||||
## Web user interface
|
||||
|
||||
### Building
|
||||
To build web interface:
|
||||
```
|
||||
cd frontend_ui
|
||||
npm install
|
||||
npm build
|
||||
```
|
||||
|
||||
To install on RHEL 7 and Apache:
|
||||
```
|
||||
cd build
|
||||
sudo cp -r * /var/www/html/
|
||||
```
|
||||
|
||||
@@ -44,7 +44,6 @@ ADD_LIBRARY( CommonFunctions STATIC
|
||||
TestImagePusher.cpp TestImagePusher.h
|
||||
SpotToSave.h
|
||||
NetworkAddressConvert.h NetworkAddressConvert.cpp
|
||||
WriteTIFF.cpp WriteTIFF.h
|
||||
grpcToJson.h jsonToGrpc.h to_fixed.h
|
||||
GPUImageAnalysis.h GPUImageAnalysis.cu
|
||||
DiffractionExperiment.h DiffractionGeometry.cpp)
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
// Copyright (2019-2022) Paul Scherrer Institute
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#include "WriteTIFF.h"
|
||||
#include "JFJochException.h"
|
||||
|
||||
#include <tiffio.h>
|
||||
#include <tiffio.hxx>
|
||||
#include <sstream>
|
||||
|
||||
void WriteTIFF(TIFF *tiff, void *buff, size_t cols, size_t lines, size_t elem_size, bool is_signed) {
|
||||
if (tiff == nullptr)
|
||||
throw JFJochException(JFJochExceptionCategory::TIFFGeneratorError, "TIFFStreamOpen error");
|
||||
|
||||
TIFFSetField(tiff, TIFFTAG_IMAGEWIDTH, cols); // set the width of the image
|
||||
TIFFSetField(tiff, TIFFTAG_IMAGELENGTH, lines); // set the height of the image
|
||||
TIFFSetField(tiff, TIFFTAG_SAMPLESPERPIXEL, 1); // set number of channels per pixel
|
||||
TIFFSetField(tiff, TIFFTAG_BITSPERSAMPLE, elem_size * 8); // set the size of the channels
|
||||
TIFFSetField(tiff, TIFFTAG_COMPRESSION, COMPRESSION_LZW); // setc ompression to LZW
|
||||
TIFFSetField(tiff, TIFFTAG_ROWSPERSTRIP, lines);
|
||||
if (is_signed)
|
||||
TIFFSetField(tiff, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_INT);
|
||||
else
|
||||
TIFFSetField(tiff, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_UINT);
|
||||
|
||||
if (TIFFWriteEncodedStrip(tiff, 0, buff,cols * lines * elem_size) < 0)
|
||||
throw JFJochException(JFJochExceptionCategory::TIFFGeneratorError, "TIFFWriteEncodedStrip error");
|
||||
|
||||
}
|
||||
|
||||
std::string WriteTIFFToString(void *buff, size_t cols, size_t lines, size_t elem_size, bool is_signed) {
|
||||
std::stringstream os;
|
||||
|
||||
TIFF *tiff = TIFFStreamOpen("x", (std::ostream *) &os);
|
||||
WriteTIFF(tiff, buff, cols, lines, elem_size, is_signed);
|
||||
TIFFClose(tiff);
|
||||
|
||||
return os.str();
|
||||
}
|
||||
|
||||
void WriteTIFFToFile(const std::string &filename, void *buff, size_t cols, size_t lines, size_t elem_size,
|
||||
bool is_signed) {
|
||||
TIFF *tiff = TIFFOpen(filename.c_str(), "w");
|
||||
|
||||
WriteTIFF(tiff, buff, cols, lines, elem_size, is_signed);
|
||||
|
||||
TIFFClose(tiff);
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
// Copyright (2019-2022) Paul Scherrer Institute
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#ifndef JUNGFRAUJOCH_WRITETIFF_H
|
||||
#define JUNGFRAUJOCH_WRITETIFF_H
|
||||
|
||||
#include <string>
|
||||
|
||||
std::string WriteTIFFToString(void *buff, size_t cols, size_t lines, size_t elem_size, bool is_signed = false);
|
||||
void WriteTIFFToFile(const std::string &filename, void *buff, size_t cols, size_t lines, size_t elem_size,
|
||||
bool is_signed = false);
|
||||
|
||||
#endif //JUNGFRAUJOCH_WRITETIFF_H
|
||||
@@ -25,7 +25,7 @@ add_executable(CatchTest
|
||||
JFCalibrationTest.cpp
|
||||
RadialIntegrationTest.cpp
|
||||
StatusVectorTest.cpp ProcessRawPacketTest.cpp
|
||||
CBORTest.cpp TIFFTest.cpp JFConversionTest.cpp)
|
||||
CBORTest.cpp JFConversionTest.cpp)
|
||||
|
||||
target_link_libraries(CatchTest JFJochBroker JFJochReceiver JFJochWriter DataProcessing CommonFunctions HLSSimulation)
|
||||
target_include_directories(CatchTest PRIVATE .)
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
// Copyright (2019-2022) Paul Scherrer Institute
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include <../common/WriteTIFF.h>
|
||||
|
||||
TEST_CASE("TIFFTest","[TIFF]") {
|
||||
std::vector<uint16_t> values(512*1024);
|
||||
REQUIRE_NOTHROW(WriteTIFFToString(values.data(), 1024, 512, 2));
|
||||
}
|
||||
|
||||
TEST_CASE("TIFFTest_File","[TIFF]") {
|
||||
std::vector<uint16_t> values(512*1024);
|
||||
|
||||
for (auto &i: values)
|
||||
i = 345;
|
||||
|
||||
REQUIRE_NOTHROW(WriteTIFFToFile("test_image.tiff", values.data(), 1024, 512, 2));
|
||||
}
|
||||
|
||||
TEST_CASE("TIFFTest_File_signed","[TIFF]") {
|
||||
std::vector<int16_t> values(512*1024);
|
||||
|
||||
for (int i = 0; i < values.size(); i++) {
|
||||
values[i] = static_cast<int16_t>(((i % 2 == 0) ? 1 : -1) * i);
|
||||
}
|
||||
|
||||
REQUIRE_NOTHROW(WriteTIFFToFile("test_image_signed.tiff", values.data(), 1024, 512,
|
||||
2, true));
|
||||
}
|
||||
Reference in New Issue
Block a user