-
Notifications
You must be signed in to change notification settings - Fork 118
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
ADD: Addition of point to surface metric to elastix. #236
base: main
Are you sure you want to change the base?
Conversation
Thank you Gokhan @gokhangg I just retrieved your work by cloning github.com/gokhangg/elastix.git and did an initial build. Everything builds fine, also on my laptop. 😃 However, it appears that your work is not included with the compilation! Do you still have a CMakeLists.txt that should be added, or a modification to an existing elastix CMake file? |
"However, it appears that your work is not included with the compilation! Do you still have a CMakeLists.txt that should be added, or a modification to an existing elastix CMake file?" Could not get here, could you please clarify? |
Your "elxPointToSurfaceDistanceMetric.cxx"should be compiled when elastix is built, right? Does it actually get compiled on your computer? When you deliberately make a syntax error in your cxx file, for example by typing |
I think you should add a "CMakeLists.txt" to the directory of your metric, having something like this:
Also I think the directory of your metric should be renamed to "PointToSurfaceDistanceMetric" (by adding the word "Metric"), otherwise I still get build errors. |
Hi Niels, I have checked this issue and it seems that the .gitignore blocks uploading cmake related files. |
Wow, well spotted! I'll remove "cmake*" from the ignore-list, thanks! |
Having cmake* in there stopped Gokhan Gunay from adding his CMakeLists file to pull request #236 (Addition of PointToSurface metric).
@gokhangg Could you please still try to add your CMakeLists to your branch, using the git option "--force"? Something like this, if I understand correctly:
As I read at https://stackoverflow.com/questions/24844782/how-to-override-a-rule-set-in-gitignore |
Sure I can indeed bypass the ignore but just wanted to inform you. After the pull for the cmake fix, could you inform me then I will update my request? |
Having cmake* in there stopped Gokhan Gunay from adding his CMakeLists file to pull request #236 (Addition of PointToSurface metric).
OK, I removed "cmake*" from .gitignore (pull request #239). Can you please add your CMakeLists.txt to your pull request? |
Sure |
b8befdd
to
0875d28
Compare
You can merge now ;) |
Components/Metrics/PointToSurfaceDistance/elxPointToSurfaceDistanceMetric.h
Outdated
Show resolved
Hide resolved
Components/Metrics/PointToSurfaceDistance/elxPointToSurfaceDistanceMetric.cxx
Outdated
Show resolved
Hide resolved
Can we copy from other files? I think should be the same ?? |
Components/Metrics/PointToSurfaceDistance/elxPointToSurfaceDistanceMetric.h
Outdated
Show resolved
Hide resolved
Components/Metrics/PointToSurfaceDistance/elxPointToSurfaceDistanceMetric.h
Outdated
Show resolved
Hide resolved
Components/Metrics/PointToSurfaceDistance/itkPointToSurfaceDistanceMetric.h
Outdated
Show resolved
Hide resolved
51e0505
to
8bf1e4b
Compare
Components/Metrics/PointToSurfaceDistance/itkPointToSurfaceDistanceMetric.h
Outdated
Show resolved
Hide resolved
Components/Metrics/PointToSurfaceDistance/elxPointToSurfaceDistanceMetric.h
Outdated
Show resolved
Hide resolved
/** Run-time type information (and related methods). */ | ||
itkTypeMacro( PointToSurfaceDistanceMetric, SingleValuedPointSetToPointSetMetric );//OK | ||
/** Initialize. */ | ||
virtual void Initialize() noexcept(false); |
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.
I see you marked some member functions noexcept(false)
, indicating that they might throw an exception. Why would you do so? When I use noexcept
, it's usually just to indicate that a function does not throw.
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.
Fixed.
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.
@gokhangg Thanks for your patience. I still see noexcept(false)
five times in your proposal. Would you want to remove these as well? Or do they have a special reason?
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.
All removed
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.
All removed
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 @gokhangg Nowadays I think it's better to only use noexcept
when the benefit is really clear (which is clearly the case for move-constructors and move-assignment operators). But other people think otherwise... For your information, I did a little lightning talk about noexcept
at the conference C++ on Sea, two years ago https://www.youtube.com/watch?v=dVRLp-Rwg0k regarding my noexcept benchmark
8fb3f85
to
a46c55d
Compare
|
Hi Marius @mstaring I gave a comment, is it possible to check if it is in the correct condition? |
@gokhangg Can you possibly squash all (four) commits of your pull request together, to make it one single commit?
An then replace "pick" on the second and subsequent commits with "squash": https://stackoverflow.com/questions/5189560/squash-my-last-x-commits-together-using-git And then |
Replaced `_ELASTIX_BUILD_LIBRARY` preprocessor definition by static member function, `BaseComponent::IsElastixLibrary()`. Anticipates sharing the intermediate binary object files between the Elastix executable and the Elastix library, possibly building them within the same project, or the same (Visual Studio) solution. Addition of PointToSurface metric COMP: Remove cmake* from .gitignore Having cmake* in there stopped Gokhan Gunay from adding his CMakeLists file to pull request SuperElastix#236 (Addition of PointToSurface metric). Addition of PointToSurface metric
Replaced `_ELASTIX_BUILD_LIBRARY` preprocessor definition by static member function, `BaseComponent::IsElastixLibrary()`. Anticipates sharing the intermediate binary object files between the Elastix executable and the Elastix library, possibly building them within the same project, or the same (Visual Studio) solution. Addition of PointToSurface metric COMP: Remove cmake* from .gitignore Having cmake* in there stopped Gokhan Gunay from adding his CMakeLists file to pull request SuperElastix#236 (Addition of PointToSurface metric). Addition of PointToSurface metric
@N-Dekker Hi Niels there are some conflicts popped up after squashing the middle-commits. So seems that there is a discrepancy between my fork and the superelastix::develop branch. So shall we resolve the conflicts manually? |
COMP: Remove cmake* from .gitignore Having cmake* in there stopped Gokhan Gunay from adding his CMakeLists file to pull request SuperElastix#236 (Addition of PointToSurface metric). Addition of PointToSurface metric ADD: Addition of point to surface metric to Elastix. In this commit addition of point to surface metric is done. This metric essentially considers how surface of an masked organ is aligned with the points provided from the surface of the organ. Therefore, it is used to improve alignment of the organ under interest.
Oh no... git happening 😢 Should any of those conflicting files be adjusted by your pull request? I mean, did you intend to propose changes to any of those files? |
@gokhangg It would be wonderful if you could fix the git conflicts. But you probably need a lot of "git magic" to get it right. It might be easier to just create a new branch from the latest SuperElastix/elastix "develop", and create a new pull request. (Don't feel bad... git happens 😸) I leave it up to you. |
@N-Dekker ACtually those changed files are coming from other places not in this PR. I will try to solve it. |
Having cmake* in there stopped Gokhan Gunay from adding his CMakeLists file to pull request SuperElastix#236 (Addition of PointToSurface metric).
COMP: Remove cmake* from .gitignore Having cmake* in there stopped Gokhan Gunay from adding his CMakeLists file to pull request SuperElastix#236 (Addition of PointToSurface metric). Addition of PointToSurface metric
Replaced `_ELASTIX_BUILD_LIBRARY` preprocessor definition by static member function, `BaseComponent::IsElastixLibrary()`. Anticipates sharing the intermediate binary object files between the Elastix executable and the Elastix library, possibly building them within the same project, or the same (Visual Studio) solution. Addition of PointToSurface metric COMP: Remove cmake* from .gitignore Having cmake* in there stopped Gokhan Gunay from adding his CMakeLists file to pull request SuperElastix#236 (Addition of PointToSurface metric). Addition of PointToSurface metric
COMP: Remove cmake* from .gitignore Having cmake* in there stopped Gokhan Gunay from adding his CMakeLists file to pull request SuperElastix#236 (Addition of PointToSurface metric). Addition of PointToSurface metric ADD: Addition of point to surface metric to Elastix. In this commit addition of point to surface metric is done. This metric essentially considers how surface of an masked organ is aligned with the points provided from the surface of the organ. Therefore, it is used to improve alignment of the organ under interest.
227d9c5
to
7a793af
Compare
@N-Dekker I have found out that it is related to neither the changes I did nor the discrepancy in the base. There was a nonlinearity in the commit line so after squashing all other commits except the one breaking the linearity it was solved. Indeed I changed the message of the commit :) |
::Initialize() | ||
{ | ||
/** Initialize transform, interpolator, etc. | ||
Superclass::Initialize(); |
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.
Is it the intention that this Superclass::Initialize()
call is commented out?
* | ||
*=========================================================================*/ | ||
#ifndef __elxPointToSurfaceDistanceMetric_H__ | ||
#define __elxPointToSurfaceDistanceMetric_H__ |
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.
(Minor nitpick) In elastix, as well as in ITK, we no longer have those __
underscores at the begin and the end of include guard macro names. See #339 Of course, we can remove them from your header files later, no problem.
@gokhangg Could you possibly also include a little test (unit test) with your pull request? |
No description provided.