Commit b149e1a0 authored by Jørgen Lind's avatar Jørgen Lind
Browse files

Merge branch feature/jorgen.lind/fixes_many_linux_2.1 with refs/heads/2.1 into...

Merge branch feature/jorgen.lind/fixes_many_linux_2.1 with refs/heads/2.1 into refs/merge-requests/521/train
parents 47c9dd79 cb6223d8
Pipeline #82101 passed with stages
in 29 minutes and 46 seconds
......@@ -17,7 +17,7 @@ ARG tag
ENV DEBIAN_FRONTEND="noninteractive" TZ="Europe/London"
RUN apt-get update
RUN apt-get install -y vim build-essential python3 python3-pip libboost-dev git doxygen openjdk-8-jdk libxml2-dev zlib1g-dev libcurl4-openssl-dev libuv1-dev uuid-dev gdb bash libssl-dev libboost-all-dev
RUN apt-get install -y curl vim build-essential python3 python3-pip libboost-dev git doxygen openjdk-8-jdk libxml2-dev zlib1g-dev libcurl4-openssl-dev libuv1-dev uuid-dev gdb bash libssl-dev libboost-all-dev
RUN curl -OL https://github.com/Kitware/CMake/releases/download/v3.22.0/cmake-3.22.0-linux-x86_64.tar.gz
RUN tar xzvf cmake-3.22.0-linux-x86_64.tar.gz -C /opt
......
......@@ -11,30 +11,30 @@
#include <random>
inline void getScaleOffsetForFormat(float min, float max, bool novalue, OpenVDS::VolumeDataChannelDescriptor::Format format, float &scale, float &offset)
inline void getScaleOffsetForFormat(float min, float max, bool novalue, OpenVDS::VolumeDataFormat format, float &scale, float &offset)
{
switch (format)
{
case OpenVDS::VolumeDataChannelDescriptor::Format_U8:
case OpenVDS::VolumeDataFormat::Format_U8:
scale = 1.f / (255.f - novalue) * (max - min);
offset = min;
break;
case OpenVDS::VolumeDataChannelDescriptor::Format_U16:
case OpenVDS::VolumeDataFormat::Format_U16:
scale = 1.f/(65535.f - novalue) * (max - min);
offset = min;
break;
case OpenVDS::VolumeDataChannelDescriptor::Format_R32:
case OpenVDS::VolumeDataChannelDescriptor::Format_U32:
case OpenVDS::VolumeDataChannelDescriptor::Format_R64:
case OpenVDS::VolumeDataChannelDescriptor::Format_U64:
case OpenVDS::VolumeDataChannelDescriptor::Format_1Bit:
case OpenVDS::VolumeDataChannelDescriptor::Format_Any:
case OpenVDS::VolumeDataFormat::Format_R32:
case OpenVDS::VolumeDataFormat::Format_U32:
case OpenVDS::VolumeDataFormat::Format_R64:
case OpenVDS::VolumeDataFormat::Format_U64:
case OpenVDS::VolumeDataFormat::Format_1Bit:
case OpenVDS::VolumeDataFormat::Format_Any:
scale = 1.0f;
offset = 0.0f;
}
}
inline OpenVDS::VDS *generateSimpleInMemory3DVDS(int32_t samplesX = 100, int32_t samplesY = 100, int32_t samplesZ = 100, OpenVDS::VolumeDataChannelDescriptor::Format format = OpenVDS::VolumeDataChannelDescriptor::Format_R32)
inline OpenVDS::VDS *generateSimpleInMemory3DVDS(int32_t samplesX = 100, int32_t samplesY = 100, int32_t samplesZ = 100, OpenVDS::VolumeDataFormat format = OpenVDS::VolumeDataFormat::Format_R32)
{
auto brickSize = OpenVDS::VolumeDataLayoutDescriptor::BrickSize_32;
int negativeMargin = 4;
......@@ -55,7 +55,7 @@ inline OpenVDS::VDS *generateSimpleInMemory3DVDS(int32_t samplesX = 100, int32_t
float intScale = 1.f;
float intOffset = 0.f;
getScaleOffsetForFormat(rangeMin, rangeMax, true, format, intScale, intOffset);
channelDescriptors.emplace_back(format, OpenVDS::VolumeDataChannelDescriptor::Components_1, AMPLITUDE_ATTRIBUTE_NAME, "", rangeMin, rangeMax, OpenVDS::VolumeDataMapping::Direct, 1, OpenVDS::VolumeDataChannelDescriptor::Default, 0.f, intScale, intOffset);
channelDescriptors.emplace_back(format, OpenVDS::VolumeDataComponents::Components_1, AMPLITUDE_ATTRIBUTE_NAME, "", rangeMin, rangeMax, OpenVDS::VolumeDataMapping::Direct, 1, OpenVDS::VolumeDataChannelDescriptor::Default, 0.f, intScale, intOffset);
OpenVDS::InMemoryOpenOptions options;
OpenVDS::MetadataContainer metadataContainer;
......@@ -74,7 +74,7 @@ inline void fill3DVDSWithNoise(OpenVDS::VDS *vds, int32_t channel = 0, const Ope
int32_t chunkCount = int32_t(pageAccessor->GetChunkCount());
OpenVDS::VolumeDataChannelDescriptor::Format format = layout->GetChannelFormat(channel);
OpenVDS::VolumeDataFormat format = layout->GetChannelFormat(channel);
for (int i = 0; i < chunkCount; i++)
{
......
......@@ -1275,25 +1275,25 @@ struct OffsetChannelInfo
OffsetChannelInfo(bool has, int start, int end, int step) : offsetStart(start), offsetEnd(end), offsetStep(step), hasOffset(has) {}
};
std::vector<OpenVDS::VolumeDataChannelDescriptor>
static std::vector<OpenVDS::VolumeDataChannelDescriptor>
createChannelDescriptors(SEGYFileInfo const& fileInfo, OpenVDS::FloatRange const& valueRange, const OffsetChannelInfo& offsetInfo)
{
std::vector<OpenVDS::VolumeDataChannelDescriptor>
channelDescriptors;
// Primary channel
channelDescriptors.emplace_back(OpenVDS::VolumeDataChannelDescriptor::Format_R32, OpenVDS::VolumeDataChannelDescriptor::Components_1, AMPLITUDE_ATTRIBUTE_NAME, "", valueRange.Min, valueRange.Max);
channelDescriptors.emplace_back(OpenVDS::VolumeDataFormat::Format_R32, OpenVDS::VolumeDataComponents::Components_1, AMPLITUDE_ATTRIBUTE_NAME, "", valueRange.Min, valueRange.Max);
// Trace defined flag
channelDescriptors.emplace_back(OpenVDS::VolumeDataChannelDescriptor::Format_U8, OpenVDS::VolumeDataChannelDescriptor::Components_1, "Trace", "", 0.0f, 1.0f, OpenVDS::VolumeDataMapping::PerTrace, OpenVDS::VolumeDataChannelDescriptor::DiscreteData);
channelDescriptors.emplace_back(OpenVDS::VolumeDataFormat::Format_U8, OpenVDS::VolumeDataComponents::Components_1, "Trace", "", 0.0f, 1.0f, OpenVDS::VolumeDataMapping::PerTrace, OpenVDS::VolumeDataChannelDescriptor::DiscreteData);
// SEG-Y trace headers
channelDescriptors.emplace_back(OpenVDS::VolumeDataChannelDescriptor::Format_U8, OpenVDS::VolumeDataChannelDescriptor::Components_1, "SEGYTraceHeader", "", 0.0f, 255.0f, OpenVDS::VolumeDataMapping::PerTrace, SEGY::TraceHeaderSize, OpenVDS::VolumeDataChannelDescriptor::DiscreteData | OpenVDS::VolumeDataChannelDescriptor::NoLossyCompressionUseZip, 1.0f, 0.0f);
channelDescriptors.emplace_back(OpenVDS::VolumeDataFormat::Format_U8, OpenVDS::VolumeDataComponents::Components_1, "SEGYTraceHeader", "", 0.0f, 255.0f, OpenVDS::VolumeDataMapping::PerTrace, SEGY::TraceHeaderSize, OpenVDS::VolumeDataChannelDescriptor::DiscreteData | OpenVDS::VolumeDataChannelDescriptor::NoLossyCompressionUseZip, 1.0f, 0.0f);
if (offsetInfo.hasOffset)
{
// offset channel
channelDescriptors.emplace_back(OpenVDS::VolumeDataChannelDescriptor::Format_R32, OpenVDS::VolumeDataChannelDescriptor::Components_1, "Offset", KNOWNMETADATA_UNIT_METER, static_cast<float>(offsetInfo.offsetStart), static_cast<float>(offsetInfo.offsetEnd),OpenVDS::VolumeDataMapping::PerTrace, OpenVDS::VolumeDataChannelDescriptor::NoLossyCompression);
channelDescriptors.emplace_back(OpenVDS::VolumeDataFormat::Format_R32, OpenVDS::VolumeDataComponents::Components_1, "Offset", KNOWNMETADATA_UNIT_METER, static_cast<float>(offsetInfo.offsetStart), static_cast<float>(offsetInfo.offsetEnd),OpenVDS::VolumeDataMapping::PerTrace, OpenVDS::VolumeDataChannelDescriptor::NoLossyCompression);
// TODO channels for other gather types - "Angle", "Vrms", "Frequency"
}
......
Supports Markdown
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