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

fix compile in itk reader/writer #1153

Closed
wants to merge 26 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
98859d1
select vector field color
elcerdo Mar 16, 2016
837dd1a
fix useless asserts
elcerdo Mar 17, 2016
8787afc
oups
elcerdo Mar 17, 2016
63c8f46
fix 3d viewer add cone
elcerdo Mar 21, 2016
a6541ae
disable eigen deprecated warning with cpp11
elcerdo Mar 23, 2016
bda20a5
fix compile in itk reader/writer
kerautret Mar 25, 2016
a02506e
change log
kerautret Mar 25, 2016
14850c5
fixing extension removal
dcoeurjo Mar 26, 2016
8b19eef
Changelog edit
dcoeurjo Mar 26, 2016
da49df7
testing
dcoeurjo Mar 26, 2016
232193c
minor typo
dcoeurjo Mar 26, 2016
b79323b
Merge pull request #1148 from elcerdo/DECCosmetics
dcoeurjo Mar 26, 2016
53116bf
Merge pull request #1154 from dcoeurjo/FixObjFilename
kerautret Mar 26, 2016
d315f77
remove {} in functor def
kerautret Mar 28, 2016
f8ade3b
Fix fill interior/exterior in 3D with open or closed KhalimskySpaceND…
kerautret Mar 29, 2016
1e9f0a4
add test for 3D exterior fill
kerautret Mar 29, 2016
42a0a30
complement test in 2D
kerautret Mar 29, 2016
2613aad
change log
kerautret Mar 29, 2016
5b8a335
Merge pull request #1156 from kerautret/FixFillInteriorExterior3D
dcoeurjo Apr 1, 2016
628eb94
back {} ;)
kerautret Apr 1, 2016
a47a7ab
README page update (license)
dcoeurjo Apr 3, 2016
e8bab36
Update README.md
dcoeurjo Apr 3, 2016
fe9125f
missing verb
dcoeurjo Apr 3, 2016
ed28393
Merge pull request #1158 from dcoeurjo/readme
kerautret Apr 3, 2016
49e90eb
Fix tubular mesh
kerautret Apr 4, 2016
1e55cc2
Merge pull request #1153 from kerautret/FixITKReader
dcoeurjo Apr 5, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
constructor, like from a rvalue reference. Adding ConstAlias in many classes
that need it.
(Roland Denis, [#1140](https://github.com/DGtal-team/DGtal/pull/1140))
(With ITK related compilation fix, Bertrand Kerautret
[#1153](https://github.com/DGtal-team/DGtal/pull/1153))

- *IO Package*
- Add the possibility to interact in QGLViewer Viewer3D class with the voxel
Expand Down
3 changes: 2 additions & 1 deletion src/DGtal/io/readers/ITKReader.ih
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ namespace DGtal {
const Domain& domain = dgtal_itk_image.domain();

typedef ConstImageAdapter<DGtalITKImage, Domain, functors::Identity, Value, Functor> AdaptedImage;
const AdaptedImage adapted(dgtal_itk_image, domain, functors::Identity(), aFunctor);
const functors::Identity identityFunctor{};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why {}?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I apply the same change of @rolanddenis ;) looks fine without with my compilo but I suppose that there a reason.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😄
In that case, it is exactly the same as without {}: it calls the constructor without argument. It is a new syntax from C++11. It enhances the construction of object and, especially, it allows me to replace a common mistake that I make:
const functors::Identity identityFunctor();
by a valid syntax:
const functors::Identity identityFunctor{};
:octocat:

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I would have preferred to get the () removed instead of something that can be ambiguous for non-c11 dev.
(Not sure to see why this new syntax enhance the construction.. I'll have to read the doc;))

const AdaptedImage adapted(dgtal_itk_image, domain, identityFunctor, aFunctor);

Image image(domain);
std::copy(adapted.constRange().begin(), adapted.constRange().end(), image.range().outputIterator());
Expand Down
3 changes: 2 additions & 1 deletion src/DGtal/io/writers/ITKWriter.ih
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ namespace DGtal {
const Domain& domain = aImage.domain();

typedef ConstImageAdapter<Image, Domain, functors::Identity, ValueOut, Functor> AdaptedImage;
const AdaptedImage adapted(aImage, domain, functors::Identity(), aFunctor);
const functors::Identity identityFunctor{};
const AdaptedImage adapted(aImage, domain, identityFunctor, aFunctor);

typedef ImageContainerByITKImage<Domain, ValueOut> DGtalITKImage;
DGtalITKImage itk_image(aImage.domain());
Expand Down