4684: Fix compilation issues in IGR's code.

* sandbox/fabien/igr/Makefile: Add target 'all' and do not use watershed.hh as dependency. * sandbox/fabien/igr/fun_labels.cc, * sandbox/fabien/igr/graph.cc, * sandbox/fabien/igr/mean_slices.cc, * sandbox/fabien/igr/nbasins_finder.cc, * sandbox/fabien/igr/seg2d.cc, * sandbox/fabien/igr/seg_vol_irm.hh, * sandbox/fabien/igr/watershed2d.cc, * sandbox/fabien/igr/watershed3d.cc, * sandbox/fabien/igr/wst_edges.cc: Fix compilations issues. --- milena/sandbox/ChangeLog | 17 +++++ milena/sandbox/fabien/igr/Makefile | 35 +++++++---- milena/sandbox/fabien/igr/fun_labels.cc | 2 +- milena/sandbox/fabien/igr/graph.cc | 77 ++++++++++-------------- milena/sandbox/fabien/igr/mean_slices.cc | 4 +- milena/sandbox/fabien/igr/nbasins_finder.cc | 4 +- milena/sandbox/fabien/igr/seg2d.cc | 4 +- milena/sandbox/fabien/igr/seg_vol_irm.hh | 19 +++--- milena/sandbox/fabien/igr/watershed2d.cc | 87 +++++++++++--------------- milena/sandbox/fabien/igr/watershed3d.cc | 84 +++++++++++--------------- milena/sandbox/fabien/igr/wst_edges.cc | 2 +- 11 files changed, 160 insertions(+), 175 deletions(-) diff --git a/milena/sandbox/ChangeLog b/milena/sandbox/ChangeLog index 08e7332..4191a7e 100644 --- a/milena/sandbox/ChangeLog +++ b/milena/sandbox/ChangeLog @@ -1,5 +1,22 @@ 2009-10-28 Guillaume Lazzara <z@lrde.epita.fr> + Fix compilation issues in IGR's code. + + * sandbox/fabien/igr/Makefile: Add target 'all' and do not use + watershed.hh as dependency. + + * sandbox/fabien/igr/fun_labels.cc, + * sandbox/fabien/igr/graph.cc, + * sandbox/fabien/igr/mean_slices.cc, + * sandbox/fabien/igr/nbasins_finder.cc, + * sandbox/fabien/igr/seg2d.cc, + * sandbox/fabien/igr/seg_vol_irm.hh, + * sandbox/fabien/igr/watershed2d.cc, + * sandbox/fabien/igr/watershed3d.cc, + * sandbox/fabien/igr/wst_edges.cc: Fix compilations issues. + +2009-10-28 Guillaume Lazzara <z@lrde.epita.fr> + Update IGR's GUI. * demo.pro: Include new files. diff --git a/milena/sandbox/fabien/igr/Makefile b/milena/sandbox/fabien/igr/Makefile index e532fe8..8ded9e0 100644 --- a/milena/sandbox/fabien/igr/Makefile +++ b/milena/sandbox/fabien/igr/Makefile @@ -1,23 +1,33 @@ include Makefile.rules +TGT= seg2d seg3d wsd2d wsd3d nbasins \ + grad clo_vol wst maj graph med \ + thres matlab time_max time_max_norm \ + fun_labels mean_slices \ + crop label2gif min_max_float filter \ + norm dist_edges wst_edges mean_median_label \ + filter_morpho_us + +all: $(TGT) + seg2d: seg_vol_irm.hh seg2d.cc ${CXX} -I../../../ ${DICOM} ${CXXFLAGS} seg2d.cc -o seg2d seg3d: seg_vol_irm.hh seg3d.cc ${CXX} -I../../../ ${DICOM} ${CXXFLAGS} seg3d.cc -o seg3d -wsd2d: watershed.hh watershed2d.cc +wsd2d: watershed2d.cc ${CXX} -I../../../ ${DICOM} ${CXXFLAGS} $^ -o wsd2d -wsd3d: watershed.hh watershed3d.cc +wsd3d: watershed3d.cc ${CXX} -I../../../ ${DICOM} ${CXXFLAGS} $^ -o wsd3d nbasins: nbasins_finder.cc ${CXX} -I../../../ ${DICOM} ${CXXFLAGS} $^ -o nbasins_finder - + grad: grad.cc ${CXX} -I../../../ ${CXXFLAGS} $^ -o grad - + clo_vol: clo_vol.cc ${CXX} -I../../../ ${CXXFLAGS} $^ -o clo_vol @@ -26,27 +36,24 @@ wst: wst.cc maj: maj.cc ${CXX} -I../../../ ${CXXFLAGS} $^ -o maj - + graph: graph.cc ${CXX} -I../../../ ${DICOM} ${CXXFLAGS} $^ -o graph - + med: med.cc ${CXX} -I../../../ ${CXXFLAGS} $^ -o med - + thres: thres.cc ${CXX} -I../../../ ${CXXFLAGS} $^ -o thres - + matlab: matlab.cc ${CXX} -I../../../ ${DICOM} ${CXXFLAGS} -lm $^ -o matlab - + time_max: time_max.cc ${CXX} -I../../../ ${DICOM} ${MAGICK} ${CXXFLAGS} -lm $^ -o time_max - + time_max_norm: time_max_norm.cc ${CXX} -I../../../ ${CXXFLAGS} -lm $^ -o time_max_norm - -first_slice_dicom: first_slice_dicom.cc - ${CXX} -I../../../ ${DICOM} ${MAGICK} ${CXXFLAGS} -lm $^ -o first_slice_dicom fun_labels: fun_labels.cc ${CXX} -I../../../ ${CXXFLAGS} $^ -o fun_labels @@ -73,7 +80,7 @@ norm: norm.cc dist_edges: dist_edges.cc ${CXX} -I../../../ ${CXXFLAGS} $^ -o dist_edges - + wst_edges: wst_edges.cc ${CXX} -I../../../ ${CXXFLAGS} $^ -o wst_edges diff --git a/milena/sandbox/fabien/igr/fun_labels.cc b/milena/sandbox/fabien/igr/fun_labels.cc index 6e48b70..52e661a 100644 --- a/milena/sandbox/fabien/igr/fun_labels.cc +++ b/milena/sandbox/fabien/igr/fun_labels.cc @@ -133,7 +133,7 @@ void plot_all_labels(Image<I>& ima, Image<L>& ima_labels, unsigned nlabels) template <typename L> inline -void save_label_plot(int count, const char* desc, L prev_lbl, util::array<float> arr, int start) +void save_label_plot(int count, const char* desc, L prev_lbl, const util::array<float>& arr, int start) { std::ostringstream slabel; if (count < 10) diff --git a/milena/sandbox/fabien/igr/graph.cc b/milena/sandbox/fabien/igr/graph.cc index 80f7656..b0efdc5 100644 --- a/milena/sandbox/fabien/igr/graph.cc +++ b/milena/sandbox/fabien/igr/graph.cc @@ -1,64 +1,53 @@ #include <iostream> -#include <mln/core/image/image2d.hh> -#include <mln/core/image/image3d.hh> -#include <mln/core/image/dmorph/image_if.hh> +#include <mln/core/alias/dpoint2d.hh> #include <mln/core/alias/neighb2d.hh> -#include <mln/core/alias/window2d.hh> #include <mln/core/alias/neighb3d.hh> +#include <mln/core/alias/vec3d.hh> +#include <mln/core/alias/window2d.hh> #include <mln/core/alias/window3d.hh> +#include <mln/core/image/dmorph/image_if.hh> +#include <mln/core/image/image2d.hh> +#include <mln/core/image/image3d.hh> +#include <mln/core/routine/extend.hh> +#include <mln/core/var.hh> -#include <mln/io/dump/all.hh> -#include <mln/io/dicom/load.hh> -#include <mln/io/pgm/save.hh> -#include <mln/io/ppm/save.hh> - -#include <mln/value/int_u8.hh> -#include <mln/value/int_u12.hh> -#include <mln/value/label_16.hh> -#include <mln/value/label_32.hh> -#include <mln/value/rgb8.hh> - -#include <mln/morpho/watershed/flooding.hh> - -#include <mln/math/diff_abs.hh> - -#include <mln/labeling/mean_values.hh> - +#include <mln/accu/center.hh> +#include <mln/accu/compute.hh> #include <mln/convert/to_fun.hh> -#include <mln/make/graph.hh> -#include <mln/util/graph.hh> +#include <mln/data/stretch.hh> -#include <mln/fun/l2l/wrap.hh> +#include <mln/debug/draw_graph.hh> -#include <mln/core/var.hh> -#include <mln/morpho/elementary/dilation.hh> +#include <mln/draw/box.hh> -#include <mln/core/routine/extend.hh> +#include <mln/fun/v2v/id.hh> -#include <mln/core/alias/vec3d.hh> -#include <mln/debug/draw_graph.hh> -#include <mln/accu/center.hh> +#include <mln/io/dicom/load.hh> #include <mln/io/dump/all.hh> -#include <mln/value/label_8.hh> -#include <mln/value/rgb16.hh> -#include <mln/accu/compute.hh> -#include <mln/core/alias/dpoint2d.hh> -#include <mln/draw/box.hh> -#include <mln/data/stretch.hh> -#include <mln/fun/v2v/id.hh> -#include <mln/fun/l2l/wrap.hh> -#include <mln/core/image/line_graph_elt_neighborhood.hh> +#include <mln/io/pgm/save.hh> +#include <mln/io/ppm/save.hh> + +#include <mln/labeling/colorize.hh> #include <mln/labeling/mean_values.hh> -#include <mln/extension/adjust_fill.hh> -#include <mln/extract/all.hh> + #include <mln/make/region_adjacency_graph.hh> -#include <mln/labeling/colorize.hh> +#include <mln/math/diff_abs.hh> +#include <mln/morpho/elementary/dilation.hh> +#include <mln/morpho/watershed/flooding.hh> +#include <mln/util/graph.hh> +#include <mln/value/int_u12.hh> +#include <mln/value/int_u8.hh> +#include <mln/value/label_16.hh> +#include <mln/value/label_32.hh> +#include <mln/value/label_8.hh> +#include <mln/value/rgb16.hh> +#include <mln/value/rgb8.hh> // Given a color image and a wshed image, computes the component graph. // Vertex values are computed thanks to a RGB image. @@ -274,7 +263,7 @@ int main(int argc, char *argv[]) io::dicom::load(dcm, argv[3]); /// Build graph - util::graph g = make::graph(wshed, c4(), nbasins); + util::graph g = make::region_adjacency_graph(wshed, c4(), nbasins); // Build graph images and compute distance values with a RGB image. mln_VAR(ima_v, make_vertex_graph_image(g, dcm, wshed, nbasins)); mln_VAR(ima_e, make_edge_graph_image(ima_v, g)); @@ -308,7 +297,7 @@ int main(int argc, char *argv[]) image2d<label_16> wsd2 = data::transform(wshed, f); /// Reconstruct a graph from the simplified image. - util::graph g2 = make::graph(wsd2, c4(), nbasins2); + util::graph g2 = make::region_adjacency_graph(wsd2, c4(), nbasins2); // Compute distance values with a RGB image. mln_VAR(ima_v2, make_vertex_graph_image(g2, dcm, wsd2, nbasins2)); diff --git a/milena/sandbox/fabien/igr/mean_slices.cc b/milena/sandbox/fabien/igr/mean_slices.cc index fe3c38b..d064692 100644 --- a/milena/sandbox/fabien/igr/mean_slices.cc +++ b/milena/sandbox/fabien/igr/mean_slices.cc @@ -25,7 +25,7 @@ #include <mln/accu/stat/mean.hh> #include <mln/accu/stat/median_h.hh> -#include <mln/labeling/relabel.hh> +#include <mln/labeling/pack.hh> #include <mln/labeling/mean_values.hh> #include <mln/data/compute.hh> #include <mln/make/image3d.hh> @@ -76,7 +76,7 @@ int main(int argc, char *argv[]) { image2d<int_u12> sli = duplicate(slice(ima, i)); image2d<L> sli_labels = duplicate(slice(ima_labels, i)); - image2d<L> labels = labeling::relabel(sli_labels, nlabels); + image2d<L> labels = labeling::pack(sli_labels, nlabels); mln_VAR(mean_slice, labeling::mean_values(sli, labels, nlabels)); arr.append(mean_slice); } diff --git a/milena/sandbox/fabien/igr/nbasins_finder.cc b/milena/sandbox/fabien/igr/nbasins_finder.cc index f1a4337..a621e2b 100644 --- a/milena/sandbox/fabien/igr/nbasins_finder.cc +++ b/milena/sandbox/fabien/igr/nbasins_finder.cc @@ -25,8 +25,6 @@ #include <mln/morpho/closing/volume.hh> #include <mln/morpho/watershed/flooding.hh> -#include <mln/fun/l2l/wrap.hh> - #include <mln/labeling/colorize.hh> @@ -72,7 +70,7 @@ int main(int argc, char *argv[]) // Visualization std::cout << " nbasins = " << nbasins << std::endl; - //io::dump::save(data::transform(wshed, fun::l2l::wrap<int_u8>()), "result_nbasins.dump"); + //io::dump::save(data::transform(wshed, fun::v2v::wrap<int_u8>()), "result_nbasins.dump"); //io::dump::save(data::stretch(int_u8(), wshed), "result_nbasins.dump"); io::dump::save(labeling::colorize(rgb8(), wshed, nbasins), "result_nbasins.dump"); diff --git a/milena/sandbox/fabien/igr/seg2d.cc b/milena/sandbox/fabien/igr/seg2d.cc index a14e57a..5cc49d8 100644 --- a/milena/sandbox/fabien/igr/seg2d.cc +++ b/milena/sandbox/fabien/igr/seg2d.cc @@ -40,14 +40,14 @@ int main(int argc, char* argv[]) data::fill(ima_thres, false); unsigned threshold_value = find_threshold_value(ima, c4()); std::cout << "double threshold value = " << threshold_value << std::endl; - data::fill((ima_thres | pw::value(ima) < pw::cst(threshold_value)).rw(), true); + data::fill((ima_thres | (pw::value(ima) < pw::cst(threshold_value))).rw(), true); io::pbm::save(ima_thres, "result_double.pbm"); data::fill(ima_thres, false); threshold_value = find_threshold_mean(ima, c4()); std::cout << " deviation threshold value = " << threshold_value << std::endl; - data::fill((ima_thres | pw::value(ima) < pw::cst(threshold_value)).rw(), true); + data::fill((ima_thres | (pw::value(ima) < pw::cst(threshold_value))).rw(), true); io::pbm::save(ima_thres, "result_deviation.pbm"); diff --git a/milena/sandbox/fabien/igr/seg_vol_irm.hh b/milena/sandbox/fabien/igr/seg_vol_irm.hh index 8c1711d..a82beb5 100644 --- a/milena/sandbox/fabien/igr/seg_vol_irm.hh +++ b/milena/sandbox/fabien/igr/seg_vol_irm.hh @@ -186,7 +186,7 @@ find_threshold_value(const Image<I>& input, const Neighborhood<N>& nbh) unsigned result = 0; // We remove the 0 value because it is not part of the image. - histo::array<mln_value(I)> arr_histo = histo::compute(input | pw::value(input) != 0); + histo::array<mln_value(I)> arr_histo = histo::compute(input | (pw::value(input) != 0)); image1d<unsigned> ima_histo; convert::from_to(arr_histo, ima_histo); @@ -205,12 +205,12 @@ find_threshold_value(const Image<I>& input, const Neighborhood<N>& nbh) { if (!low_done && ((ima_histo(point1d(i)) * 100) / max) > bg_thres) { - data::fill((ima_bg | pw::value(input) < pw::cst(i)).rw(), true); + data::fill((ima_bg | (pw::value(input) < pw::cst(i))).rw(), true); low_done = true; } if (!high_done && ((ima_histo(point1d(i)) * 100) / max) > (100 - obj_thres)) { - data::fill((ima_obj | pw::value(input) > pw::cst(i)).rw(), true); + data::fill((ima_obj | (pw::value(input) > pw::cst(i))).rw(), true); high_done = true; } } @@ -246,9 +246,9 @@ find_threshold_value(const Image<I>& input, const Neighborhood<N>& nbh) data::fill((ima_obj | (pw::value(obj_labels) != pw::cst(arr_o_big[1]))).rw(), false);*/ // Debug output images - mln_ch_value(I, rgb8) out = data::convert(rgb8(), level::stretch(int_u8(), input)); - data::fill((out | pw::value(morpho::elementary::gradient_internal(ima_bg, nbh)) == true).rw(), literal::red); - data::fill((out | pw::value(morpho::elementary::gradient_internal(ima_obj, nbh)) == true).rw(), literal::green); + mln_ch_value(I, rgb8) out = data::convert(rgb8(), data::stretch(int_u8(), input)); + data::fill((out | (pw::value(morpho::elementary::gradient_internal(ima_bg, nbh)) == true)).rw(), literal::red); + data::fill((out | (pw::value(morpho::elementary::gradient_internal(ima_obj, nbh)) == true)).rw(), literal::green); save_regions_color(out, metal::int_<I::site::dim>()); if (I::site::dim == 2) { @@ -262,8 +262,8 @@ find_threshold_value(const Image<I>& input, const Neighborhood<N>& nbh) } // Histo - histo::array<mln_value(I)> bg_histo = histo::compute(input | pw::value(ima_bg) == true); - histo::array<mln_value(I)> obj_histo = histo::compute(input | pw::value(ima_obj) == true); + histo::array<mln_value(I)> bg_histo = histo::compute(input | (pw::value(ima_bg) == true)); + histo::array<mln_value(I)> obj_histo = histo::compute(input | (pw::value(ima_obj) == true)); accu::math::sum<unsigned> sum_accu; image1d<unsigned> ima_bg_histo; @@ -313,13 +313,14 @@ template <typename I, typename N> unsigned find_threshold_mean(const Image<I>& input, const Neighborhood<N>& nbh) { + (void) nbh; unsigned coef = 1; accu::stat::mean<unsigned> mean_accu; unsigned mean = data::compute(mean_accu, (input | (pw::value(input) != 0))); accu::stat::deviation<unsigned, unsigned, float> dev_accu(mean); - float deviation = data::compute(dev_accu, (input | pw::value(input) != 0)); + float deviation = data::compute(dev_accu, (input | (pw::value(input) != 0))); std::cout << "[mean = " << mean << " | deviation = " << deviation << "]"; return floor(mean + coef * deviation); diff --git a/milena/sandbox/fabien/igr/watershed2d.cc b/milena/sandbox/fabien/igr/watershed2d.cc index 858236e..09ece2c 100644 --- a/milena/sandbox/fabien/igr/watershed2d.cc +++ b/milena/sandbox/fabien/igr/watershed2d.cc @@ -1,64 +1,51 @@ #include <iostream> -#include <mln/core/image/image2d.hh> + +#include <mln/core/alias/dpoint2d.hh> #include <mln/core/alias/neighb2d.hh> +#include <mln/core/alias/vec3d.hh> #include <mln/core/alias/window2d.hh> #include <mln/core/image/dmorph/image_if.hh> +#include <mln/core/image/image2d.hh> +#include <mln/core/routine/extend.hh> +#include <mln/core/var.hh> -#include <mln/io/ppm/save.hh> -#include <mln/io/ppm/load.hh> -#include <mln/io/pgm/load.hh> -#include <mln/io/dicom/load.hh> -#include <mln/io/pgm/save.hh> -#include <mln/io/dump/save.hh> - -#include <mln/value/rgb8.hh> -#include <mln/value/int_u8.hh> -#include <mln/value/int_u12.hh> -#include <mln/value/label_16.hh> +#include <mln/accu/center.hh> +#include <mln/accu/compute.hh> +#include <mln/convert/to_fun.hh> -#include <mln/data/transform.hh> #include <mln/data/stretch.hh> +#include <mln/data/transform.hh> -#include <mln/labeling/mean_values.hh> +#include <mln/debug/draw_graph.hh> -#include <mln/convert/to_fun.hh> +#include <mln/draw/box.hh> -#include <mln/make/graph.hh> +#include <mln/fun/v2v/id.hh> +#include <mln/fun/v2v/wrap.hh> -#include <mln/morpho/gradient.hh> -#include <mln/morpho/closing/area.hh> -#include <mln/morpho/meyer_wst.hh> +#include <mln/io/dicom/load.hh> +#include <mln/io/dump/save.hh> +#include <mln/io/pgm/all.hh> +#include <mln/io/ppm/all.hh> -#include <mln/fun/l2l/wrap.hh> +#include <mln/labeling/mean_values.hh> -#include <mln/core/var.hh> -#include <mln/morpho/elementary/dilation.hh> +#include <mln/make/region_adjacency_graph.hh> -#include <mln/core/routine/extend.hh> +#include <mln/math/diff_abs.hh> -#include <mln/util/graph.hh> +#include <mln/morpho/closing/area.hh> +#include <mln/morpho/elementary/dilation.hh> +#include <mln/morpho/gradient.hh> +#include <mln/morpho/meyer_wst.hh> -#include <mln/essential/2d.hh> -#include <mln/core/alias/vec3d.hh> -#include <mln/debug/draw_graph.hh> #include <mln/util/graph.hh> -#include <mln/accu/center.hh> -#include <mln/io/dump/all.hh> -#include <mln/value/label_8.hh> -#include <mln/value/rgb16.hh> -#include <mln/accu/compute.hh> -#include <mln/core/alias/dpoint2d.hh> -#include <mln/draw/box.hh> -#include <mln/data/stretch.hh> -#include <mln/fun/v2v/id.hh> -#include <mln/fun/l2l/wrap.hh> -#include <mln/core/image/line_graph_elt_neighborhood.hh> -#include <mln/morpho/elementary/dilation.hh> -#include <mln/labeling/mean_values.hh> -#include <mln/extension/adjust_fill.hh> -#include <mln/extract/all.hh> -#include <mln/make/region_adjacency_graph.hh> + +#include <mln/value/int_u12.hh> +#include <mln/value/int_u8.hh> +#include <mln/value/label_16.hh> +#include <mln/value/rgb8.hh> @@ -268,16 +255,16 @@ int main(int argc, char *argv[]) image2d<label_16> wshed = morpho::meyer_wst(clo, c4(), nbasins); io::pgm::save(data::stretch(int_u8(), clo), "wsd_02.pgm"); - io::pgm::save(data::transform(wshed, fun::l2l::wrap<int_u8>()), "wsd_03.pgm"); + io::pgm::save(data::transform(wshed, fun::v2v::wrap<int_u8>()), "wsd_03.pgm"); mln_VAR(vol2_, morpho::elementary::dilation(extend(wshed | (pw::value(wshed) == 0u), wshed), c8())); data::fill((wshed | (pw::value(wshed) == 0u)).rw(), vol2_); - io::pgm::save(data::transform(wshed, fun::l2l::wrap<int_u8>()), "wsd_04.pgm"); + io::pgm::save(data::transform(wshed, fun::v2v::wrap<int_u8>()), "wsd_04.pgm"); /// Build graph - util::graph g = make::graph(wshed, c4(), nbasins); + util::graph g = make::region_adjacency_graph(wshed, c4(), nbasins); // Build graph images and compute distance values with a RGB image. mln_VAR(ima_v, make_vertex_graph_image(g, dcm, wshed, nbasins)); mln_VAR(ima_e, make_edge_graph_image(ima_v, g)); @@ -311,10 +298,10 @@ int main(int argc, char *argv[]) --nbasins2; // nbasins2 does not count the basin with label 0. image2d<label_16> wsd2 = data::transform(wshed, f); - io::pgm::save(data::transform(wsd2, fun::l2l::wrap<int_u8>()), "wsd_05.pgm"); + io::pgm::save(data::transform(wsd2, fun::v2v::wrap<int_u8>()), "wsd_05.pgm"); /// Reconstruct a graph from the simplified image. - util::graph g2 = make::graph(wsd2, c4(), nbasins2); + util::graph g2 = make::region_adjacency_graph(wsd2, c4(), nbasins2); // Compute distance values with a RGB image. mln_VAR(ima_v2, make_vertex_graph_image(g2, dcm, wsd2, nbasins2)); @@ -324,8 +311,8 @@ int main(int argc, char *argv[]) data::fill((wsd2 | (pw::value(wsd2) == 0u)).rw(), wsd2_); - io::pgm::save(data::transform(labeling::mean_values(dcm, wsd2, nbasins2), fun::l2l::wrap<int_u8>()), "wsd_06_mean_colors.pgm"); + io::pgm::save(data::transform(labeling::mean_values(dcm, wsd2, nbasins2), fun::v2v::wrap<int_u8>()), "wsd_06_mean_colors.pgm"); io::pgm::save(data::stretch(int_u8(), make_debug_graph_image(dcm, ima_v2, ima_e2, box_size, 4095)), "wsd_07_graph_image2_white.pgm"); io::pgm::save(data::stretch(int_u8(), make_debug_graph_image(dcm, ima_v2, ima_e2, box_size, 0)), "wsd_08_graph_image2_black.pgm"); - io::pgm::save(data::transform(wsd2, fun::l2l::wrap<int_u8>()), "wsd_99_result.pgm"); + io::pgm::save(data::transform(wsd2, fun::v2v::wrap<int_u8>()), "wsd_99_result.pgm"); } diff --git a/milena/sandbox/fabien/igr/watershed3d.cc b/milena/sandbox/fabien/igr/watershed3d.cc index 18d4276..3b38bc3 100644 --- a/milena/sandbox/fabien/igr/watershed3d.cc +++ b/milena/sandbox/fabien/igr/watershed3d.cc @@ -1,69 +1,55 @@ #include <iostream> -#include <mln/core/image/image2d.hh> -#include <mln/core/image/image3d.hh> +#include <mln/core/alias/dpoint2d.hh> #include <mln/core/alias/neighb2d.hh> -#include <mln/core/alias/window2d.hh> #include <mln/core/alias/neighb3d.hh> +#include <mln/core/alias/vec3d.hh> +#include <mln/core/alias/window2d.hh> #include <mln/core/alias/window3d.hh> #include <mln/core/image/dmorph/image_if.hh> +#include <mln/core/image/image2d.hh> +#include <mln/core/image/image3d.hh> +#include <mln/core/routine/extend.hh> +#include <mln/core/var.hh> -#include <mln/io/ppm/save.hh> -#include <mln/io/ppm/load.hh> -#include <mln/io/pgm/load.hh> -#include <mln/io/dicom/load.hh> -#include <mln/io/pgm/save.hh> -#include <mln/io/dump/save.hh> +#include <mln/accu/center.hh> +#include <mln/accu/compute.hh> -#include <mln/value/rgb8.hh> -#include <mln/value/int_u8.hh> -#include <mln/value/int_u12.hh> -#include <mln/value/label_16.hh> -#include <mln/value/label_32.hh> +#include <mln/convert/to_fun.hh> -#include <mln/data/transform.hh> #include <mln/data/stretch.hh> +#include <mln/data/transform.hh> -#include <mln/labeling/mean_values.hh> +#include <mln/debug/draw_graph.hh> -#include <mln/convert/to_fun.hh> +#include <mln/draw/box.hh> -#include <mln/make/graph.hh> +#include <mln/fun/v2v/wrap.hh> +#include <mln/fun/v2v/id.hh> -#include <mln/morpho/elementary/dilation.hh> -#include <mln/morpho/elementary/gradient.hh> -#include <mln/morpho/closing/volume.hh> -#include <mln/morpho/meyer_wst.hh> +#include <mln/io/dicom/load.hh> +#include <mln/io/dump/save.hh> +#include <mln/io/pgm/all.hh> +#include <mln/io/ppm/all.hh> -#include <mln/fun/l2l/wrap.hh> +#include <mln/labeling/mean_values.hh> -#include <mln/core/var.hh> +#include <mln/make/region_adjacency_graph.hh> -#include <mln/core/routine/extend.hh> +#include <mln/morpho/closing/volume.hh> +#include <mln/morpho/elementary/dilation.hh> +#include <mln/morpho/elementary/gradient.hh> +#include <mln/morpho/meyer_wst.hh> #include <mln/util/graph.hh> -#include <mln/essential/2d.hh> -#include <mln/core/alias/vec3d.hh> -#include <mln/debug/draw_graph.hh> -#include <mln/util/graph.hh> -#include <mln/accu/center.hh> -#include <mln/io/dump/all.hh> +#include <mln/value/int_u12.hh> +#include <mln/value/int_u8.hh> +#include <mln/value/label_16.hh> +#include <mln/value/label_32.hh> #include <mln/value/label_8.hh> #include <mln/value/rgb16.hh> -#include <mln/accu/compute.hh> -#include <mln/core/alias/dpoint2d.hh> -#include <mln/draw/box.hh> -#include <mln/data/stretch.hh> -#include <mln/fun/v2v/id.hh> -#include <mln/fun/l2l/wrap.hh> -#include <mln/core/image/line_graph_elt_neighborhood.hh> -#include <mln/morpho/elementary/dilation.hh> -#include <mln/labeling/mean_values.hh> -#include <mln/extension/adjust_fill.hh> -#include <mln/extract/all.hh> -#include <mln/make/region_adjacency_graph.hh> - +#include <mln/value/rgb8.hh> // Given a color image and a wshed image, computes the component graph. @@ -281,12 +267,12 @@ int main(int argc, char *argv[]) // Debug io::dump::save(data::stretch(int_u8(), clo), "wsd_02.dump"); - io::dump::save(data::transform(wshed, fun::l2l::wrap<int_u8>()), "wsd_03.dump"); + io::dump::save(data::transform(wshed, fun::v2v::wrap<int_u8>()), "wsd_03.dump"); //mln_VAR(vol2_, morpho::elementary::dilation(extend(wshed | (pw::value(wshed) == 0u), wshed), c26())); //data::fill((wshed | (pw::value(wshed) == 0u)).rw(), vol2_); - io::dump::save(data::transform(wshed, fun::l2l::wrap<int_u8>()), "wsd_04.dump"); + io::dump::save(data::transform(wshed, fun::v2v::wrap<int_u8>()), "wsd_04.dump"); /// Graph trace::quiet = false; @@ -324,7 +310,7 @@ int main(int argc, char *argv[]) --nbasins2; // nbasins2 does not count the basin with label 0. image3d<label_32> wsd2 = data::transform(wshed, f); - io::dump::save(data::transform(wsd2, fun::l2l::wrap<int_u8>()), "wsd_05.dump"); + io::dump::save(data::transform(wsd2, fun::v2v::wrap<int_u8>()), "wsd_05.dump"); /// Reconstruct a graph from the simplified image. util::graph g2 = make::graph(wsd2, c6(), nbasins2); @@ -337,8 +323,8 @@ int main(int argc, char *argv[]) data::fill((wsd2 | (pw::value(wsd2) == 0u)).rw(), wsd2_); - io::dump::save(data::transform(labeling::mean_values(dcm, wsd2, nbasins2), fun::l2l::wrap<int_u8>()), "wsd_06_mean_colors.dump"); + io::dump::save(data::transform(labeling::mean_values(dcm, wsd2, nbasins2), fun::v2v::wrap<int_u8>()), "wsd_06_mean_colors.dump"); //io::dump::save(data::stretch(int_u8(), make_debug_graph_image(dcm, ima_v2, ima_e2, box_size, 4095)), "wsd_07_graph_image2_white.dump"); //io::dump::save(data::stretch(int_u8(), make_debug_graph_image(dcm, ima_v2, ima_e2, box_size, 0)), "wsd_08_graph_image2_black.dump"); - io::dump::save(data::transform(wsd2, fun::l2l::wrap<int_u8>()), "wsd_99_result.dump");*/ + io::dump::save(data::transform(wsd2, fun::v2v::wrap<int_u8>()), "wsd_99_result.dump");*/ } diff --git a/milena/sandbox/fabien/igr/wst_edges.cc b/milena/sandbox/fabien/igr/wst_edges.cc index 3524ca8..1d7f37f 100644 --- a/milena/sandbox/fabien/igr/wst_edges.cc +++ b/milena/sandbox/fabien/igr/wst_edges.cc @@ -58,7 +58,7 @@ #include "plot_points/int2rgb.hh" -#include <mln/world/inter_pixel/display_region.hh> +#include <mln/world/inter_pixel/display_edge.hh> using namespace mln; -- 1.5.6.5
participants (1)
-
Guillaume Lazzara