Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(VC) Add support for algorithms which propagate in -Z #26

Open
csparker247 opened this issue May 19, 2023 · 1 comment
Open

(VC) Add support for algorithms which propagate in -Z #26

csparker247 opened this issue May 19, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@csparker247
Copy link
Member

I recommend updating this function as well.
added bonus:
-Compatible with backwards segmentation
-Not deleting segmentation process above current segmentation job
-Displaying target segmentation layer when finishing the segmentation job.

void CWindow::onSegmentationFinished(Segmenter::PointSet ps)
{
    setWidgetsEnabled(true);
    worker_progress_updater_.stop();
    worker_progress_.close();
    // 3) concatenate the two parts to form the complete point cloud
    // find starting location in fMasterCloud
    int i;
    for (i= 0; i < fMasterCloud.height(); i++) {
        auto masterRowI = fMasterCloud.getRow(i);
        if (ps[0][2] <= masterRowI[fUpperPart.width()-1][2]){
            break;
        }
    }

    // remove the duplicated point and ps in their stead. if i at the end, no duplicated point, just append
    fUpperPart = fMasterCloud.copyRows(0, i);
    fUpperPart.append(ps);

    // check if remaining rows already exist in fMasterCloud behind ps
    for(; i < fMasterCloud.height(); i++) {
        auto masterRowI = fMasterCloud.getRow(i);
        if (ps[ps.size() - 1][2] < masterRowI[fUpperPart.width()-1][2]) {
            break;
        }
    }
    // add the remaining rows
    if (i < fMasterCloud.height()) {
        fUpperPart.append(fMasterCloud.copyRows(i, fMasterCloud.height()));
    }

    fMasterCloud = fUpperPart;

    statusBar->showMessage(tr("Segmentation complete"));
    fVpkgChanged = true;

    // set display to target layer
    fPathOnSliceIndex = fSegParams.targetIndex;
    CleanupSegmentation();
    UpdateView();
}

Originally posted by @schillij95 in #25 (comment)

@csparker247 csparker247 added the enhancement New feature or request label May 19, 2023
@csparker247
Copy link
Member Author

I'm not sure if this is the way we ultimately want to approach this problem, but it's a start. The parts about removing duplicated points should be irrelevant after #25 is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant