                                 labelPosition.z(), labelPosition.w());
     int index = static_cast<int>(labelPosition.y()) +
                 static_cast<int>(labelPosition.z()) * imageSize;
-    std::cout << index << " -> " << labelPosition.x() << std::endl;
     pixelIndexToLabelId[index] = labelPosition.x();
   }
 

    {
      if (extractedIndices.insert(uniqueIndex).second)
      {
        std::cout << "Extracted index: " << uniqueIndex << std::endl;
        insertionOrder.push_front(pixelIndexToLabelId[uniqueIndex]);
      }
    }

      orderedIndicesPtr);

  HANDLE_ERROR(cudaThreadSynchronize());

  thrust::device_vector<int>::iterator it_found =
      thrust::unique(orderedIndices.begin(), orderedIndices.end());
  thrust::host_vector<int> uniqueIndices(orderedIndices.begin(), it_found);
