00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include <stdio.h>
00022 #include <string.h>
00023 #include <math.h>
00024
00025 #include <flgrCoreData.h>
00026 #include <flgrCoreIO.h>
00027 #include <flgrCoreDispatch.h>
00028 #include <flgrCoreCompare.h>
00029 #include <flgrCoreReplace.h>
00030 #include <flgrCoreCopy.h>
00031 #include <flgrCoreSlideWindow.h>
00032 #include <flgrMeasureBase.h>
00033 #include <flgrArith.h>
00034 #include "flgrMorphoKerOp.h"
00035 #include "flgrMorphoSkiz.h"
00036 #include "flgrMorphoSkizFast.h"
00037 #include "flgrMorphoLabel.h"
00038 #include "../image/flgrImageIO.h"
00039
00040
00041 void flgr2d_dilate_preserving_skiz_fgBIT(FLGR_Data2D *datdest, FLGR_Data2D *datsrc, FLGR_Data2D *nhb) {
00042
00043 flgr_no_define_type_function(FLGR_BIT);
00044 }
00045
00046 void flgr2d_dilate_preserving_skiz_fgUINT8(FLGR_Data2D *datdest, FLGR_Data2D *datsrc, FLGR_Data2D *nhb) {
00047
00048
00049 #if defined(__SSE2__) || (defined(__SSE__) && defined(__MMX__))
00050 if((nhb->shape==FLGR_RECT) && (nhb->connexity==FLGR_8_CONNEX) && (nhb->size_x==3) && (nhb->size_y==3)) {
00051 flgr2d_dilate_preserving_skiz_fast_8_connex_fgUINT8(datdest,datsrc);
00052
00053 }else if((nhb->shape==FLGR_CROSS) && (nhb->connexity==FLGR_4_CONNEX) && (nhb->size_x==3) && (nhb->size_y==3)) {
00054 flgr2d_dilate_preserving_skiz_fast_4_connex_fgUINT8(datdest,datsrc);
00055
00056 }else if((nhb->shape==FLGR_HEX) && (nhb->connexity==FLGR_6_CONNEX) && (nhb->size_x==3) && (nhb->size_y==3)) {
00057 flgr2d_dilate_preserving_skiz_fast_6_connex_fgUINT8(datdest,datsrc);
00058
00059 }else {
00060 flgr2d_raster_slide_window_fgUINT8(datdest, datsrc, nhb, FLGR_NHB_NO_SYM, flgr2d_get_nhb_max_keep_skiz_fgUINT8);
00061 }
00062
00063 #else
00064
00065 flgr2d_raster_slide_window_fgUINT8(datdest, datsrc, nhb, FLGR_NHB_NO_SYM, flgr2d_get_nhb_max_keep_skiz_fgUINT8);
00066
00067 #endif
00068 }
00069
00070 void flgr2d_dilate_preserving_skiz_fgUINT16(FLGR_Data2D *datdest, FLGR_Data2D *datsrc, FLGR_Data2D *nhb) {
00071
00072
00073 #if defined(__SSE2__) || (defined(__SSE__) && defined(__MMX__))
00074
00075 if((nhb->shape==FLGR_RECT) && (nhb->connexity==FLGR_8_CONNEX) && (nhb->size_x==3) && (nhb->size_y==3)) {
00076 flgr2d_dilate_preserving_skiz_fast_8_connex_fgUINT16(datdest,datsrc);
00077
00078 }else if((nhb->shape==FLGR_CROSS) && (nhb->connexity==FLGR_4_CONNEX) && (nhb->size_x==3) && (nhb->size_y==3)) {
00079 flgr2d_dilate_preserving_skiz_fast_4_connex_fgUINT16(datdest,datsrc);
00080
00081 }else if((nhb->shape==FLGR_HEX) && (nhb->connexity==FLGR_6_CONNEX) && (nhb->size_x==3) && (nhb->size_y==3)) {
00082 flgr2d_dilate_preserving_skiz_fast_6_connex_fgUINT16(datdest,datsrc);
00083
00084 }else {
00085 flgr2d_raster_slide_window_fgUINT16(datdest, datsrc, nhb, FLGR_NHB_NO_SYM, flgr2d_get_nhb_max_keep_skiz_fgUINT16);
00086 }
00087 #else
00088
00089 flgr2d_raster_slide_window_fgUINT16(datdest, datsrc, nhb, FLGR_NHB_NO_SYM, flgr2d_get_nhb_max_keep_skiz_fgUINT16);
00090
00091 #endif
00092 }
00093
00094 void flgr2d_dilate_preserving_skiz_fgUINT32(FLGR_Data2D *datdest, FLGR_Data2D *datsrc, FLGR_Data2D *nhb) {
00095
00096 if((nhb->shape==FLGR_RECT) && (nhb->connexity==FLGR_8_CONNEX) && (nhb->size_x==3) && (nhb->size_y==3)) {
00097 flgr2d_dilate_preserving_skiz_fast_8_connex_fgUINT32(datdest,datsrc);
00098 }else {
00099 flgr2d_raster_slide_window_fgUINT32(datdest, datsrc, nhb, FLGR_NHB_NO_SYM, flgr2d_get_nhb_max_keep_skiz_fgUINT32);
00100 }
00101 }
00102
00103 void flgr2d_dilate_preserving_skiz_fgINT8(FLGR_Data2D *datdest, FLGR_Data2D *datsrc, FLGR_Data2D *nhb) {
00104
00105 if((nhb->shape==FLGR_RECT) && (nhb->connexity==FLGR_8_CONNEX) && (nhb->size_x==3) && (nhb->size_y==3)) {
00106 flgr2d_dilate_preserving_skiz_fast_8_connex_fgINT8(datdest,datsrc);
00107 }else {
00108 flgr2d_raster_slide_window_fgINT8(datdest, datsrc, nhb, FLGR_NHB_NO_SYM, flgr2d_get_nhb_max_keep_skiz_fgINT8);
00109 }
00110 }
00111
00112 void flgr2d_dilate_preserving_skiz_fgINT16(FLGR_Data2D *datdest, FLGR_Data2D *datsrc, FLGR_Data2D *nhb) {
00113
00114 if((nhb->shape==FLGR_RECT) && (nhb->connexity==FLGR_8_CONNEX) && (nhb->size_x==3) && (nhb->size_y==3)) {
00115 flgr2d_dilate_preserving_skiz_fast_8_connex_fgINT16(datdest,datsrc);
00116 }else {
00117 flgr2d_raster_slide_window_fgINT16(datdest, datsrc, nhb, FLGR_NHB_NO_SYM, flgr2d_get_nhb_max_keep_skiz_fgINT16);
00118 }
00119 }
00120
00121 void flgr2d_dilate_preserving_skiz_fgINT32(FLGR_Data2D *datdest, FLGR_Data2D *datsrc, FLGR_Data2D *nhb) {
00122
00123 if((nhb->shape==FLGR_RECT) && (nhb->connexity==FLGR_8_CONNEX) && (nhb->size_x==3) && (nhb->size_y==3)) {
00124 flgr2d_dilate_preserving_skiz_fast_8_connex_fgINT32(datdest,datsrc);
00125 }else {
00126 flgr2d_raster_slide_window_fgINT32(datdest, datsrc, nhb, FLGR_NHB_NO_SYM, flgr2d_get_nhb_max_keep_skiz_fgINT32);
00127 }
00128 }
00129
00130 void flgr2d_dilate_preserving_skiz_fgFLOAT32(FLGR_Data2D *datdest, FLGR_Data2D *datsrc, FLGR_Data2D *nhb) {
00131
00132 if((nhb->shape==FLGR_RECT) && (nhb->connexity==FLGR_8_CONNEX) && (nhb->size_x==3) && (nhb->size_y==3)) {
00133 flgr2d_dilate_preserving_skiz_fast_8_connex_fgFLOAT32(datdest,datsrc);
00134 }else {
00135 flgr2d_raster_slide_window_fgFLOAT32(datdest, datsrc, nhb, FLGR_NHB_NO_SYM, flgr2d_get_nhb_max_keep_skiz_fgFLOAT32);
00136 }
00137 }
00138
00139 void flgr2d_dilate_preserving_skiz_fgFLOAT64(FLGR_Data2D *datdest, FLGR_Data2D *datsrc, FLGR_Data2D *nhb) {
00140
00141 if((nhb->shape==FLGR_RECT) && (nhb->connexity==FLGR_8_CONNEX) && (nhb->size_x==3) && (nhb->size_y==3)) {
00142 flgr2d_dilate_preserving_skiz_fast_8_connex_fgFLOAT64(datdest,datsrc);
00143 }else {
00144 flgr2d_raster_slide_window_fgFLOAT64(datdest, datsrc, nhb, FLGR_NHB_NO_SYM, flgr2d_get_nhb_max_keep_skiz_fgFLOAT64);
00145 }
00146 }
00147
00148
00149
00151
00157
00158 FLGR_Ret flgr2d_dilate_preserving_skiz(FLGR_Data2D *datdest, FLGR_Data2D *datsrc, FLGR_Data2D *nhb) {
00159 FLGR_Ret ret;
00160
00161
00162 if((datdest==NULL) || (datsrc==NULL) || (nhb==NULL)) {
00163 POST_ERROR("Null objects!\n");
00164 return FLGR_RET_NULL_OBJECT;
00165 }
00166
00167 if((ret=flgr2d_is_data_same_attributes(datdest,datsrc,__FUNCTION__))!=FLGR_RET_OK) return ret;
00168 if((ret=flgr2d_is_data_same_type(datdest,nhb))!=FLGR_RET_OK) {
00169 POST_ERROR("data types differents\n");
00170 return ret;
00171 }
00172
00173 if((ret=flgr2d_is_data_same_spp(datdest,nhb))!=FLGR_RET_OK) {
00174 POST_ERROR("spp differents\n");
00175 return ret;
00176 }
00177
00178 FLGR_DISPATCH_PROCEDURE(datdest->type,flgr2d_dilate_preserving_skiz,datdest,datsrc,nhb);
00179
00180 }
00181
00182
00183
00184
00185
00186 #define FLGR2D_MACRO_SKIZ(dtype) \
00187 FLGR_Data2D *tmp; \
00188 \
00189 tmp = flgr2d_create_##dtype(labelizedImage->size_y, \
00190 labelizedImage->size_x, \
00191 labelizedImage->spp, \
00192 FLGR_NO_SHAPE, \
00193 FLGR_NO_CONNEX); \
00194 \
00195 do { \
00196 flgr2d_copy_##dtype##_##dtype(tmp, labelizedImage); \
00197 flgr2d_dilate_preserving_skiz(labelizedImage,tmp,nhb); \
00198 }while(flgr2d_compare_##dtype(tmp,FLGR_TEST_EQ,labelizedImage) \
00199 !=FLGR_TRUE); \
00200 \
00201 flgr2d_destroy(tmp);
00202
00203 void flgr2d_skiz_fgBIT(FLGR_Data2D *labelizedImage, FLGR_Data2D *nhb) {
00204
00205 flgr_no_define_type_function(FLGR_BIT);
00206 }
00207 void flgr2d_skiz_fgUINT8(FLGR_Data2D *labelizedImage, FLGR_Data2D *nhb) {
00208
00209 FLGR2D_MACRO_SKIZ(fgUINT8);
00210 }
00211 void flgr2d_skiz_fgUINT16(FLGR_Data2D *labelizedImage, FLGR_Data2D *nhb) {
00212
00213 FLGR2D_MACRO_SKIZ(fgUINT16);
00214 }
00215 void flgr2d_skiz_fgUINT32(FLGR_Data2D *labelizedImage, FLGR_Data2D *nhb) {
00216
00217 FLGR2D_MACRO_SKIZ(fgUINT32);
00218 }
00219 void flgr2d_skiz_fgINT8(FLGR_Data2D *labelizedImage, FLGR_Data2D *nhb) {
00220
00221 FLGR2D_MACRO_SKIZ(fgINT8);
00222 }
00223 void flgr2d_skiz_fgINT16(FLGR_Data2D *labelizedImage, FLGR_Data2D *nhb) {
00224
00225 FLGR2D_MACRO_SKIZ(fgINT16);
00226 }
00227 void flgr2d_skiz_fgINT32(FLGR_Data2D *labelizedImage, FLGR_Data2D *nhb) {
00228
00229 FLGR2D_MACRO_SKIZ(fgINT32);
00230 }
00231 void flgr2d_skiz_fgFLOAT32(FLGR_Data2D *labelizedImage, FLGR_Data2D *nhb) {
00232
00233 FLGR2D_MACRO_SKIZ(fgFLOAT32);
00234 }
00235 void flgr2d_skiz_fgFLOAT64(FLGR_Data2D *labelizedImage, FLGR_Data2D *nhb) {
00236
00237 FLGR2D_MACRO_SKIZ(fgFLOAT64);
00238 }
00239
00240
00241
00242
00244
00250
00251 FLGR_Ret flgr2d_skiz(FLGR_Data2D *labelizedImage, FLGR_Connexity connexity) {
00252 FLGR_Ret ret;
00253 FLGR_Data2D *nhb;
00254
00255
00256 if(labelizedImage==NULL) {
00257 POST_ERROR("Null objects!\n");
00258 return FLGR_RET_NULL_OBJECT;
00259 }
00260
00261
00262 nhb = flgr2d_create_neighborhood_from_connexity(labelizedImage->spp,labelizedImage->type,connexity);
00263 if(nhb==NULL) return FLGR_RET_ALLOCATION_ERROR;
00264
00265
00266
00267 switch(labelizedImage->type) {
00268 case FLGR_UINT8:
00269 flgr2d_skiz_fgUINT8(labelizedImage,nhb);
00270 ret = FLGR_RET_OK;break;
00271
00272 case FLGR_UINT16:
00273 flgr2d_skiz_fgUINT16(labelizedImage,nhb);
00274 ret = FLGR_RET_OK;break;
00275
00276 case FLGR_UINT32:
00277 flgr2d_skiz_fgUINT32(labelizedImage,nhb);
00278 ret = FLGR_RET_OK;break;
00279
00280 case FLGR_INT8:
00281 flgr2d_skiz_fgINT8(labelizedImage,nhb);
00282 ret = FLGR_RET_OK;break;
00283
00284 case FLGR_INT16:
00285 flgr2d_skiz_fgINT16(labelizedImage,nhb);
00286 ret = FLGR_RET_OK;break;
00287
00288 case FLGR_INT32:
00289 flgr2d_skiz_fgINT32(labelizedImage,nhb);
00290 ret = FLGR_RET_OK;break;
00291
00292 case FLGR_FLOAT32:
00293 flgr2d_skiz_fgFLOAT32(labelizedImage,nhb);
00294 ret = FLGR_RET_OK;break;
00295
00296 case FLGR_FLOAT64:
00297 flgr2d_skiz_fgFLOAT64(labelizedImage,nhb);
00298 ret = FLGR_RET_OK;break;
00299
00300 default:
00301 ret = FLGR_RET_PARAM_ERROR;break;
00302 }
00303
00304
00305 flgr2d_destroy(nhb);
00306
00307 return ret;
00308 }
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319
00320
00321
00322
00323
00324
00325 #define FLGR2D_MACRO_GEODESIC_SKIZ(dtype) \
00326 FLGR_Data2D *tmp; \
00327 tmp = flgr2d_create_##dtype(datmask->size_y, datmask->size_x, \
00328 datmask->spp, \
00329 FLGR_NO_SHAPE, \
00330 FLGR_NO_CONNEX); \
00331 do { \
00332 flgr2d_copy_##dtype##_##dtype(tmp, labelizedImage); \
00333 flgr2d_dilate_preserving_skiz(labelizedImage,tmp,nhb); \
00334 flgr2d_arith_inf(labelizedImage, labelizedImage, datmask); \
00335 }while(flgr2d_compare_##dtype(tmp,FLGR_TEST_EQ,labelizedImage) \
00336 !=FLGR_TRUE); \
00337 \
00338 flgr2d_destroy(tmp);
00339
00340 void flgr2d_geodesic_skiz_fgBIT(FLGR_Data2D *labelizedImage, FLGR_Data2D *datmask, FLGR_Data2D *nhb) {
00341
00342 flgr_no_define_type_function(FLGR_BIT);
00343 }
00344 void flgr2d_geodesic_skiz_fgUINT8(FLGR_Data2D *labelizedImage, FLGR_Data2D *datmask, FLGR_Data2D *nhb) {
00345
00346 FLGR2D_MACRO_GEODESIC_SKIZ(fgUINT8);
00347 }
00348 void flgr2d_geodesic_skiz_fgUINT16(FLGR_Data2D *labelizedImage, FLGR_Data2D *datmask, FLGR_Data2D *nhb) {
00349
00350 FLGR2D_MACRO_GEODESIC_SKIZ(fgUINT16);
00351 }
00352 void flgr2d_geodesic_skiz_fgUINT32(FLGR_Data2D *labelizedImage, FLGR_Data2D *datmask, FLGR_Data2D *nhb) {
00353
00354 FLGR2D_MACRO_GEODESIC_SKIZ(fgUINT32);
00355 }
00356 void flgr2d_geodesic_skiz_fgINT8(FLGR_Data2D *labelizedImage, FLGR_Data2D *datmask, FLGR_Data2D *nhb) {
00357
00358 FLGR2D_MACRO_GEODESIC_SKIZ(fgINT8);
00359 }
00360 void flgr2d_geodesic_skiz_fgINT16(FLGR_Data2D *labelizedImage, FLGR_Data2D *datmask, FLGR_Data2D *nhb) {
00361
00362 FLGR2D_MACRO_GEODESIC_SKIZ(fgINT16);
00363 }
00364 void flgr2d_geodesic_skiz_fgINT32(FLGR_Data2D *labelizedImage, FLGR_Data2D *datmask, FLGR_Data2D *nhb) {
00365
00366 FLGR2D_MACRO_GEODESIC_SKIZ(fgINT32);
00367 }
00368 void flgr2d_geodesic_skiz_fgFLOAT32(FLGR_Data2D *labelizedImage, FLGR_Data2D *datmask, FLGR_Data2D *nhb) {
00369
00370 FLGR2D_MACRO_GEODESIC_SKIZ(fgFLOAT32);
00371 }
00372 void flgr2d_geodesic_skiz_fgFLOAT64(FLGR_Data2D *labelizedImage, FLGR_Data2D *datmask, FLGR_Data2D *nhb) {
00373
00374 FLGR2D_MACRO_GEODESIC_SKIZ(fgFLOAT64);
00375 }
00376
00377
00378
00379
00381
00388
00389 FLGR_Ret flgr2d_geodesic_skiz(FLGR_Data2D *labelizedImage, FLGR_Data2D *datmask, FLGR_Connexity connexity) {
00390 FLGR_Ret ret;
00391 FLGR_Data2D *nhb;
00392
00393
00394 if((labelizedImage==NULL) || (datmask==NULL)) {
00395 POST_ERROR("Null objects!\n");
00396 return FLGR_RET_NULL_OBJECT;
00397 }
00398
00399 if((ret=flgr2d_is_data_same_attributes(labelizedImage,datmask,__FUNCTION__))!=FLGR_RET_OK) return ret;
00400
00401
00402 nhb = flgr2d_create_neighborhood_from_connexity(datmask->spp,datmask->type,connexity);
00403 if(nhb==NULL) return FLGR_RET_ALLOCATION_ERROR;
00404
00405
00406
00407 switch(labelizedImage->type) {
00408 case FLGR_UINT8:
00409 flgr2d_geodesic_skiz_fgUINT8(labelizedImage,datmask,nhb);
00410 ret = FLGR_RET_OK;break;
00411
00412 case FLGR_UINT16:
00413 flgr2d_geodesic_skiz_fgUINT16(labelizedImage,datmask,nhb);
00414 ret = FLGR_RET_OK;break;
00415
00416 case FLGR_UINT32:
00417 flgr2d_geodesic_skiz_fgUINT32(labelizedImage,datmask,nhb);
00418 ret = FLGR_RET_OK;break;
00419
00420 case FLGR_INT8:
00421 flgr2d_geodesic_skiz_fgINT8(labelizedImage,datmask,nhb);
00422 ret = FLGR_RET_OK;break;
00423
00424 case FLGR_INT16:
00425 flgr2d_geodesic_skiz_fgINT16(labelizedImage,datmask,nhb);
00426 ret = FLGR_RET_OK;break;
00427
00428 case FLGR_INT32:
00429 flgr2d_geodesic_skiz_fgINT32(labelizedImage,datmask,nhb);
00430 ret = FLGR_RET_OK;break;
00431
00432 case FLGR_FLOAT32:
00433 flgr2d_geodesic_skiz_fgFLOAT32(labelizedImage,datmask,nhb);
00434 ret = FLGR_RET_OK;break;
00435
00436 case FLGR_FLOAT64:
00437 flgr2d_geodesic_skiz_fgFLOAT64(labelizedImage,datmask,nhb);
00438 ret = FLGR_RET_OK;break;
00439
00440 default:
00441 ret = FLGR_RET_TYPE_UNKNOWN;break;
00442 }
00443
00444
00445 flgr2d_destroy(nhb);
00446
00447 return ret;
00448 }
00449
00450
00451
00452
00453
00454
00455
00456
00457
00458
00459
00460
00461
00462
00463 #define FLGR2D_MACRO_WATERSHED_BY_GEODESIC_SKIZ(dtype) \
00464 FLGR_Data2D *nhb,*tmp,*mask; \
00465 FLGR_Vector *mini, *maxi, *current, *vectrue, *vecfalse; \
00466 dtype valmin,valmax,m; \
00467 dtype itrue = MAX_##dtype; \
00468 dtype ifalse = MIN_##dtype; \
00469 int i; \
00470 \
00471 \
00472 nhb = flgr2d_create_neighborhood_from_connexity(datsrc->spp, \
00473 datsrc->type, \
00474 connexity); \
00475 \
00476 tmp = flgr2d_create_##dtype(datsrc->size_y, datsrc->size_x, \
00477 datsrc->spp, \
00478 FLGR_NO_SHAPE, \
00479 FLGR_NO_CONNEX); \
00480 \
00481 mask = flgr2d_create_##dtype(datsrc->size_y, datsrc->size_x, \
00482 datsrc->spp, \
00483 FLGR_NO_SHAPE, \
00484 FLGR_NO_CONNEX); \
00485 \
00486 mini = flgr_vector_create(datsrc->spp,datsrc->type); \
00487 maxi = flgr_vector_create(datsrc->spp,datsrc->type); \
00488 current = flgr_vector_create(datsrc->spp,datsrc->type); \
00489 vectrue = flgr_vector_create(datsrc->spp,datsrc->type); \
00490 vecfalse = flgr_vector_create(datsrc->spp,datsrc->type); \
00491 \
00492 flgr_vector_populate_from_scalar(vectrue,&itrue); \
00493 flgr_vector_populate_from_scalar(vecfalse,&ifalse); \
00494 \
00495 flgr2d_measure_min_max_##dtype(datsrc, mini, maxi); \
00496 \
00497 flgr_vector_get_element(mini,0,&valmin); \
00498 flgr_vector_get_element(maxi,0,&valmax); \
00499 \
00500 for(i=((int) valmin) ; i<=((int) valmax) ; i++) { \
00501 m = (dtype) i; \
00502 flgr_vector_populate_from_scalar(current,&m); \
00503 flgr2d_replace_I_with_C_C_C_##dtype(mask, datsrc, FLGR_TEST_INFEQ, \
00504 current, vectrue, vecfalse); \
00505 \
00506 flgr2d_geodesic_skiz_##dtype(labelizedMinima,mask,nhb); \
00507 } \
00508 \
00509 flgr_vector_destroy(mini); \
00510 flgr_vector_destroy(maxi); \
00511 flgr_vector_destroy(current); \
00512 flgr_vector_destroy(vectrue); \
00513 flgr_vector_destroy(vecfalse); \
00514 \
00515 flgr2d_destroy(nhb); \
00516 flgr2d_destroy(mask); \
00517 flgr2d_destroy(tmp);
00518
00519 void flgr2d_watershed_by_skiz_fgBIT(FLGR_Data2D *labelizedMinima, FLGR_Data2D *datsrc, FLGR_Connexity connexity) {
00520
00521 flgr_no_define_type_function(FLGR_BIT);
00522 }
00523 void flgr2d_watershed_by_skiz_fgUINT8(FLGR_Data2D *labelizedMinima, FLGR_Data2D *datsrc, FLGR_Connexity connexity) {
00524
00525 FLGR2D_MACRO_WATERSHED_BY_GEODESIC_SKIZ(fgUINT8);
00526 }
00527 void flgr2d_watershed_by_skiz_fgUINT16(FLGR_Data2D *labelizedMinima, FLGR_Data2D *datsrc, FLGR_Connexity connexity) {
00528
00529 FLGR2D_MACRO_WATERSHED_BY_GEODESIC_SKIZ(fgUINT16);
00530 }
00531 void flgr2d_watershed_by_skiz_fgUINT32(FLGR_Data2D *labelizedMinima, FLGR_Data2D *datsrc, FLGR_Connexity connexity) {
00532
00533 FLGR2D_MACRO_WATERSHED_BY_GEODESIC_SKIZ(fgUINT32);
00534 }
00535 void flgr2d_watershed_by_skiz_fgINT8(FLGR_Data2D *labelizedMinima, FLGR_Data2D *datsrc, FLGR_Connexity connexity) {
00536
00537 FLGR2D_MACRO_WATERSHED_BY_GEODESIC_SKIZ(fgINT8);
00538 }
00539 void flgr2d_watershed_by_skiz_fgINT16(FLGR_Data2D *labelizedMinima, FLGR_Data2D *datsrc, FLGR_Connexity connexity) {
00540
00541 FLGR2D_MACRO_WATERSHED_BY_GEODESIC_SKIZ(fgINT16);
00542 }
00543 void flgr2d_watershed_by_skiz_fgINT32(FLGR_Data2D *labelizedMinima, FLGR_Data2D *datsrc, FLGR_Connexity connexity) {
00544
00545 FLGR2D_MACRO_WATERSHED_BY_GEODESIC_SKIZ(fgINT32);
00546 }
00547 void flgr2d_watershed_by_skiz_fgFLOAT32(FLGR_Data2D *labelizedMinima, FLGR_Data2D *datsrc, FLGR_Connexity connexity) {
00548
00549 FLGR2D_MACRO_WATERSHED_BY_GEODESIC_SKIZ(fgFLOAT32);
00550 }
00551 void flgr2d_watershed_by_skiz_fgFLOAT64(FLGR_Data2D *labelizedMinima, FLGR_Data2D *datsrc, FLGR_Connexity connexity) {
00552
00553 FLGR2D_MACRO_WATERSHED_BY_GEODESIC_SKIZ(fgFLOAT64);
00554 }
00555
00556
00558
00564
00565 FLGR_Ret flgr2d_watershed_by_skiz(FLGR_Data2D *labelizedMinima, FLGR_Data2D *datsrc, FLGR_Connexity connexity) {
00566 FLGR_Ret ret;
00567
00568
00569 if((labelizedMinima==NULL) || (datsrc==NULL)) {
00570 POST_ERROR("Null objects!\n");
00571 return FLGR_RET_NULL_OBJECT;
00572 }
00573
00574 if((ret=flgr2d_is_data_same_attributes(labelizedMinima,datsrc,__FUNCTION__))!=FLGR_RET_OK) return ret;
00575
00576 if(labelizedMinima->spp != 1) {
00577 POST_ERROR("You can use only scalar pixels\n");
00578 return FLGR_RET_VECTOR_SIZE_ERROR;
00579 }
00580
00581 FLGR_DISPATCH_PROCEDURE(labelizedMinima->type,flgr2d_watershed_by_skiz,labelizedMinima,datsrc,connexity);
00582
00583 }