Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Cresson Remi
LSGRM
Commits
3c558d44
Commit
3c558d44
authored
Nov 09, 2017
by
Gaetano Raffaele
Browse files
FIX: switched node id type to std::size_t for 64 bit Windows portability
parent
f6fad8b1
Changes
5
Hide whitespace changes
Inline
Side-by-side
include/lsgrmController.h
View file @
3c558d44
...
...
@@ -94,7 +94,7 @@ private:
void
ComputeMaximumStabilityMargin
(
unsigned
int
width
,
unsigned
int
height
,
unsigned
int
&
iter
,
unsigned
int
&
margin
);
void
CheckMemorySize
();
unsigned
int
GetNodeMemory
();
long
unsigned
in
t
GetMaximumNumberOfNodesInMemory
();
std
::
size_
t
GetMaximumNumberOfNodesInMemory
();
/* Parameters given by the user */
std
::
string
m_TemporaryFilesPrefix
;
// Path used to store intermediate files during the process.
...
...
include/lsgrmController.txx
View file @
3c558d44
...
...
@@ -266,7 +266,7 @@ void Controller<TSegmenter>::CheckMemorySize()
* Compute the maximum number of nodes which can fit in the memory
*/
template<class TSegmenter>
long unsigned in
t Controller<TSegmenter>::GetMaximumNumberOfNodesInMemory()
std::size_
t Controller<TSegmenter>::GetMaximumNumberOfNodesInMemory()
{
itkDebugMacro(<< "Computing maximum number of nodes in memory");
...
...
include/lsgrmGraphOperations.h
View file @
3c558d44
...
...
@@ -78,13 +78,13 @@ void RemoveUselessNodes(ProcessingTile& tile,
template
<
class
TSegmenter
>
void
UpdateNeighborsOfNoneDuplicatedNodes
(
std
::
unordered_map
<
long
unsigned
in
t
,
void
UpdateNeighborsOfNoneDuplicatedNodes
(
std
::
unordered_map
<
std
::
size_
t
,
std
::
vector
<
typename
TSegmenter
::
NodePointerType
>
>&
borderPixelMap
,
const
unsigned
int
imageWidth
,
const
unsigned
int
imageHeight
);
template
<
class
TSegmenter
>
void
RemoveDuplicatedNodes
(
std
::
unordered_map
<
long
unsigned
in
t
,
void
RemoveDuplicatedNodes
(
std
::
unordered_map
<
std
::
size_
t
,
std
::
vector
<
typename
TSegmenter
::
NodePointerType
>
>&
borderPixelMap
,
typename
TSegmenter
::
GraphType
&
graph
,
const
unsigned
int
imageWidth
);
...
...
@@ -96,7 +96,7 @@ void BuildBorderPixelMap(typename TSegmenter::GraphType& graph,
const
unsigned
int
colTile
,
const
unsigned
int
nbTilesX
,
const
unsigned
int
nbTilesY
,
std
::
unordered_map
<
long
unsigned
in
t
,
std
::
unordered_map
<
std
::
size_
t
,
std
::
vector
<
typename
TSegmenter
::
NodePointerType
>
>&
borderPixelMap
,
const
unsigned
int
imageWidth
);
...
...
include/lsgrmGraphOperations.txx
View file @
3c558d44
...
...
@@ -63,7 +63,7 @@ MergeAllGraphsAndAchieveSegmentation(
{
std::cout << "Cleaning nodes of tile " << (row*nbTilesX + col) << " / " << (nbTilesX*nbTilesY) << std::endl;
std::unordered_map<
long unsigned in
t,
std::unordered_map<
std::size_
t,
std::vector<typename TSegmenter::NodePointerType> > borderPixelMap;
std::cout << "\tBuildBorderPixelMap..." << std::endl;
...
...
@@ -160,7 +160,7 @@ long long unsigned int RunPartialSegmentation(const typename TSegmenter::ParamTy
row, col, nbTilesX, nbTilesY);
std::cout << "\tBuild border pixel map..." << std::endl;
std::unordered_map<
long unsigned in
t, std::vector<typename TSegmenter::NodePointerType> > borderPixelMap;
std::unordered_map<
std::size_
t, std::vector<typename TSegmenter::NodePointerType> > borderPixelMap;
BuildBorderPixelMap<TSegmenter>(segmenter.m_Graph, currentTile, row, col,
nbTilesX, nbTilesY, borderPixelMap, imageWidth);
...
...
@@ -328,7 +328,7 @@ void RemoveUselessNodes(ProcessingTile& tile,
}
template<class TSegmenter>
void UpdateNeighborsOfNoneDuplicatedNodes(std::unordered_map<
long unsigned in
t,
void UpdateNeighborsOfNoneDuplicatedNodes(std::unordered_map<
std::size_
t,
std::vector<typename TSegmenter::NodePointerType> >& borderPixelMap,
const unsigned int imageWidth,
const unsigned int imageHeight)
...
...
@@ -338,7 +338,7 @@ void UpdateNeighborsOfNoneDuplicatedNodes(std::unordered_map<long unsigned int,
for(auto& pn : borderPixelMap)
{
long int
neighborhood[4];
NeighIDType
neighborhood[4];
grm::FOURNeighborhood(neighborhood, pn.first, imageWidth, imageHeight);
for(short j = 0; j < 4; ++j)
...
...
@@ -366,7 +366,7 @@ void UpdateNeighborsOfNoneDuplicatedNodes(std::unordered_map<long unsigned int,
{
if(borderPixelMap.find(pix) != borderPixelMap.end())
{
long int
pixNeighborhood[4];
NeighIDType
pixNeighborhood[4];
grm::FOURNeighborhood(pixNeighborhood, pix, imageWidth, imageHeight);
for(short k = 0; k < 4; k++)
...
...
@@ -393,7 +393,7 @@ void UpdateNeighborsOfNoneDuplicatedNodes(std::unordered_map<long unsigned int,
}
template<class TSegmenter>
void RemoveDuplicatedNodes(std::unordered_map<
long unsigned in
t,
void RemoveDuplicatedNodes(std::unordered_map<
std::size_
t,
std::vector<typename TSegmenter::NodePointerType> >& borderPixelMap,
typename TSegmenter::GraphType& graph,
const unsigned int imageWidth)
...
...
@@ -464,7 +464,7 @@ void BuildBorderPixelMap(typename TSegmenter::GraphType& graph,
const unsigned int colTile,
const unsigned int nbTilesX,
const unsigned int nbTilesY,
std::unordered_map<
long unsigned in
t,
std::unordered_map<
std::size_
t,
std::vector<typename TSegmenter::NodePointerType> >& borderPixelMap,
const unsigned int imageWidth)
{
...
...
include/lsgrmSegmenter.h
View file @
3c558d44
...
...
@@ -106,7 +106,7 @@ public:
void
ReadGraph
(
FILE
*
nodeStream
,
FILE
*
edgeStream
)
{
std
::
unordered_map
<
long
unsigned
in
t
,
NodePointerType
>
nodeMap
;
std
::
unordered_map
<
std
::
size_
t
,
NodePointerType
>
nodeMap
;
// Read the size of the graph
{
...
...
@@ -151,7 +151,7 @@ public:
for
(
auto
&
node
:
this
->
m_Graph
.
m_Nodes
)
{
long
unsigned
in
t
nodeId
;
std
::
size_
t
nodeId
;
fread
(
&
(
nodeId
),
sizeof
(
nodeId
),
1
,
edgeStream
);
assert
(
nodeId
==
node
->
m_Id
);
...
...
@@ -160,7 +160,7 @@ public:
node
->
m_Edges
.
reserve
(
edgeSize
);
for
(
unsigned
int
b
=
0
;
b
<
edgeSize
;
b
++
)
{
long
unsigned
in
t
targetId
;
std
::
size_
t
targetId
;
unsigned
int
boundary
;
fread
(
&
(
targetId
),
sizeof
(
targetId
),
1
,
edgeStream
);
fread
(
&
(
boundary
),
sizeof
(
boundary
),
1
,
edgeStream
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment