gnuastro-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnuastro-commits] master 1df0251: gal_label_watershed is the new name f


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 1df0251: gal_label_watershed is the new name for gal_label_oversegment
Date: Thu, 17 May 2018 08:17:27 -0400 (EDT)

branch: master
commit 1df0251fc4db7de894601763c1f5e29a1dd4e15c
Author: Mohammad Akhlaghi <address@hidden>
Commit: Mohammad Akhlaghi <address@hidden>

    gal_label_watershed is the new name for gal_label_oversegment
    
    The name "oversegment" is very old in Gnuastro. In those days, we called it
    over-segmentation because it was building the profiles from the local
    maximums, not local minimums as in the watershed algorithm. But now, it can
    also build from the minimums. Since the watershed algorithm name is very
    well known, it is thus better to use that name. Until version 0.5, this was
    only available in the Segment program, so it wasn't visible to the outside
    world and I had more important things to do. But now that it is indepedent
    library function, its important to give it a recognizable name.
---
 NEWS                  | 2 +-
 bin/segment/clumps.c  | 8 ++++----
 bin/segment/segment.c | 6 +++---
 doc/gnuastro.texi     | 8 ++++----
 lib/gnuastro/label.h  | 4 ++--
 lib/label.c           | 4 ++--
 6 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/NEWS b/NEWS
index b1b6b06..b609f4f 100644
--- a/NEWS
+++ b/NEWS
@@ -87,7 +87,7 @@ GNU Astronomy Utilities NEWS                          -*- 
outline -*-
     gal_jpeg_read: Reads input JPEG image into `gal_data_t'.
     gal_jpeg_write: Writes a `gal_data_t' into a JPEG file.
     gal_label_grow_indexs: grow known indexs into desired areas.
-    gal_label_oversegment: apply over-segmentation to an input dataset.
+    gal_label_watershed: apply watershed algorithm on desired region.
     gal_label_clump_significance: measure significance of all clumps in region.
     gal_pdf_name_is_pdf: Returns 1 if given filename is PDF.
     gal_pdf_suffix_is_pdf: Returns 1 if given suffix is PDF.
diff --git a/bin/segment/clumps.c b/bin/segment/clumps.c
index 5d06222..2c9a338 100644
--- a/bin/segment/clumps.c
+++ b/bin/segment/clumps.c
@@ -428,10 +428,10 @@ clumps_find_make_sn_table(void *in_prm)
 
 
           /* Generate the clumps over this region. */
-          cltprm.numinitclumps=gal_label_oversegment(p->conv, cltprm.indexs,
-                                                     p->clabel,
-                                                     cltprm.topinds,
-                                                     !p->minima);
+          cltprm.numinitclumps=gal_label_watershed(p->conv, cltprm.indexs,
+                                                   p->clabel,
+                                                   cltprm.topinds,
+                                                   !p->minima);
 
 
           /* Set all river pixels to GAL_LABEL_INIT (to be distinguishable
diff --git a/bin/segment/segment.c b/bin/segment/segment.c
index a456c1c..a0dbd6a 100644
--- a/bin/segment/segment.c
+++ b/bin/segment/segment.c
@@ -564,9 +564,9 @@ segment_on_threads(void *in_prm)
 
 
       /* Find the clumps over this region. */
-      cltprm.numinitclumps=gal_label_oversegment(p->conv, cltprm.indexs,
-                                                 p->clabel, cltprm.topinds,
-                                                 !p->minima);
+      cltprm.numinitclumps=gal_label_watershed(p->conv, cltprm.indexs,
+                                               p->clabel, cltprm.topinds,
+                                               !p->minima);
 
 
       /* Set all the river pixels to zero (we don't need them any more in
diff --git a/doc/gnuastro.texi b/doc/gnuastro.texi
index 7e4f6ac..35ffae1 100644
--- a/doc/gnuastro.texi
+++ b/doc/gnuastro.texi
@@ -26407,7 +26407,7 @@ dataset's first element/pixel. Therefore it is always 
greater or equal to
 zero and stored in @code{size_t} type.
 @end deftypefun
 
address@hidden size_t gal_label_oversegment (gal_data_t @code{*values}, 
gal_data_t @code{*indexs}, gal_data_t @code{*label}, size_t @code{*topinds}, 
int @code{min0_max1})
address@hidden size_t gal_label_watershed (gal_data_t @code{*values}, 
gal_data_t @code{*indexs}, gal_data_t @code{*label}, size_t @code{*topinds}, 
int @code{min0_max1})
 @cindex Watershed algorithm
 @cindex Algorithm: watershed
 Use the watershed address@hidden watershed algorithm was initially
@@ -26471,7 +26471,7 @@ input->flags &= ~GAL_DATA_FLAG_HASBLANK; /* Set bit to 
0. */
 
 @deftypefun void gal_label_clump_significance (gal_data_t @code{*values}, 
gal_data_t @code{*std}, gal_data_t @code{*label}, gal_data_t @code{*indexs}, 
struct gal_tile_two_layer_params @code{*tl}, size_t @code{numclumps}, size_t 
@code{minarea}, int @code{variance}, int @code{keepsmall}, gal_data_t 
@code{*sig}, gal_data_t @code{*sigind})
 @cindex Clump
-This function is usually called after @code{gal_label_oversegment}, and is
+This function is usually called after @code{gal_label_watershed}, and is
 used as a measure to idenfity which over-segmented ``clumps'' are real and
 which are noise.
 
@@ -26481,7 +26481,7 @@ is only done on pixels which are indexed in 
@code{indexs}. It is expected
 for @code{indexs} to be sorted by their values in @code{values}. If not
 sorted, the measurement may not be reliable. If sorted in a decreasing
 order, then clump building will start from their highest value and
-vice-versa. See the description of @code{gal_label_oversegment} for more on
+vice-versa. See the description of @code{gal_label_watershed} for more on
 @code{indexs}.
 
 Each ``clump'' (identified by a positive integer) is assumed to be
@@ -26543,7 +26543,7 @@ this function. For a demonstration see Columns 2 and 3 
of Figure 10 in
 @url{http://arxiv.org/abs/1505.01664, Akhlaghi and Ichikawa [2015]}.
 
 In many aspects, this function is very similar to over-segmentation
-(watershed algorithm, @code{gal_label_oversegment}). The big difference is
+(watershed algorithm, @code{gal_label_watershed}). The big difference is
 that in over-segmentation local maximums (that aren't touching any already
 labeled pixel) get a separate label. However, here the final number of
 labels will not change. All pixels that aren't directly touching a labeled
diff --git a/lib/gnuastro/label.h b/lib/gnuastro/label.h
index 1ee91de..fb21aa5 100644
--- a/lib/gnuastro/label.h
+++ b/lib/gnuastro/label.h
@@ -63,8 +63,8 @@ gal_data_t *
 gal_label_indexs(gal_data_t *labels, size_t numlabs, size_t minmapsize);
 
 size_t
-gal_label_oversegment(gal_data_t *values, gal_data_t *indexs,
-                      gal_data_t *label, size_t *topinds, int min0_max1);
+gal_label_watershed(gal_data_t *values, gal_data_t *indexs,
+                    gal_data_t *label, size_t *topinds, int min0_max1);
 
 void
 gal_label_clump_significance(gal_data_t *values, gal_data_t *std,
diff --git a/lib/label.c b/lib/label.c
index 96a74ac..af76ca0 100644
--- a/lib/label.c
+++ b/lib/label.c
@@ -178,8 +178,8 @@ gal_label_indexs(gal_data_t *labels, size_t numlabs, size_t 
minmapsize)
 
 */
 size_t
-gal_label_oversegment(gal_data_t *values, gal_data_t *indexs,
-                      gal_data_t *labels, size_t *topinds, int min0_max1)
+gal_label_watershed(gal_data_t *values, gal_data_t *indexs,
+                    gal_data_t *labels, size_t *topinds, int min0_max1)
 {
   size_t ndim=values->ndim;
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]