From 7b61027ccfbeb691adf29b912419199fcce3113e Mon Sep 17 00:00:00 2001 From: Alexander Vieth Date: Wed, 18 Mar 2026 15:53:26 +0100 Subject: [PATCH 01/12] Remove unused variables --- DVRViewPlugin/src/DVRViewPlugin.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/DVRViewPlugin/src/DVRViewPlugin.h b/DVRViewPlugin/src/DVRViewPlugin.h index 5def51b..e1f12d6 100644 --- a/DVRViewPlugin/src/DVRViewPlugin.h +++ b/DVRViewPlugin/src/DVRViewPlugin.h @@ -86,8 +86,6 @@ class DVRViewPlugin : public ViewPlugin mv::Dataset _materialPositionTexture; /** Texture containing material position data */ mv::Dataset _reducedPosDataset; /** Dataset containing the dimensionality recuded locations of all the points in the volume */ std::vector _currentDimensions; /** Stores which dimensions of the current data are shown */ - std::vector _spatialData; /** Spatial data */ - std::vector _valueData; /** Value data */ }; /** From e70b70f99552c9dc90769ae2271a08f877e06186 Mon Sep 17 00:00:00 2001 From: Alexander Vieth Date: Wed, 18 Mar 2026 15:53:44 +0100 Subject: [PATCH 02/12] Fix typos --- DVRViewPlugin/src/DVRViewPlugin.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/DVRViewPlugin/src/DVRViewPlugin.h b/DVRViewPlugin/src/DVRViewPlugin.h index e1f12d6..b5a466f 100644 --- a/DVRViewPlugin/src/DVRViewPlugin.h +++ b/DVRViewPlugin/src/DVRViewPlugin.h @@ -67,7 +67,7 @@ class DVRViewPlugin : public ViewPlugin void updateMaterialPositionsData(); private: - /** We create and publish some data in order to provide an self-contained DVR project */ + /** We create and publish some data in order to provide a self-contained DVR project */ std::vector generateSequence(int n); QString getVolumeDataSetID() const; @@ -80,11 +80,11 @@ class DVRViewPlugin : public ViewPlugin DropWidget* _dropWidget; /** Widget for drag and drop behavior */ DVRWidget* _DVRWidget; /** The OpenGL widget */ SettingsAction _settingsAction; /** Settings action */ - mv::Dataset _volumeDataset; /** Volume containg the multivariate dataset */ + mv::Dataset _volumeDataset; /** Volume containing the multivariate dataset */ mv::Dataset _tfTexture; /** Texture containing the color transfer function data */ mv::Dataset _materialTransitionTexture; /** Texture containing material transition data */ mv::Dataset _materialPositionTexture; /** Texture containing material position data */ - mv::Dataset _reducedPosDataset; /** Dataset containing the dimensionality recuded locations of all the points in the volume */ + mv::Dataset _reducedPosDataset; /** Dataset containing the dimensionality reduced locations of all the points in the volume */ std::vector _currentDimensions; /** Stores which dimensions of the current data are shown */ }; From 626d35e966ce2b64a780eb9c064a42f70f06f026 Mon Sep 17 00:00:00 2001 From: Alexander Vieth Date: Wed, 18 Mar 2026 15:55:00 +0100 Subject: [PATCH 03/12] Const all the things --- DVRViewPlugin/src/DVRWidget.cpp | 8 +++--- DVRViewPlugin/src/DVRWidget.h | 2 +- DVRViewPlugin/src/VolumeRenderer.cpp | 6 ++-- DVRViewPlugin/src/VolumeRenderer.h | 2 +- DVRVolumeData/DVRVolumeData/Volumes.cpp | 38 ++++++++++++------------- DVRVolumeLoader/src/DVRVolumeLoader.cpp | 2 +- 6 files changed, 29 insertions(+), 29 deletions(-) diff --git a/DVRViewPlugin/src/DVRWidget.cpp b/DVRViewPlugin/src/DVRWidget.cpp index 4879b98..11701a9 100644 --- a/DVRViewPlugin/src/DVRWidget.cpp +++ b/DVRViewPlugin/src/DVRWidget.cpp @@ -72,12 +72,12 @@ DVRWidget::~DVRWidget() cleanup(); } -void DVRWidget::setData(const Dataset& dataset, std::vector& dimensionIndices) +void DVRWidget::setData(const Dataset& dataset, const std::vector& dimensionIndices) { _volumeDataset = dataset; //reset camera to fit new dataset - mv::Vector3f center = _volumeDataset->getVolumeSize().toVector3f() / 2.0f; + const mv::Vector3f center = _volumeDataset->getVolumeSize().toVector3f() / 2.0f; _camera.setDistance(_volumeDataset->getVolumeSize().width() * 2); _camera.setCenter(QVector3D(center.x, center.y, center.z)); @@ -171,7 +171,7 @@ void DVRWidget::initializeGL() // Initialize renderers _volumeRenderer.init(); - mv::Vector3f center = _volumeRenderer.getVolumeSize(); + const mv::Vector3f center = _volumeRenderer.getVolumeSize(); _camera.setDistance(center.x * 2); _camera.setCenter(QVector3D(center.x, center.y, center.z) / 2); @@ -186,7 +186,7 @@ void DVRWidget::initializeGL() void DVRWidget::updatePixelRatio() { - float pixelRatio = devicePixelRatio(); + const float pixelRatio = devicePixelRatio(); // we only update if the ratio actually changed if (_pixelRatio != pixelRatio) diff --git a/DVRViewPlugin/src/DVRWidget.h b/DVRViewPlugin/src/DVRWidget.h index c26348f..aec7f68 100644 --- a/DVRViewPlugin/src/DVRWidget.h +++ b/DVRViewPlugin/src/DVRWidget.h @@ -30,7 +30,7 @@ class DVRWidget : public QOpenGLWidget, protected QOpenGLFunctions bool isInitialized() const { return _isInitialized;}; /** methods that pass the data to the renderer */ - void setData(const Dataset& dataset, std::vector& dimensionIndices); + void setData(const Dataset& dataset, const std::vector& dimensionIndices); void setTfTexture(const Dataset& tfTexture); void setReducedPosData(const Dataset& reducedPosData); void setMaterialTransitionTexture(const Dataset& materialTransitionTexture); diff --git a/DVRViewPlugin/src/VolumeRenderer.cpp b/DVRViewPlugin/src/VolumeRenderer.cpp index f2ed0c1..4123e3a 100644 --- a/DVRViewPlugin/src/VolumeRenderer.cpp +++ b/DVRViewPlugin/src/VolumeRenderer.cpp @@ -334,8 +334,8 @@ void VolumeRenderer::normalizePositionData(std::vector& positionData) } } - float rangeX = maxX - minX; - float rangeY = maxY - minY; + const float rangeX = maxX - minX; + const float rangeY = maxY - minY; int size = _tfDataset->getImageSize().width(); // We use a square texture so width is also height if (_renderMode == RenderMode::MaterialTransition_2D || _renderMode == RenderMode::NN_MaterialTransition || _renderMode == RenderMode::Alt_NN_MaterialTransition || _renderMode == RenderMode::MaterialTransition_FULL) @@ -517,7 +517,7 @@ void VolumeRenderer::setUseCustomRenderSpace(bool useCustomRenderSpace) } // Which dimension should we send to the GPU (used for the full data and MIP render modes) -void VolumeRenderer::setCompositeIndices(std::vector compositeIndices) +void VolumeRenderer::setCompositeIndices(const std::vector& compositeIndices) { if (_compositeIndices != compositeIndices) _dataSettingsChanged = true; diff --git a/DVRViewPlugin/src/VolumeRenderer.h b/DVRViewPlugin/src/VolumeRenderer.h index 91a5594..5172bbd 100644 --- a/DVRViewPlugin/src/VolumeRenderer.h +++ b/DVRViewPlugin/src/VolumeRenderer.h @@ -91,7 +91,7 @@ class VolumeRenderer : protected QOpenGLFunctions_4_3_Core void setStepSize(float stepSize); void setRenderSpace(mv::Vector3f size); void setUseCustomRenderSpace(bool useCustomRenderSpace); - void setCompositeIndices(std::vector compositeIndices); + void setCompositeIndices(const std::vector& compositeIndices); void setRenderMode(const QString& renderMode); void setMIPDimension(int mipDimension); diff --git a/DVRVolumeData/DVRVolumeData/Volumes.cpp b/DVRVolumeData/DVRVolumeData/Volumes.cpp index 0a10547..db594d0 100644 --- a/DVRVolumeData/DVRVolumeData/Volumes.cpp +++ b/DVRVolumeData/DVRVolumeData/Volumes.cpp @@ -228,27 +228,27 @@ mv::Vector3f Volumes::getVolumeAtlasData(const std::vector& dimen const std::int32_t numberOfVoxels = getNumberOfVoxels(); const std::int32_t numberOfElementsRequired = std::ceil(float(dimensionIndices.size()) / float(textureBlockDimensions)) * textureBlockDimensions * getNumberOfVoxels(); - int brickAmount = std::ceil(float(dimensionIndices.size()) / float(textureBlockDimensions)); + const int brickAmount = std::ceil(float(dimensionIndices.size()) / float(textureBlockDimensions)); - // These are currently not intresting, but later on we might add borders to the blocks to avoid interpolation artifacts - int width = getVolumeSize().width(); - int height = getVolumeSize().height(); - int depth = getVolumeSize().depth(); + // These are currently not interesting, but later on we might add borders to the blocks to avoid interpolation artifacts + const int width = getVolumeSize().width(); + const int height = getVolumeSize().height(); + const int depth = getVolumeSize().depth(); - // Here we figure out the optimal way we can arrange the atlas bricks such that we minimize the amount of wasted space in the texture - mv::Vector3f maxDimsInBricks = mv::Vector3f(GL_MAX_3D_TEXTURE_SIZE / width, GL_MAX_3D_TEXTURE_SIZE / height, GL_MAX_3D_TEXTURE_SIZE / depth); - mv::Vector3f brickLayout = findOptimalDimensions(brickAmount, maxDimsInBricks); + // Here we figure out the optimal way we can arrange the atlas bricks such that we minimize the amount of wasted space in the texture + const mv::Vector3f maxDimsInBricks = mv::Vector3f(GL_MAX_3D_TEXTURE_SIZE / width, GL_MAX_3D_TEXTURE_SIZE / height, GL_MAX_3D_TEXTURE_SIZE / depth); + const mv::Vector3f brickLayout = findOptimalDimensions(brickAmount, maxDimsInBricks); QVector tempScalarData(numberOfElementsRequired); qDebug() << "Size of temp vector: " << tempScalarData.size() << " " << numberOfElementsRequired; QPair tempScalarDataRange(std::numeric_limits::max(), std::numeric_limits::lowest()); - int trueWidth = width * brickLayout.x; - int trueHeight = height * brickLayout.y; - int trueDepth = depth * brickLayout.z; + const int trueWidth = width * brickLayout.x; + const int trueHeight = height * brickLayout.y; + const int trueDepth = depth * brickLayout.z; - int trueVolume = trueWidth * trueHeight * trueDepth * textureBlockDimensions; + const int trueVolume = trueWidth * trueHeight * trueDepth * textureBlockDimensions; if (trueVolume >= scalarData.size()) { scalarData.resize(trueVolume); qDebug() << "Resized scalar data to: " << trueVolume; @@ -258,11 +258,11 @@ mv::Vector3f Volumes::getVolumeAtlasData(const std::vector& dimen std::int32_t componentIndex = 0; for (const auto& dimensionIndex : dimensionIndices) { getScalarDataForVolumeDimension(dimensionIndex, tempScalarData, tempScalarDataRange); - int brickIndex = std::floor(float(componentIndex) / float(textureBlockDimensions)); + const int brickIndex = std::floor(float(componentIndex) / float(textureBlockDimensions)); - int brickX = brickIndex % int(brickLayout.x); - int brickY = int(std::floor(float(brickIndex) / float(brickLayout.x))) % int(brickLayout.y); - int brickZ = std::floor(float(brickIndex) / float(brickLayout.x * brickLayout.y)); + const int brickX = brickIndex % int(brickLayout.x); + const int brickY = int(std::floor(float(brickIndex) / float(brickLayout.x))) % int(brickLayout.y); + const int brickZ = std::floor(float(brickIndex) / float(brickLayout.x * brickLayout.y)); for (std::int32_t voxelIndex = 0; voxelIndex < numberOfVoxels; voxelIndex++) { mv::Vector3f voxelCoordinate = getVoxelCoordinateFromVoxelIndex(voxelIndex); // The voxel coordinate detimenes the position of the voxel in the volume, not accounting for (for example) the rgba format yet inside the brick itself @@ -272,10 +272,10 @@ mv::Vector3f Volumes::getVolumeAtlasData(const std::vector& dimen * textureBlockDimensions; // Here, we add the offset of the channel inside the brick - std::uint32_t channelOffset = componentIndex % textureBlockDimensions; - std::uint32_t valueIndex = voxelBaseIndex + channelOffset; + const std::uint32_t channelOffset = componentIndex % textureBlockDimensions; + const std::uint32_t valueIndex = voxelBaseIndex + channelOffset; - float value = tempScalarData[voxelIndex]; + const float value = tempScalarData[voxelIndex]; if(valueIndex > scalarData.size()) qCritical() << "Index out of bounds: " << valueIndex << " " << scalarData.size(); scalarData[valueIndex] = value; diff --git a/DVRVolumeLoader/src/DVRVolumeLoader.cpp b/DVRVolumeLoader/src/DVRVolumeLoader.cpp index 6c852c1..dba5fba 100644 --- a/DVRVolumeLoader/src/DVRVolumeLoader.cpp +++ b/DVRVolumeLoader/src/DVRVolumeLoader.cpp @@ -124,7 +124,7 @@ void recursiveReadDataAndAddToCore Date: Wed, 18 Mar 2026 15:55:15 +0100 Subject: [PATCH 04/12] Fix typos --- DVRViewPlugin/src/VolumeRenderer.cpp | 10 +++++----- DVRViewPlugin/src/VolumeRenderer.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/DVRViewPlugin/src/VolumeRenderer.cpp b/DVRViewPlugin/src/VolumeRenderer.cpp index 4123e3a..a60557d 100644 --- a/DVRViewPlugin/src/VolumeRenderer.cpp +++ b/DVRViewPlugin/src/VolumeRenderer.cpp @@ -254,7 +254,7 @@ void VolumeRenderer::setData(const mv::Dataset& dataset) return; } - updataDataTexture(); + updateDataTexture(); updateRenderCubes(); } @@ -275,14 +275,14 @@ void VolumeRenderer::setTfTexture(const mv::Dataset& tfTexture) // In these render modes the new dataset will impact the visualization and thus needs to be updated now if (_renderMode == RenderMode::MULTIDIMENSIONAL_COMPOSITE_COLOR || _renderMode == RenderMode::NN_MULTIDIMENSIONAL_COMPOSITE || _renderMode == RenderMode::NN_MaterialTransition || _renderMode == RenderMode::Alt_NN_MaterialTransition || _renderMode == RenderMode::Smooth_NN_MaterialTransition) - updataDataTexture(); + updateDataTexture(); } void VolumeRenderer::setReducedPosData(const mv::Dataset& reducedPosData) { _reducedPosDataset = reducedPosData; if (!_renderMode == RenderMode::MULTIDIMENSIONAL_COMPOSITE_FULL && !_renderMode == RenderMode::MaterialTransition_FULL && _renderMode != RenderMode::MIP) { - updataDataTexture(); // The position data is used in the rendering process, so we need to update the data texture (apart from the MIP and full data render modes that either don't need it or define it elsewhere) + updateDataTexture(); // The position data is used in the rendering process, so we need to update the data texture (apart from the MIP and full data render modes that either don't need it or define it elsewhere) } } @@ -416,7 +416,7 @@ void VolumeRenderer::loadNNVolumeToTexture(mv::Texture3D& targetVolume, std::vec targetVolume.release(); // Unbind the texture } -void VolumeRenderer::updataDataTexture() +void VolumeRenderer::updateDataTexture() { QPair scalarDataRange; @@ -1916,7 +1916,7 @@ void VolumeRenderer::render() // Check if all datasets are valid before rendering if (_volumeDataset.isValid() && _reducedPosDataset.isValid() && _tfDataset.isValid() && _materialPositionDataset.isValid() && _materialTransitionDataset.isValid()) { if (_dataSettingsChanged) { - updataDataTexture(); + updateDataTexture(); _dataSettingsChanged = false; } if (_renderMode == RenderMode::MaterialTransition_FULL || _renderMode == RenderMode::MULTIDIMENSIONAL_COMPOSITE_FULL) diff --git a/DVRViewPlugin/src/VolumeRenderer.h b/DVRViewPlugin/src/VolumeRenderer.h index 5172bbd..827d9c1 100644 --- a/DVRViewPlugin/src/VolumeRenderer.h +++ b/DVRViewPlugin/src/VolumeRenderer.h @@ -102,7 +102,7 @@ class VolumeRenderer : protected QOpenGLFunctions_4_3_Core void loadNNVolumeToTexture(mv::Texture3D& targetVolume, std::vector& textureData, QVector& usedTFImage, int width, mv::Vector3f volumeSize, int pointAmount, bool singleValueTFTexture); - void updataDataTexture(); + void updateDataTexture(); mv::Vector3f getVolumeSize() const { return _volumeSize; } bool getFullRenderModeInProgress() const { return _fullDataModeBatch != -1; } From 952f3d1339986a833dcaa3895cb2ae28297bba7d Mon Sep 17 00:00:00 2001 From: Alexander Vieth Date: Wed, 18 Mar 2026 15:56:13 +0100 Subject: [PATCH 05/12] Fix warning --- DVRVolumeLoader/src/DVRVolumeLoader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DVRVolumeLoader/src/DVRVolumeLoader.cpp b/DVRVolumeLoader/src/DVRVolumeLoader.cpp index dba5fba..7735aa0 100644 --- a/DVRVolumeLoader/src/DVRVolumeLoader.cpp +++ b/DVRVolumeLoader/src/DVRVolumeLoader.cpp @@ -128,7 +128,7 @@ QString DVRVolumeLoader::getFile() // Don't try to load a file if the dialog was cancelled or the file name is empty if (fileName.isNull() || fileName.isEmpty()) - return QString(); + return {}; qDebug() << "Loading BIN file: " << fileName; From c683823a28132ae7878082ac79d5dec543c7e864 Mon Sep 17 00:00:00 2001 From: Alexander Vieth Date: Wed, 25 Mar 2026 16:55:02 +0100 Subject: [PATCH 06/12] Const all the things --- DVRTransferFunction/src/InteractiveShape.cpp | 6 +-- .../src/MaterialTransitionsAction.cpp | 10 ++--- .../src/MaterialTransitionsAction.h | 7 ++-- .../src/TransferFunctionWidget.cpp | 38 +++++++++---------- .../src/TransferFunctionWidget.h | 10 ++--- 5 files changed, 33 insertions(+), 38 deletions(-) diff --git a/DVRTransferFunction/src/InteractiveShape.cpp b/DVRTransferFunction/src/InteractiveShape.cpp index 2f3b3bd..a8c394b 100644 --- a/DVRTransferFunction/src/InteractiveShape.cpp +++ b/DVRTransferFunction/src/InteractiveShape.cpp @@ -90,7 +90,7 @@ void InteractiveShape::resizeBy(const QPointF& delta, SelectedSide& side) { break; } if (_rect.left() > _rect.right()) { - qreal temp = _rect.left(); + const qreal temp = _rect.left(); _rect.setLeft(_rect.right()); _rect.setRight(temp); if (side == SelectedSide::Left) { @@ -99,7 +99,7 @@ void InteractiveShape::resizeBy(const QPointF& delta, SelectedSide& side) { side = SelectedSide::Left; } } else if (_rect.top() > _rect.bottom()) { - qreal temp = _rect.top(); + const qreal temp = _rect.top(); _rect.setTop(_rect.bottom()); _rect.setBottom(temp); if (side == SelectedSide::Top) { @@ -111,7 +111,7 @@ void InteractiveShape::resizeBy(const QPointF& delta, SelectedSide& side) { } bool InteractiveShape::isNearSide(const QPointF& point, SelectedSide& side) const { - QRectF adjustedRect = getRelativeRect(); + const QRectF adjustedRect = getRelativeRect(); if (std::abs(point.x() - adjustedRect.left()) <= _threshold && point.y() <= adjustedRect.bottom() && point.y() >= adjustedRect.top()) { side = SelectedSide::Left; return true; diff --git a/DVRTransferFunction/src/MaterialTransitionsAction.cpp b/DVRTransferFunction/src/MaterialTransitionsAction.cpp index f796a79..eb5914b 100644 --- a/DVRTransferFunction/src/MaterialTransitionsAction.cpp +++ b/DVRTransferFunction/src/MaterialTransitionsAction.cpp @@ -27,7 +27,7 @@ void MaterialTransitionsAction::initialize(TransferFunctionPlugin* transferFunct TransferFunctionWidget& widget = transferFunctionPlugin->getTransferFunctionWidget(); - connect(&widget, &TransferFunctionWidget::shapeCreated, this, [this, &widget](std::vector interactiveShapes) { + connect(&widget, &TransferFunctionWidget::shapeCreated, this, [this, &widget](const std::vector& interactiveShapes) { _interactiveShapes = interactiveShapes; // Resize the table to the new size @@ -53,7 +53,7 @@ void MaterialTransitionsAction::initialize(TransferFunctionPlugin* transferFunct emit headersChanged(interactiveShapes); }); - connect(&widget, &TransferFunctionWidget::shapeDeleted, this, [this, &widget](std::vector interactiveShapes) { + connect(&widget, &TransferFunctionWidget::shapeDeleted, this, [this, &widget](const std::vector& interactiveShapes) { _interactiveShapes = interactiveShapes; // Resize the table to the new size @@ -157,7 +157,7 @@ MaterialTransitionsAction::Widget::Widget(QWidget* parent, MaterialTransitionsAc updateTable(transitions); }); - connect(materialTransitionsAction, &MaterialTransitionsAction::headersChanged, this, [this, materialTransitionsAction](std::vector interactiveShapes) { + connect(materialTransitionsAction, &MaterialTransitionsAction::headersChanged, this, [this, materialTransitionsAction](const std::vector& interactiveShapes) { updateHeaderColors(interactiveShapes); }); @@ -173,7 +173,7 @@ MaterialTransitionsAction::Widget::Widget(QWidget* parent, MaterialTransitionsAc _globalAlphaValue = globalAlphaValue; }); - connect(materialTransitionsAction, &MaterialTransitionsAction::tableUpdateNeeded, this, [this, materialTransitionsAction](std::vector interactiveShapes, std::vector> transitions + connect(materialTransitionsAction, &MaterialTransitionsAction::tableUpdateNeeded, this, [this, materialTransitionsAction](const std::vector& interactiveShapes, const std::vector>& transitions ) { updateTable(transitions); updateHeaderColors(interactiveShapes); @@ -202,7 +202,7 @@ void MaterialTransitionsAction::Widget::updateTable(const std::vector interactiveShapes) +void MaterialTransitionsAction::Widget::updateHeaderColors(const std::vector& interactiveShapes) { const int size = static_cast(interactiveShapes.size()) + 1; // Set the background color for the headers diff --git a/DVRTransferFunction/src/MaterialTransitionsAction.h b/DVRTransferFunction/src/MaterialTransitionsAction.h index 5042f2c..860c00d 100644 --- a/DVRTransferFunction/src/MaterialTransitionsAction.h +++ b/DVRTransferFunction/src/MaterialTransitionsAction.h @@ -43,14 +43,13 @@ class MaterialTransitionsAction : public WidgetAction signals: void transitionChanged(const std::vector>& transitions); - void headersChanged(std::vector interactiveShapes); + void headersChanged(const std::vector& interactiveShapes); void transitionSelected(int row, int column); void globalAlphaToggled(bool useGlobalAlpha); void globalAlphaChanged(int globalAlphaValue); - void tableUpdateNeeded(std::vector interactiveShapes, std::vector> transitions); - + void tableUpdateNeeded(const std::vector& interactiveShapes, const std::vector>& transitions); protected: TransferFunctionPlugin* _transferFunctionPlugin; /** Pointer to scatterplot plugin */ @@ -74,7 +73,7 @@ class MaterialTransitionsAction : public WidgetAction int _globalAlphaValue = 100; void updateTable(const std::vector>& transitions); - void updateHeaderColors(std::vector interactiveShapes); + void updateHeaderColors(const std::vector& interactiveShapes); friend class MaterialTransitionsAction; }; diff --git a/DVRTransferFunction/src/TransferFunctionWidget.cpp b/DVRTransferFunction/src/TransferFunctionWidget.cpp index e025341..052eb59 100644 --- a/DVRTransferFunction/src/TransferFunctionWidget.cpp +++ b/DVRTransferFunction/src/TransferFunctionWidget.cpp @@ -246,11 +246,11 @@ QRect TransferFunctionWidget::getMousePositionsBounds(QPoint newMousePosition) { if (!_areaSelectionBounds.isValid()) { _areaSelectionBounds = QRect(_mousePositions[0], _mousePositions[0]); } - int left = std::min(_areaSelectionBounds.left(), newMousePosition.x()); - int right = std::max(_areaSelectionBounds.right(), newMousePosition.x()); - int top = std::min(_areaSelectionBounds.top(), newMousePosition.y()); - int bottom = std::max(_areaSelectionBounds.bottom(), newMousePosition.y()); - return QRect(QPoint(left, top), QPoint(right, bottom)); + const int left = std::min(_areaSelectionBounds.left(), newMousePosition.x()); + const int right = std::max(_areaSelectionBounds.right(), newMousePosition.x()); + const int top = std::min(_areaSelectionBounds.top(), newMousePosition.y()); + const int bottom = std::max(_areaSelectionBounds.bottom(), newMousePosition.y()); + return { QPoint(left, top), QPoint(right, bottom) }; } bool TransferFunctionWidget::isInitialized() const @@ -508,7 +508,7 @@ void TransferFunctionWidget::updateTfTexture() return; - QImage materialMap = QImage(_boundsPointsWindow.width(), _boundsPointsWindow.height(), QImage::Format_ARGB32); + auto materialMap = QImage(_boundsPointsWindow.width(), _boundsPointsWindow.height(), QImage::Format_ARGB32); QPainter painter(&materialMap); painter.setCompositionMode(QPainter::CompositionMode_SourceOver); @@ -522,10 +522,10 @@ void TransferFunctionWidget::updateTfTexture() for (int y = _tfTextureSize - 1; y >= 0; y--) { for (int x = 0; x < _tfTextureSize; x++) { - int normalizedX = x * materialMap.width() / _tfTextureSize; - int normalizedY = y * materialMap.height() / _tfTextureSize; + const int normalizedX = x * materialMap.width() / _tfTextureSize; + const int normalizedY = y * materialMap.height() / _tfTextureSize; - QColor color = materialMap.pixelColor(normalizedX, normalizedY); + const QColor color = materialMap.pixelColor(normalizedX, normalizedY); data.push_back(color.redF()); data.push_back(color.greenF()); data.push_back(color.blueF()); @@ -545,7 +545,7 @@ void TransferFunctionWidget::updateMaterialPositionsTexture() return; - QImage materialMap = QImage(_boundsPointsWindow.width(), _boundsPointsWindow.height(), QImage::Format_ARGB32); + auto materialMap = QImage(_boundsPointsWindow.width(), _boundsPointsWindow.height(), QImage::Format_ARGB32); QPainter painter(&materialMap); painter.setCompositionMode(QPainter::CompositionMode_SourceOver); @@ -561,11 +561,11 @@ void TransferFunctionWidget::updateMaterialPositionsTexture() for (int y = _materialPositionTextureSize - 1; y >= 0; y--) { for (int x = 0; x < _materialPositionTextureSize; x++) { - int normalizedX = x * materialMap.width() / _materialPositionTextureSize; - int normalizedY = y * materialMap.height() / _materialPositionTextureSize; + const int normalizedX = x * materialMap.width() / _materialPositionTextureSize; + const int normalizedY = y * materialMap.height() / _materialPositionTextureSize; - QColor color = materialMap.pixelColor(normalizedX, normalizedY); - data.push_back(color.red()); + const QColor color = materialMap.pixelColor(normalizedX, normalizedY); + data.push_back(color.redF()); } } @@ -575,7 +575,7 @@ void TransferFunctionWidget::updateMaterialPositionsTexture() events().notifyDatasetDataChanged(_materialPositionTexture); } -void TransferFunctionWidget::updateMaterialTransitionTexture(std::vector> transitionsTable) +void TransferFunctionWidget::updateMaterialTransitionTexture(const std::vector>& transitionsTable) { if (!_materialTransitionTexture.isValid()) return; @@ -585,11 +585,11 @@ void TransferFunctionWidget::updateMaterialTransitionTexture(std::vector= 0; y--) { - for (int y = 0; y < _materialTextureSize; y++) { - for (int x = 0; x < _materialTextureSize; x++) { + for (size_t y = 0; y < _materialTextureSize; y++) { + for (size_t x = 0; x < _materialTextureSize; x++) { if (y < transitionsTable.size() && x < transitionsTable[y].size()) // If the transition table is not big enough, we fill the rest with black { - QColor color = transitionsTable[y][x]; + const QColor color = transitionsTable[y][x]; data.push_back(color.redF()); data.push_back(color.greenF()); data.push_back(color.blueF()); @@ -622,7 +622,7 @@ void TransferFunctionWidget::cleanup() void TransferFunctionWidget::updatePixelRatio() { - float pixelRatio = devicePixelRatio(); + const float pixelRatio = devicePixelRatio(); // we only update if the ratio actually changed if( _pixelRatio != pixelRatio ) diff --git a/DVRTransferFunction/src/TransferFunctionWidget.h b/DVRTransferFunction/src/TransferFunctionWidget.h index 7b28b7b..00a322f 100644 --- a/DVRTransferFunction/src/TransferFunctionWidget.h +++ b/DVRTransferFunction/src/TransferFunctionWidget.h @@ -47,7 +47,7 @@ class TransferFunctionWidget : public QOpenGLWidget, protected QOpenGLFunctions_ bool isInitialized() const; // This method is public because the UI decides when to update the widget - void updateMaterialTransitionTexture(std::vector> transitionsTable); + void updateMaterialTransitionTexture(const std::vector>& transitionsTable); InteractiveShape* getSelectedObject() { return _selectedObject; } std::vector& getInteractiveShapes() { return _interactiveShapes; } @@ -76,10 +76,6 @@ class TransferFunctionWidget : public QOpenGLWidget, protected QOpenGLFunctions_ void showHighlights(bool show); - mv::Bounds getBounds() const { - return _dataRectangleAction.getBounds(); - } - void setGlobalAlphaToggle(bool useGlobalAlpha); void setGlobalAlphaValue(int globalAlphaValue); @@ -154,8 +150,8 @@ class TransferFunctionWidget : public QOpenGLWidget, protected QOpenGLFunctions_ // Signals when a new shape gets selected and passes a pointer of it void shapeSelected(InteractiveShape* shape); - void shapeCreated(std::vector interactiveShapes); - void shapeDeleted(std::vector interactiveShapes); + void shapeCreated(const std::vector& interactiveShapes); + void shapeDeleted(const std::vector& interactiveShapes); private slots: void updatePixelRatio(); From c392a45168c8c56c921570ddf49ce3623c566de7 Mon Sep 17 00:00:00 2001 From: Alexander Vieth Date: Wed, 25 Mar 2026 16:55:20 +0100 Subject: [PATCH 07/12] More serialization --- DVRVolumeData/DVRVolumeData/VolumeData.cpp | 37 ++++++++++++++++++++++ DVRVolumeData/DVRVolumeData/VolumeData.h | 13 ++++++++ 2 files changed, 50 insertions(+) diff --git a/DVRVolumeData/DVRVolumeData/VolumeData.cpp b/DVRVolumeData/DVRVolumeData/VolumeData.cpp index cd7fe93..9e66a50 100644 --- a/DVRVolumeData/DVRVolumeData/VolumeData.cpp +++ b/DVRVolumeData/DVRVolumeData/VolumeData.cpp @@ -68,6 +68,43 @@ Dataset VolumeData::createDataSet(const QString& guid /*= ""*/) con return Dataset(new Volumes(getName(), false, guid)); } +void VolumeData::fromVariantMap(const QVariantMap& variantMap) +{ + RawData::fromVariantMap(variantMap); + + variantMapMustContain(variantMap, "volumeFilePaths"); + + if (variantMap.contains("volumeSize")) { + const QVariantList volumeSizes = variantMap["volumeSize"].toList(); + _volumeSize = { volumeSizes[0].toInt(), volumeSizes[1].toInt(), volumeSizes[2].toInt() }; + } + + if (variantMap.contains("componentsPerVoxel")) { + _componentsPerVoxel = variantMap["componentsPerVoxel"].value(); + } + + if (variantMap.contains("volumeFilePaths")) { + _volumeFilePaths = variantMap["volumeFilePaths"].toStringList(); + } + + if (variantMap.contains("dimensionNames")) { + _dimensionNames = variantMap["dimensionNames"].toStringList(); + } + +} + +QVariantMap VolumeData::toVariantMap() const +{ + auto variantMap = RawData::toVariantMap(); + + variantMap["volumeSize"] = QVariantList{ _volumeSize.width(), _volumeSize.height(), _volumeSize.depth() }; + variantMap["componentsPerVoxel"] = _componentsPerVoxel; + variantMap["volumeFilePaths"] = _volumeFilePaths; + variantMap["dimensionNames"] = _dimensionNames; + + return variantMap; +} + // ============================================================================= // Extra features for the VolumeData plugin that have not been updated for volume data TODO // ============================================================================= diff --git a/DVRVolumeData/DVRVolumeData/VolumeData.h b/DVRVolumeData/DVRVolumeData/VolumeData.h index d62a048..241b18a 100644 --- a/DVRVolumeData/DVRVolumeData/VolumeData.h +++ b/DVRVolumeData/DVRVolumeData/VolumeData.h @@ -86,6 +86,19 @@ class DVRVOLUMEDATA_EXPORT VolumeData : public mv::plugin::RawData */ mv::Dataset createDataSet(const QString& guid = "") const override; +public: // Serialization + /** + * Load point data from variant map + * @param Variant map representation of the point data + */ + void fromVariantMap(const QVariantMap& variantMap); + + /** + * Save point data to variant map + * @return Variant map representation of the point data + */ + QVariantMap toVariantMap() const; + private: Size3D _volumeSize; /** Volume size */ std::uint32_t _componentsPerVoxel; /** Number of values per voxel */ From 2270a3b30f0a2334df85a124487812a7c72345aa Mon Sep 17 00:00:00 2001 From: Alexander Vieth Date: Wed, 25 Mar 2026 16:55:35 +0100 Subject: [PATCH 08/12] Only include headers we need --- DVRVolumeData/DVRVolumeData/VolumeData.h | 2 +- DVRVolumeData/DVRVolumeData/Volumes.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/DVRVolumeData/DVRVolumeData/VolumeData.h b/DVRVolumeData/DVRVolumeData/VolumeData.h index 241b18a..2cba8ec 100644 --- a/DVRVolumeData/DVRVolumeData/VolumeData.h +++ b/DVRVolumeData/DVRVolumeData/VolumeData.h @@ -5,7 +5,7 @@ #pragma once #include "dvrvolumedata_export.h" -#include "Volume.h" +#include "Size3D.h" #include #include diff --git a/DVRVolumeData/DVRVolumeData/Volumes.h b/DVRVolumeData/DVRVolumeData/Volumes.h index e44acfb..3c90dab 100644 --- a/DVRVolumeData/DVRVolumeData/Volumes.h +++ b/DVRVolumeData/DVRVolumeData/Volumes.h @@ -5,7 +5,6 @@ #pragma once #include "dvrvolumedata_export.h" -#include "Volume.h" #include "VolumeData.h" #include From 86cc79d05c09e39a5a20d2ea6dd3bf50c20d5856 Mon Sep 17 00:00:00 2001 From: Alexander Vieth Date: Wed, 25 Mar 2026 17:51:26 +0100 Subject: [PATCH 09/12] simplify assignment --- DVRTransferFunction/src/InteractiveShape.cpp | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/DVRTransferFunction/src/InteractiveShape.cpp b/DVRTransferFunction/src/InteractiveShape.cpp index a8c394b..c6b33f5 100644 --- a/DVRTransferFunction/src/InteractiveShape.cpp +++ b/DVRTransferFunction/src/InteractiveShape.cpp @@ -16,19 +16,14 @@ InteractiveShape::InteractiveShape(const QPixmap& pixmap, const QRectF& rect, co } void InteractiveShape::draw(QPainter& painter, bool drawBorder, bool useGlobalAlpha, bool normalizeWindow /*true*/, QColor borderColor /* Black */) const { - QRectF adjustedRect; - if (normalizeWindow) { - adjustedRect = getRelativeRect(); - } else { - adjustedRect = getAbsoluteRect(); - } + const QRectF adjustedRect = normalizeWindow ? getRelativeRect() : getAbsoluteRect(); if (drawBorder) { QPen pen(borderColor); pen.setWidth(2); painter.setPen(pen); painter.drawRect(adjustedRect); - QRectF topRightRect(adjustedRect.topRight() - QPointF(_threshold, 0), QSizeF(_threshold, _threshold)); + const QRectF topRightRect(adjustedRect.topRight() - QPointF(_threshold, 0), QSizeF(_threshold, _threshold)); painter.setPen(pen); painter.drawRect(topRightRect); } @@ -43,13 +38,7 @@ void InteractiveShape::draw(QPainter& painter, bool drawBorder, bool useGlobalAl } void InteractiveShape::drawID(QPainter& painter, bool normalizeWindow, int id) const { - QRectF adjustedRect; - if (normalizeWindow) { - adjustedRect = getRelativeRect(); - } - else { - adjustedRect = getAbsoluteRect(); - } + const QRectF adjustedRect = normalizeWindow ? getRelativeRect() : getAbsoluteRect(); painter.setCompositionMode(QPainter::CompositionMode_SourceOver); From 66822d4cea86f480260371fd870debb4320e3f71 Mon Sep 17 00:00:00 2001 From: Alexander Vieth Date: Thu, 26 Mar 2026 09:46:32 +0100 Subject: [PATCH 10/12] Fewer header includes --- DVRTransferFunction/src/TransferFunctionPlugin.cpp | 5 ----- DVRTransferFunction/src/TransferFunctionWidget.cpp | 6 ++---- DVRTransferFunction/src/TransferFunctionWidget.h | 5 ----- DVRViewPlugin/src/DVRViewPlugin.cpp | 6 ++---- DVRViewPlugin/src/DVRViewPlugin.h | 1 - 5 files changed, 4 insertions(+), 19 deletions(-) diff --git a/DVRTransferFunction/src/TransferFunctionPlugin.cpp b/DVRTransferFunction/src/TransferFunctionPlugin.cpp index 2bca6f9..1a57c8c 100644 --- a/DVRTransferFunction/src/TransferFunctionPlugin.cpp +++ b/DVRTransferFunction/src/TransferFunctionPlugin.cpp @@ -6,8 +6,6 @@ #include #include -#include -#include #include #include @@ -23,13 +21,10 @@ #include #include -#include #include #include -#include #include -#include #include #include #include diff --git a/DVRTransferFunction/src/TransferFunctionWidget.cpp b/DVRTransferFunction/src/TransferFunctionWidget.cpp index 052eb59..9e6eae7 100644 --- a/DVRTransferFunction/src/TransferFunctionWidget.cpp +++ b/DVRTransferFunction/src/TransferFunctionWidget.cpp @@ -2,13 +2,13 @@ #include +#include +#include #include #include #include -#include -#include #include #include #include @@ -16,8 +16,6 @@ #include #include -#include - #include "TransferFunctionPlugin.h" using namespace mv; diff --git a/DVRTransferFunction/src/TransferFunctionWidget.h b/DVRTransferFunction/src/TransferFunctionWidget.h index 00a322f..d142f50 100644 --- a/DVRTransferFunction/src/TransferFunctionWidget.h +++ b/DVRTransferFunction/src/TransferFunctionWidget.h @@ -5,11 +5,7 @@ #include -#include - -#include #include -#include #include #include @@ -18,7 +14,6 @@ #include "InteractiveShape.h" #include "ImageData/Images.h" - class TransferFunctionPlugin; using namespace mv::gui; diff --git a/DVRViewPlugin/src/DVRViewPlugin.cpp b/DVRViewPlugin/src/DVRViewPlugin.cpp index 6731af3..0635de8 100644 --- a/DVRViewPlugin/src/DVRViewPlugin.cpp +++ b/DVRViewPlugin/src/DVRViewPlugin.cpp @@ -1,9 +1,9 @@ #include "DVRViewPlugin.h" #include "DVRWidget.h" -#include "GlobalSettingsAction.h" +#include -#include +#include "GlobalSettingsAction.h" #include @@ -12,8 +12,6 @@ #include #include -#include -#include #include Q_PLUGIN_METADATA(IID "studio.manivault.DVRViewPlugin") diff --git a/DVRViewPlugin/src/DVRViewPlugin.h b/DVRViewPlugin/src/DVRViewPlugin.h index b5a466f..534ddf9 100644 --- a/DVRViewPlugin/src/DVRViewPlugin.h +++ b/DVRViewPlugin/src/DVRViewPlugin.h @@ -12,7 +12,6 @@ #include "SettingsAction.h" #include -#include #include /** All plugin related classes are in the ManiVault plugin namespace */ From 9f740453e4ec78cb72d862df2801d8f1ec3d983b Mon Sep 17 00:00:00 2001 From: Alexander Vieth Date: Thu, 26 Mar 2026 10:08:22 +0100 Subject: [PATCH 11/12] Remove unused files --- DVRVolumeData/CMakeLists.txt | 2 - DVRVolumeData/DVRVolumeData/Volume.cpp | 115 ------------------------- DVRVolumeData/DVRVolumeData/Volume.h | 54 ------------ 3 files changed, 171 deletions(-) delete mode 100644 DVRVolumeData/DVRVolumeData/Volume.cpp delete mode 100644 DVRVolumeData/DVRVolumeData/Volume.h diff --git a/DVRVolumeData/CMakeLists.txt b/DVRVolumeData/CMakeLists.txt index 779c43a..c78c362 100644 --- a/DVRVolumeData/CMakeLists.txt +++ b/DVRVolumeData/CMakeLists.txt @@ -18,7 +18,6 @@ find_package(ManiVault COMPONENTS Core PointData CONFIG QUIET) # Source files # ----------------------------------------------------------------------------- set(VOLUME_DATA_HEADERS - DVRVolumeData/Volume.h DVRVolumeData/VolumeData.h DVRVolumeData/Volumes.h DVRVolumeData/Size3D.h @@ -27,7 +26,6 @@ set(VOLUME_DATA_HEADERS ) set(VOLUME_DATA_SOURCES - DVRVolumeData/Volume.cpp DVRVolumeData/VolumeData.cpp DVRVolumeData/Volumes.cpp ) diff --git a/DVRVolumeData/DVRVolumeData/Volume.cpp b/DVRVolumeData/DVRVolumeData/Volume.cpp deleted file mode 100644 index 3c0818b..0000000 --- a/DVRVolumeData/DVRVolumeData/Volume.cpp +++ /dev/null @@ -1,115 +0,0 @@ -// SPDX-License-Identifier: LGPL-3.0-or-later -// A corresponding LICENSE file is located in the root directory of this source tree -// Copyright (C) 2023 BioVault (Biomedical Visual Analytics Unit LUMC - TU Delft) - -#include "Volume.h" - -Volume::Volume(const Size3D& size, const std::uint32_t& noComponents, const QString& volumeFilePath) : - _data(), - _size(size), - _noComponents(noComponents), - _volumeFilePath(volumeFilePath), - _dimensionName() -{ - setSize(size); -} - -std::uint16_t* Volume::data() -{ - return _data.data(); -} - -Size3D Volume::size() const -{ - return _size; -} - -void Volume::setSize(const Size3D& size) -{ - if (size == _size) - return; - - _size = size; - - _data.resize(noElements()); -} - -std::uint32_t Volume::width() const -{ - return _size.width(); -} - -std::uint32_t Volume::height() const -{ - return _size.height(); -} - -std::uint32_t Volume::depth() const -{ - return _size.depth(); -} - -std::uint32_t Volume::noComponents() const -{ - return _noComponents; -} - -std::uint32_t Volume::noVoxels() const -{ - return _size.width() * _size.height() * _size.depth(); -} - -std::uint32_t Volume::noElements() const -{ - return noVoxels() * _noComponents; -} - -std::uint32_t Volume::voxelIndex(const std::uint32_t& x, const std::uint32_t& y, const std::uint32_t& z) const -{ - return (z * _size.width() * _size.height()) + (y * _size.width()) + x; -} - -void Volume::getVoxel(const std::uint32_t& x, const std::uint32_t& y, const std::uint32_t& z, std::uint16_t* voxel) const -{ - const auto startVoxelIndex = voxelIndex(x, y, z) * _noComponents; - - for (std::uint32_t c = 0; c < _noComponents; c++) - { - voxel[c] = static_cast(_data[startVoxelIndex + c]); - } -} - -void Volume::setVoxel(const std::uint32_t& x, const std::uint32_t& y, const std::uint32_t& z, const std::uint16_t* voxel) -{ - const auto startVoxelIndex = voxelIndex(x, y, z) * _noComponents; - - for (std::uint32_t c = 0; c < _noComponents; c++) - { - _data[startVoxelIndex + c] = voxel[c]; - } -} - -void Volume::toFloatVector(std::vector& voxels) const -{ - voxels.reserve(noElements()); - - for (std::uint32_t i = 0; i < noElements(); i++) - { - voxels.push_back(static_cast(_data[i])); - } -} - -QString Volume::volumeFilePath() const -{ - return _volumeFilePath; -} - -QString Volume::dimensionName() const -{ - return _dimensionName; -} - -void Volume::setDimensionName(const QString& dimensionName) -{ - _dimensionName = dimensionName; -} diff --git a/DVRVolumeData/DVRVolumeData/Volume.h b/DVRVolumeData/DVRVolumeData/Volume.h deleted file mode 100644 index ffffc45..0000000 --- a/DVRVolumeData/DVRVolumeData/Volume.h +++ /dev/null @@ -1,54 +0,0 @@ -// SPDX-License-Identifier: LGPL-3.0-or-later -// A corresponding LICENSE file is located in the root directory of this source tree -// Copyright (C) 2023 BioVault (Biomedical Visual Analytics Unit LUMC - TU Delft) - -#pragma once - -#include "dvrvolumedata_export.h" -#include "Size3D.h" - -#include -#include -#include - -#include - -class DVRVOLUMEDATA_EXPORT Volume -{ -public: - Volume(const Size3D& size, const std::uint32_t& noComponents, const QString& volumeFilePath); - - std::uint16_t* data(); - Size3D size() const; - void setSize(const Size3D& size); - std::uint32_t width() const; - std::uint32_t height() const; - std::uint32_t depth() const; - std::uint32_t noComponents() const; - QString volumeFilePath() const; - QString dimensionName() const; - void setDimensionName(const QString& dimensionName); - - std::uint32_t noVoxels() const; - std::uint32_t noElements() const; - std::uint32_t voxelIndex(const std::uint32_t& x, const std::uint32_t& y, const std::uint32_t& z) const; - - void getVoxel(const std::uint32_t& x, const std::uint32_t& y, const std::uint32_t& z, std::uint16_t* voxel) const; - void setVoxel(const std::uint32_t& x, const std::uint32_t& y, const std::uint32_t& z, const std::uint16_t* voxel); - - void toFloatVector(std::vector& voxels) const; - -private: - std::vector _data; - Size3D _size; - std::uint32_t _noComponents; - QString _volumeFilePath; - QString _dimensionName; -}; - -inline QDebug operator<<(QDebug dbg, Volume& volume) -{ - dbg << QString("Volume %1x%2x%3, %4 components").arg(QString::number(volume.width()), QString::number(volume.height()), QString::number(volume.depth()), QString::number(volume.noComponents())); - - return dbg; -} From 1d497e9f260e3cdf78c8a663e7b93fd889b8ab93 Mon Sep 17 00:00:00 2001 From: Alexander Vieth Date: Thu, 26 Mar 2026 10:08:40 +0100 Subject: [PATCH 12/12] Fix conversion warning --- DVRViewPlugin/src/VolumeRenderer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DVRViewPlugin/src/VolumeRenderer.cpp b/DVRViewPlugin/src/VolumeRenderer.cpp index a60557d..c41a21b 100644 --- a/DVRViewPlugin/src/VolumeRenderer.cpp +++ b/DVRViewPlugin/src/VolumeRenderer.cpp @@ -341,7 +341,7 @@ void VolumeRenderer::normalizePositionData(std::vector& positionData) if (_renderMode == RenderMode::MaterialTransition_2D || _renderMode == RenderMode::NN_MaterialTransition || _renderMode == RenderMode::Alt_NN_MaterialTransition || _renderMode == RenderMode::MaterialTransition_FULL) size = _materialPositionDataset->getImageSize().width(); - for (int i = 0; i < positionData.size(); i += 2) + for (size_t i = 0; i < positionData.size(); i += 2) { positionData[i] = ((positionData[i] - minX) / rangeX) * (size - 1); positionData[i + 1] = ((positionData[i + 1] - minY) / rangeY) * (size - 1);