-
-
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
Itk image origin fix #1484
Itk image origin fix #1484
Conversation
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.
Thanks for the PR. Minor comment
Co-authored-by: David Coeurjolly <[email protected]>
I am getting crashes because of this, and I fear this is partly wrong. Before this patch, they were in the Index Space, after this patch, there is a mixture between Index Space and Physical Space. @kerautret could you provide a minimal example that fails and this patch solves it? I think this patch should be reverted. |
The patch DGtal-team#1484 mixes index space and physical space (with origins) in ITK. The iterators work on regions, defined by an `index` and a `size`. Metadata, like origin, that is defined in the physical space, cannot be mixed there. Revert DGtal-team#1484
The patch DGtal-team#1484 mixes index space and physical space (with origins) in ITK. The iterators work on regions, defined by an `index` and a `size`. Metadata, like origin, that is defined in the physical space, cannot be mixed there. Revert DGtal-team#1484
Allowing to shift the domain, without affecting the indexing of the underlying ITK image. Also add basic conversions from index points to physical points. The `domainShift` parameter can only be set with the existing function`updateDomain`. It defaults to `Zero`. The implementation provided in DGtal-team#1484 was untested, and I would say it goes out of the buffer of the ITK region when using `operator()` or `setValue`. This patch introduces a conversion function between what I call a `domainPoint` (a point in the DGtal domain defined by `lowerBound` and `upperBound`), and an `indexPoint` which is a valid point in the ITK region. These two are equivalent when `domainShift` is Zero (the default).
Allowing to shift the domain, without affecting the indexing of the underlying ITK image. Also add basic conversions from index points to physical points. The `domainShift` parameter can only be set with the existing function`updateDomain`. It defaults to `Zero`. The implementation provided in DGtal-team#1484 was untested, and I would say it goes out of the buffer of the ITK region when using `operator()` or `setValue`. This patch introduces a conversion function between what I call a `domainPoint` (a point in the DGtal domain defined by `lowerBound` and `upperBound`), and an `indexPoint` which is a valid point in the ITK region. These two are equivalent when `domainShift` is Zero (the default).
Allowing to shift the domain, without affecting the indexing of the underlying ITK image. Also add basic conversions from index points to physical points. The `domainShift` parameter can only be set with the existing function`updateDomain`. It defaults to `Zero`. The implementation provided in DGtal-team#1484 was untested, and I would say it goes out of the buffer of the ITK region when using `operator()` or `setValue`. This patch introduces a conversion function between what I call a `domainPoint` (a point in the DGtal domain defined by `lowerBound` and `upperBound`), and an `indexPoint` which is a valid point in the ITK region. These two are equivalent when `domainShift` is Zero (the default).
Allowing to shift the domain, without affecting the indexing of the underlying ITK image. Also add basic conversions from index points to physical points. The `domainShift` parameter can only be set with the existing function`updateDomain`. It defaults to `Zero`. The implementation provided in DGtal-team#1484 was untested, and I would say it goes out of the buffer of the ITK region when using `operator()` or `setValue`. This patch introduces a conversion function between what I call a `domainPoint` (a point in the DGtal domain defined by `lowerBound` and `upperBound`), and an `indexPoint` which is a valid point in the ITK region. These two are equivalent when `domainShift` is Zero (the default).
Allowing to shift the domain, without affecting the indexing of the underlying ITK image. Also add basic conversions from index points to physical points. The `domainShift` parameter can only be set with the existing function`updateDomain`. It defaults to `Zero`. The implementation provided in DGtal-team#1484 was untested, and I would say it goes out of the buffer of the ITK region when using `operator()` or `setValue`. This patch introduces a conversion function between what I call a `domainPoint` (a point in the DGtal domain defined by `lowerBound` and `upperBound`), and an `indexPoint` which is a valid point in the ITK region. These two are equivalent when `domainShift` is Zero (the default). It also effectively reverts DGtal-team#1484 that mixes index space and physical space (with origins) in ITK.
Allowing to shift the domain, without affecting the indexing of the underlying ITK image. Also add basic conversions from index points to physical points. The `domainShift` parameter can only be set with the existing function`updateDomain`. It defaults to `Zero`. The implementation provided in DGtal-team#1484 was untested, and I would say it goes out of the buffer of the ITK region when using `operator()` or `setValue`. This patch introduces a conversion function between what I call a `domainPoint` (a point in the DGtal domain defined by `lowerBound` and `upperBound`), and an `indexPoint` which is a valid point in the ITK region. These two are equivalent when `domainShift` is Zero (the default). It also effectively reverts DGtal-team#1484 that mixes index space and physical space (with origins) in ITK.
Allowing to shift the domain, without affecting the indexing of the underlying ITK image. Also add basic conversions from index points to physical points. The `domainShift` parameter can only be set with the existing function`updateDomain`. It defaults to `Zero`. The implementation provided in DGtal-team#1484 was untested, and I would say it goes out of the buffer of the ITK region when using `operator()` or `setValue`. This patch introduces a conversion function between what I call a `domainPoint` (a point in the DGtal domain defined by `lowerBound` and `upperBound`), and an `indexPoint` which is a valid point in the ITK region. These two are equivalent when `domainShift` is Zero (the default). It also effectively reverts DGtal-team#1484 that mixes index space and physical space (with origins) in ITK.
Allowing to shift the domain, without affecting the indexing of the underlying ITK image. Also add basic conversions from index points to physical points. The `domainShift` parameter can only be set with the existing function`updateDomain`. It defaults to `Zero`. The implementation provided in DGtal-team#1484 was untested, and I would say it goes out of the buffer of the ITK region when using `operator()` or `setValue`. This patch introduces a conversion function between what I call a `domainPoint` (a point in the DGtal domain defined by `lowerBound` and `upperBound`), and an `indexPoint` which is a valid point in the ITK region. These two are equivalent when `domainShift` is Zero (the default). It also effectively reverts DGtal-team#1484 that mixes index space and physical space (with origins) in ITK.
Allowing to shift the domain, without affecting the indexing of the underlying ITK image. Also add basic conversions from index points to physical points. The `domainShift` parameter can only be set with the existing function`updateDomain`. It defaults to `Zero`. The implementation provided in DGtal-team#1484 was untested, and I would say it goes out of the buffer of the ITK region when using `operator()` or `setValue`. This patch introduces a conversion function between what I call a `domainPoint` (a point in the DGtal domain defined by `lowerBound` and `upperBound`), and an `indexPoint` which is a valid point in the ITK region. These two are equivalent when `domainShift` is Zero (the default). It also effectively reverts DGtal-team#1484 that mixes index space and physical space (with origins) in ITK.
PR Description
Fix origin image that was not taken into account in class ImageContainerByITKImage.
(all ITK images were always shifted with origin (0,0,0))
Checklist
cmake
mode (otherwise, Travis C.I. will fail).