Skip to content

Fix bug in IterateRegionWithAccessToIndexWithoutWriteAccess #270

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

Closed
brad-t-moore opened this issue Apr 2, 2021 · 4 comments
Closed

Fix bug in IterateRegionWithAccessToIndexWithoutWriteAccess #270

brad-t-moore opened this issue Apr 2, 2021 · 4 comments

Comments

@brad-t-moore
Copy link
Contributor

region.SetIndex(regionIndex);
itk::ImageRegionConstIteratorWithIndex<ImageType> imageIterator(image, image->GetLargestPossibleRegion());
while (!imageIterator.IsAtEnd())
{
std::cout << "Index: " << imageIterator.GetIndex() << " value: " << (int)imageIterator.Get() << std::endl;
++imageIterator;
}

I'll submit a bug fix after I get my first PR through. This ignores the set region and uses LargestPossibleRegion(), resulting in the entire image being output line per pixel during CI testing (in the logs). Greatly clutters the CI logs.

@dzenanz
Copy link
Member

dzenanz commented Apr 2, 2021

I think there might be other instances of cluttering the logs.

@brad-t-moore
Copy link
Contributor Author

Well, this one test takes up 80% of the entire log.

@dzenanz
Copy link
Member

dzenanz commented Apr 2, 2021

Uh-uh, I guess everyone before you was being fooled by this seemingly small region definition:

@brad-t-moore
Copy link
Contributor Author

Yeah, I think it was meant to use that defined region, and another similarly named test uses the region correctly.

brad-t-moore added a commit to brad-t-moore/ITKExamples that referenced this issue Apr 6, 2021
DOC: Changed cookiecutter to put Python link first
DOC: Changed CalculateImageMoments to put Python link first
BUG: Removed extraneous lines in CMakeLists refering to output_image
ENH: Changed cookiecutter to use argparse for print_usage
ENH: Changed CalculateImageMoments to use argparse for print_usage
BUG: Fixed IterateRegionWithAccessToIndexWithoutWriteAccess/Code.cxx to use defined region instead of LargestPossibleRegion (Closes InsightSoftwareConsortium#270)
thewtex pushed a commit to brad-t-moore/ITKExamples that referenced this issue May 18, 2021
DOC: Changed cookiecutter to put Python link first
DOC: Changed CalculateImageMoments to put Python link first
BUG: Removed extraneous lines in CMakeLists refering to output_image
ENH: Changed cookiecutter to use argparse for print_usage
ENH: Changed CalculateImageMoments to use argparse for print_usage
BUG: Fixed IterateRegionWithAccessToIndexWithoutWriteAccess/Code.cxx to use defined region instead of LargestPossibleRegion (Closes InsightSoftwareConsortium#270)
brad-t-moore added a commit to brad-t-moore/ITKExamples that referenced this issue May 26, 2021
DOC: Changed cookiecutter to put Python link first
DOC: Changed CalculateImageMoments to put Python link first
BUG: Removed extraneous lines in CMakeLists refering to output_image
ENH: Changed cookiecutter to use argparse for print_usage
ENH: Changed CalculateImageMoments to use argparse for print_usage
BUG: Fixed IterateRegionWithAccessToIndexWithoutWriteAccess/Code.cxx to use defined region instead of LargestPossibleRegion (Closes InsightSoftwareConsortium#270)
@dzenanz dzenanz closed this as completed in 8387c87 Jun 2, 2021
brad-t-moore added a commit to brad-t-moore/ITKExamples that referenced this issue Jun 3, 2021
DOC: Changed cookiecutter to put Python link first
DOC: Changed CalculateImageMoments to put Python link first
BUG: Removed extraneous lines in CMakeLists refering to output_image
ENH: Changed cookiecutter to use argparse for print_usage
ENH: Changed CalculateImageMoments to use argparse for print_usage
BUG: Fixed IterateRegionWithAccessToIndexWithoutWriteAccess/Code.cxx to use defined region instead of LargestPossibleRegion (Closes InsightSoftwareConsortium#270)

Added ellipse.png.sha512 so that the image would render.  Fixed whitespace and syntax issues with .rst.
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

No branches or pull requests

2 participants