-
Notifications
You must be signed in to change notification settings - Fork 116
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
Pull request 52 (ReducedFullSampler) updated #1064
base: main
Are you sure you want to change the base?
Conversation
… groupwise registration.
This is necessary in order to make the CI at github.com/SuperElastix/elastix happy.
This work was originally "based" on commit 2ec22d0 "VER: increased to 4.900 in preparation of release", 2018-03-19. The code is adjusted to make it compile on the latest revision of the main branch: - IsInside is replaced with IsInsideInWorldSpace - Obsolete typedefs inherited from Superclass2 were removed - An elxOverrideGetSelfMacro call is added
Fixed macos-12/clang warnings like: > warning: 'SelectNewSamplesOnUpdate' overrides a member function but is not marked 'override' [-Winconsistent-missing-override] From https://my.cdash.org/viewBuildError.php?type=1&buildid=2507427
InputImageIndexType index = this->GetCroppedInputImageRegion().GetIndex(); | ||
index[ReducedInputImageDimension] = 0; | ||
InputImageSizeType size = this->GetCroppedInputImageRegion().GetSize(); | ||
size[ReducedInputImageDimension] = 1; | ||
InputImageRegionType region; | ||
region.SetIndex(index); | ||
region.SetSize(size); | ||
InputImageIterator iter(inputImage, region); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appears to be the essential part, compared to the "non-reduced" FullSampler. Looks like seven lines of code could be simplified to the following three:
InputImageRegionType region = this->GetCroppedInputImageRegion();
region.SetIndex(ReducedInputImageDimension, 0);
region.SetSize(ReducedInputImageDimension, 1);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MathiasPolfliet @mstaring @stefanklein Is it really necessary for the "reduced" sampler to do index[ReducedInputImageDimension] = 0
? Or would it be sufficient to only adjust the size, and leave the index alone?
I'm asking, because ITK allows specifying start index of the buffered region of an image to be non-zero. So an index value of zero may be outside the buffered region. Trying to retrieve samples outside the buffered region might cause crashes. So if it is sufficient for the "reduced" sampler to only adjust the size, I would prefer to leave the index alone.
Another option might be something like:
// Instead of index[ReducedInputImageDimension] = 0
index[ReducedInputImageDimension] = bufferedRegion.GetIndex(ReducedInputImageDimension);
But I wonder if that's useful/necessary.
Comparing ReducedFullSampler and FullSampler, based on the original code at commit 2ec22d0 "VER: increased to 4.900 in preparation of release" (2018): elxReducedFullSampler.h vs elxFullSampler.h
elxReducedFullSampler.h vs elxFullSampler.h
elxReducedFullSampler.cxx vs elxFullSampler.cxx
itkReducedFullSampler.h vs itkFullSampler.h
itkReducedFullSampler.hxx vs itkFullSampler.hxx
|
Some comments:
@MathiasPolfliet @mstaring @stefanklein Instead of this proposed new component, "ReducedFullSampler" wouldn't it be better to just add support for a new parameter, |
main
branch.Other pull requests from Mathias, currently at https://github.com/SuperElastix/elastix/pulls?q=is%3Apr+is%3Aclosed+author%3AMathiasPolfliet+:
The code of the original pull requests was locally retrieved by
git fetch origin pull/ID/head:BRANCH_NAME
, as described at GitHub Docs - Checking out pull requests locally. The other two new branches based on those old pull request are: