Skip to content

Conversation

@alxvth
Copy link
Contributor

@alxvth alxvth commented Oct 30, 2025

ScatterplotPlugin::loadColors can handle the case when the shown point data and the incoming clusters are derived data.
This occurs for example when you want to drop a cluster data on an HSNE refinement (and the clusters were defined wrt to the point data that the HSNE is based on)

We should allow this case when dropping clusters into the widget using the same number-of-point-checking logic.

void ScatterplotPlugin::loadColors(const Dataset<Clusters>& clusters)
{
// Only proceed with valid clusters and position dataset
if (!clusters.isValid() || !_positionDataset.isValid())
return;
// Get global indices from the position dataset
int totalNumPoints = 0;
if (_positionDataset->isDerivedData())
totalNumPoints = _positionSourceDataset->getFullDataset<Points>()->getNumPoints();
else
totalNumPoints = _positionDataset->getFullDataset<Points>()->getNumPoints();
// Mapping from local to global indices

@alxvth alxvth requested a review from JulianThijssen October 30, 2025 14:14
@alxvth
Copy link
Contributor Author

alxvth commented Oct 31, 2025

I've cherry-picked this into the release/core_bican_bg/bican_bg branch so that it can land in an installer. (One of the bican projects needs this fix)

@alxvth alxvth merged commit dd545e1 into master Oct 31, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants