Skip to content

Commit

Permalink
reduce duplicate code
Browse files Browse the repository at this point in the history
  • Loading branch information
alxvth committed Dec 3, 2024
1 parent 674767b commit fbabdf8
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions ManiVault/src/plugins/ImageData/src/Images.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,9 @@ void Images::computeMaskData()
if (_maskData.size() != getNumberOfPixels())
_maskData.resize(getNumberOfPixels());

// All masked by default
std::fill(_maskData.begin(), _maskData.end(), 0);

// Get reference to input dataset
auto inputDataset = getParent();

Expand All @@ -692,9 +695,6 @@ void Images::computeMaskData()
// Get global indices from points
points->getGlobalIndices(globalIndices);

// All masked by default
std::fill(_maskData.begin(), _maskData.end(), 0);

// Loop over all point indices and unmask them
points->visitData([this, &points, &globalIndices](auto pointData) {
for (std::int32_t localPointIndex = 0; localPointIndex < globalIndices.size(); localPointIndex++) {
Expand Down Expand Up @@ -731,9 +731,6 @@ void Images::computeMaskData()
// Obtain reference to the clusters dataset
auto clusters = Dataset<Clusters>(inputDataset);

// Mask out all points
std::fill(_maskData.begin(), _maskData.end(), 0);

// Get clusters input points dataset
auto points = clusters->getParent()->getSourceDataset<Points>();
auto embedding = clusters->getParent();
Expand Down

0 comments on commit fbabdf8

Please sign in to comment.