-
-
Notifications
You must be signed in to change notification settings - Fork 115
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 LookUpTableFunctions #1155
Add LookUpTableFunctions #1155
Conversation
815cd37
to
4c98094
Compare
It seems a good idea to me. |
The only concern I have is that every 3D table (with 2^26 configurations) is 64 MB after decompression. I don't know how keen you are to add the zlib external dependency. For a few tables this approach looks all right though. @JacquesOlivierLachaud Yeah, 2D tables are straight forward to add, and much lighter. I will push them. |
4300992
to
d792693
Compare
|
||
namespace DGtal | ||
{ | ||
namespace lut { |
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.
global functions should be in the DGtal::functions::
namespace.
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.
DGtal::functions::simplicity
has namespace ? lut
is too generic IMHO
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.
In a similar way, the filename LookUpTableFunctions
is not great.. I have the feeling that it could be confusing. What do you think?
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.
Good point, I will add the functions:: namespace asap.
The motivation of this PR is related to the other PR #1147 , where we use look up tables to calculate the (way more expensive) isIsthmus that depends on the neighborhood of voxels. If lut
is too generic, simplicity
is not able to capture the isthmus
case. Maybe tables::
?
I am completely open to suggestions of changing the name, but I cannot really think in anything better or more clarifying/descriptive. The user probably will only interact with this using the loadTable("string_variable_pointing_to_table_file")
from ConfigTable.h.in
. Other names: NeigborhoodConfigurations
, PreComputedTables
, PreComputedConfiguration
? Not sure, sorry!!
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.
😄 no idea, too
NeigborhoodConfigurations
is ok for the filename but I don't know for the namespace... neighborhood::
?
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.
Why not a name related to the objective of lut... here topology, homotopy, simplicity, etc ... as you wish
----- Mail original -----
De: "David Coeurjolly" [email protected]
À: "DGtal-team/DGtal" [email protected]
Cc: "Jacques-Olivier Lachaud" [email protected]
Envoyé: Lundi 11 Avril 2016 11:16:01
Objet: Re: [DGtal-team/DGtal] Add LookUpTableFunctions (#1155)
In src/DGtal/topology/tables/LookUpTableFunctions.h :
+#if !defined LookUpTableFunctions_h
+/** Prevents repeated inclusion of headers. */
+#define LookUpTableFunctions_h
+//////////////////////////////////////////////////////////////////////////////
+// Inclusions
+#include
+#include
+#include
+#include "DGtal/topology/Object.h"
+#include "DGtal/helpers/StdDefs.h"
+#include <unordered_map>
+#include "boost/dynamic_bitset.hpp"
+
+namespace DGtal
+{
- namespace lut {
no idea, too
NeigborhoodConfigurations is ok for the filename but I don't know for the namespace... neighborhood:: ?
—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
could you please also consider to add something in the doc ( |
BTW, maybe the dgtaltools should also be updated (ping @kerautret ) |
What do you prefer I like the split of the namespaces for the different tables. I will update the docs, and the log meanwhile. |
2e2452d
to
601e5d4
Compare
Last two commits:
Rebased all branch commits |
New functions to deal with pre-computed look up tables. Motivation is to speed up large computation that use predicate functions depending on voxel neighborhood, such as isSimple. Add new folder /topology/tables containing: - NeighborhoodConfigurations.h loading table and map. - NeighborhoodConfigurationsHelpers.h helpers for Object and CubicalComplex. - compressed .tar.gz tables for simplicity. Modify example generateSimplicityTables3D, and 2D: - using functions from new header. - create tables for different topologies. - user can choose 26_6,6_26, 18_6 and 6_18 topologies in 3D and 8_4,4_8 in 2D. - Generated tables are then compressed using: `cmake -E tar cvzf table26_6.tar.gz simple_table26_6.txt` Add CMake rules: - NeighborhoodTablesConfig.cmake dealing with decompress, copy and install tables. Linked in root CMakeLists.txt - NeighborhoodTablesConfig.h.in . CONFIGURE_FILE with strings pointing to all available tables. The generated NeighborhoodTablesConfig.h change location of tables depending on Build or Install.
3e72d5e
to
f2f500d
Compare
foreach(zip_table ${DGTAL_TABLES_COMPRESSED}) | ||
execute_process( | ||
COMMAND ${CMAKE_COMMAND} -E tar xzf ${zip_table} | ||
WORKING_DIRECTORY ${unzip_folder} |
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.
Does this work on Windows ? Should we add something in the Windows install guide (like install tar archive tool) ?
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.
CMake provides it, and it is mulit-platform, but I am not really sure what version of cmake is required.
Nice PR. Sorry for the long delay for reviewing it, I had several deadlines in the last weeks (SGP and ICPR). I check that everything compiles on my computer and the documentation and I merge. |
Thanks a lot for the reviewing and feedback, I am learning a lot with this library! I am right now contributing some segmentation filter in ITK, that I need for my thesis, but will try to improve this and the PR #1147 as soon as possible. |
It is very nice for us to have contributors from far (far) away ! I was really surprised to see somebody from New Zealand who knows about isthmus and such stuff (so french :) ) |
Do you know Reinhardt Klette (he is in Auckland) ? He is one of the few guy in our community. Well, he is retiring at the moment I think. |
No, I don't know him, I have the bad excuse that I am closer to Wellington. And yeah I know it is far away hehe, I am Spanish! Currently doing a PhD here in the antipodes, in a biophysics group , but I have been migrating to computer vision to characterize geometry/connectivity/topology of biopolymer networks |
Everything is fine for me and it works nicely on my computer. I wait for the few minor fixes (change of names mostly) and I merge. |
haha indeed. I will make the changes soon. Have a good afternoon! |
* Add typedef NeighborhoodConfiguration = uint_32 in topology/helpers/NeighborhoodConfigurationHelper.h. * Remove NeighborhoodConfigurationHelpers.h. * Move generateTable to topology/tables/NeighborhoodConfigurationGenerators. * Rename and move getOccupancyXXX functions, to Object class function and CubicalComplexFunctions respectively. * Fix indendation in testObject. * Rename and add documentation to helper function mapping zero neighborhood points to configuration bit masks.
/** | ||
* Get the occupancy configuration of the neighborhood of a point in a cubical | ||
* complex. | ||
* The neighborhood size is considered DxD for dimension D of the point |
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.
You mean 3^d in dD, so 3x3 in 2D and 3x3x3 in 3D.
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.
thx, changed.
Except from the above remark, it is fine for me to merge. |
Fine. I merge. |
Add LookUpTableFunctions
New functions to deal with pre-computed look up tables.
The motivation is to speed up large computation that use predicate
functions depending on voxel neighborhood, such as isSimple.
Add new folder /topology/tables containing:
Modify example generateSimplicityTables3d:
to the source code after compressed using:
cmake -E tar cvzf table26_6.tar.gz simple_table26_6.txt
resulting in a light (<500KB) tar file.Add CMake rules:
copy and install tables. Linked in root CMakeLists.txt
to all available tables. The generated ConfigTables.h
change location of tables depending on Build or Install.
Checklist
cmake
mode (otherwise, Travis C.I. will fail).