Currently job artifacts in CI/CD pipelines on LRZ GitLab never expire. Starting from Wed 26.1.2022 the default expiration time will be 30 days (GitLab default). Currently existing artifacts in already completed jobs will not be affected by the change. The latest artifacts for all jobs in the latest successful pipelines will be kept. More information: https://gitlab.lrz.de/help/user/admin_area/settings/continuous_integration.html#default-artifacts-expiration

Commit 0a73c082 authored by Christian Schulte zu Berge's avatar Christian Schulte zu Berge
Browse files

Fixed bug in DataContainerInspectorCanvas, improved ImageData representation conversion.

parent ccace339
...@@ -199,8 +199,8 @@ namespace campvis { ...@@ -199,8 +199,8 @@ namespace campvis {
// compute transformation matrices // compute transformation matrices
float renderTargetRatio = static_cast<float>(_quadSize.x) / static_cast<float>(_quadSize.y); float renderTargetRatio = static_cast<float>(_quadSize.x) / static_cast<float>(_quadSize.y);
float sliceRatio = (static_cast<float>(id->getSize().x) * id->getMappingInformation().getVoxelSize().x) float sliceRatio = (static_cast<float>(id->getSize().x) * std::abs(id->getMappingInformation().getVoxelSize().x))
/ (static_cast<float>(id->getSize().y) * id->getMappingInformation().getVoxelSize().y); / (static_cast<float>(id->getSize().y) * std::abs(id->getMappingInformation().getVoxelSize().y));
float ratioRatio = sliceRatio / renderTargetRatio; float ratioRatio = sliceRatio / renderTargetRatio;
cgt::mat4 viewMatrix = (ratioRatio > 1) ? cgt::mat4::createScale(cgt::vec3(1.f, 1.f / ratioRatio, 1.f)) : cgt::mat4::createScale(cgt::vec3(ratioRatio, 1.f, 1.f)); cgt::mat4 viewMatrix = (ratioRatio > 1) ? cgt::mat4::createScale(cgt::vec3(1.f, 1.f / ratioRatio, 1.f)) : cgt::mat4::createScale(cgt::vec3(ratioRatio, 1.f, 1.f));
...@@ -291,8 +291,8 @@ namespace campvis { ...@@ -291,8 +291,8 @@ namespace campvis {
// compute transformation matrices // compute transformation matrices
float renderTargetRatio = static_cast<float>(_quadSize.x) / static_cast<float>(_quadSize.y); float renderTargetRatio = static_cast<float>(_quadSize.x) / static_cast<float>(_quadSize.y);
float sliceRatio = (static_cast<float>(id->getSize().x) * id->getMappingInformation().getVoxelSize().x) float sliceRatio = (static_cast<float>(id->getSize().x) * std::abs(id->getMappingInformation().getVoxelSize().x))
/ (static_cast<float>(id->getSize().y) * id->getMappingInformation().getVoxelSize().y); / (static_cast<float>(id->getSize().y) * std::abs(id->getMappingInformation().getVoxelSize().y));
float ratioRatio = sliceRatio / renderTargetRatio; float ratioRatio = sliceRatio / renderTargetRatio;
lookupTexelFloat /= (ratioRatio > 1) ? cgt::vec2(1.f, 1.f / ratioRatio) : cgt::vec2(ratioRatio, 1.f); lookupTexelFloat /= (ratioRatio > 1) ? cgt::vec2(1.f, 1.f / ratioRatio) : cgt::vec2(ratioRatio, 1.f);
......
...@@ -215,7 +215,7 @@ namespace campvis { ...@@ -215,7 +215,7 @@ namespace campvis {
template<typename T> template<typename T>
const T* campvis::ImageData::getRepresentation(bool performConversion) const { const T* campvis::ImageData::getRepresentation(bool performConversion) const {
// look, whether we already have a suitable representation // look, whether we already have a suitable representation
for (tbb::concurrent_vector<const AbstractImageRepresentation*>::const_iterator it = _representations.begin(); it != _representations.end(); ++it) { for (auto it = _representations.rbegin(); it != _representations.rend(); ++it) {
if (const T* tester = dynamic_cast<const T*>(*it)) { if (const T* tester = dynamic_cast<const T*>(*it)) {
return tester; return tester;
} }
...@@ -226,7 +226,7 @@ namespace campvis { ...@@ -226,7 +226,7 @@ namespace campvis {
tbb::spin_mutex::scoped_lock lock(_conversionMutex); tbb::spin_mutex::scoped_lock lock(_conversionMutex);
// in the meantime, there something might have changed, so check again whether there is a new rep. // in the meantime, there something might have changed, so check again whether there is a new rep.
for (tbb::concurrent_vector<const AbstractImageRepresentation*>::const_iterator it = _representations.begin(); it != _representations.end(); ++it) { for (auto it = _representations.rbegin(); it != _representations.rend(); ++it) {
if (const T* tester = dynamic_cast<const T*>(*it)) { if (const T* tester = dynamic_cast<const T*>(*it)) {
return tester; return tester;
} }
...@@ -240,7 +240,7 @@ namespace campvis { ...@@ -240,7 +240,7 @@ namespace campvis {
template<typename T> template<typename T>
const T* campvis::ImageData::tryPerformConversion() const { const T* campvis::ImageData::tryPerformConversion() const {
for (tbb::concurrent_vector<const AbstractImageRepresentation*>::const_iterator it = _representations.begin(); it != _representations.end(); ++it) { for (auto it = _representations.rbegin(); it != _representations.rend(); ++it) {
const T* tester = ImageRepresentationConverter::getRef().tryConvertFrom<T>(*it); const T* tester = ImageRepresentationConverter::getRef().tryConvertFrom<T>(*it);
if (tester != 0) { if (tester != 0) {
//LDEBUG("Performed a image representation conversion from " + std::string(typeid(**it).name()) + " to " + std::string(typeid(T).name()) + "."); //LDEBUG("Performed a image representation conversion from " + std::string(typeid(**it).name()) + " to " + std::string(typeid(T).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