Skip to content

Commit

Permalink
Use DataStream in TIFFImagePyramidExporter
Browse files Browse the repository at this point in the history
  • Loading branch information
smistad committed Aug 15, 2023
1 parent 829e385 commit 7320976
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions source/FAST/Examples/DataImport/streamUFFData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ int main(int argc, char** argv) {

auto renderer = ImageRenderer::create()->connect(interleave);

auto window = SimpleWindow2D::create(Color::Black())
SimpleWindow2D::create(Color::Black())
->connect(renderer)
->connect(widget);
window->run();
->connect(widget)
->run();
}
8 changes: 4 additions & 4 deletions source/FAST/Exporters/TIFFImagePyramidExporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,17 +120,17 @@ void TIFFImagePyramidExporter::execute() {
1.0f / (spacing.y() / 10) * scaleY); // Convert to cm, and adjust for level
}

std::cout << "starting patch gen" << std::endl;
auto generator = PatchGenerator::New();
generator->setInputData(imagePyramid);
generator->setPatchLevel(level);
generator->setPatchSize(imagePyramid->getLevelTileWidth(level), imagePyramid->getLevelTileHeight(level));
auto port = generator->getOutputPort();
auto stream = DataStream(generator);

Image::pointer image;
int counter = 0;
do {
generator->update();
image = port->getNextFrame<Image>();
while(!stream.isDone()) {
image = stream.getNextFrame<Image>();

// Write tile to tiff level
if(image->getWidth() != imagePyramid->getLevelTileWidth(level) || image->getHeight() != imagePyramid->getLevelTileHeight(level)) {
Expand Down

0 comments on commit 7320976

Please sign in to comment.