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

Fill buffer of itk image to zero in ImageContainerByITKImage.ih #1307

Merged
merged 1 commit into from
Feb 13, 2018

Conversation

phcerdan
Copy link
Member

@phcerdan phcerdan commented Feb 8, 2018

PR Description

When creating an ImageContainerByITKImage using the domain constructor, fill to zero the itk image buffer.

Discovered using:

    using Domain = Z3i::Domain ;
    using Image = ImageContainerByITKImage<Domain, unsigned char> ;
    unsigned int foreground_value = 255;
    auto thin_image = ImageFromSet<Image>::create(thin_set, foreground_value);
    typedef itk::ImageFileWriter<Image::ITKImage> ITKImageWriter;
    typename ITKImageWriter::Pointer writer = ITKImageWriter::New();
    writer->SetFileName("my_image.nrrd");
    writer->SetInput(thin_image.getITKImagePointer());
    writer->Update();

ImageFromSet::create uses the domain constructor, and the image isn't initialized to zero in the case of ImageContainerByITKImage.

Checklist

  • [NA] Unit-test of your feature with Catch.
  • [NA] Doxygen documentation of the code completed (classes, methods, types, members...)
  • [NA] Documentation module page added or updated.
  • New entry in the ChangeLog.md added.
  • No warning raised in Debug cmake mode (otherwise, Travis C.I. will fail).
  • All continuous integration tests pass (Travis & appveyor)

@dcoeurjo
Copy link
Member

Thanks. Merging this PR.

@dcoeurjo dcoeurjo merged commit 93ce345 into DGtal-team:master Feb 13, 2018
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.

2 participants