r4198: Update for US images

URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena/sandbox ChangeLog: 2009-06-25 Fabien Freling <fabien.freling@lrde.epita.fr> Update for US images. * fabien/igr/check_us_morpho.sh: New script for US images. * fabien/igr/wst.cc: Update label type to label_16. * fabien/mln/debug/int2rgb.hh: Clean code. * fabien/mln/world/inter_pixel/display_region.hh: Clean code. --- igr/check_us_morpho.sh | 46 ++++++++++++++++++++ igr/wst.cc | 2 mln/debug/int2rgb.hh | 71 ++++++++++++++++++++++++++++---- mln/world/inter_pixel/display_region.hh | 2 4 files changed, 110 insertions(+), 11 deletions(-) Index: trunk/milena/sandbox/fabien/igr/check_us_morpho.sh =================================================================== --- trunk/milena/sandbox/fabien/igr/check_us_morpho.sh (revision 0) +++ trunk/milena/sandbox/fabien/igr/check_us_morpho.sh (revision 4198) @@ -0,0 +1,46 @@ +#!/bin/sh + + +process () +{ + ./grad $1 3 ${2}_us_grad.dump + if [ $? -gt 0 ]; then + echo "error: grad failed" + exit + fi + + for lambda in 500 1000 2000; do + + ./clo_vol ${2}_us_grad.dump 3 $lambda ${2}_us_clo_${lambda}.dump + if [ $? -gt 0 ]; then + echo "error: clo_vol failed" + exit + fi + + nbasins=`./wst ${2}_us_clo_${lambda}.dump 3 ${2}_us_wst_${lambda}.dump` + if [ $? -gt 0 ]; then + echo "error: wst failed" + echo "nbasins: $nbasins" + exit + fi + +#./maj ${2}_us_wst_${lambda}.dump ${2}_us_maj_${lambda}.dump +# if [ $? -gt 0 ]; then +# echo "error: maj failed" +# exit +# fi + + ../bin/dumpl16_to_colorize ${2}_us_wst_${lambda}.dump 3 $nbasins ${2}_us_maj_${lambda}.ppm + convert ${2}_us_maj_${lambda}.ppm ${2}_us_maj_${lambda}.png + rm ${2}_us_maj_${lambda}.ppm + + done + + # Cleanup. +#rm *.pgm *.ppm +} + + +# $1 = input.dump +# $2 = name +process $1 $2 Property changes on: trunk/milena/sandbox/fabien/igr/check_us_morpho.sh ___________________________________________________________________ Name: svn:executable + * Index: trunk/milena/sandbox/fabien/igr/wst.cc =================================================================== --- trunk/milena/sandbox/fabien/igr/wst.cc (revision 4197) +++ trunk/milena/sandbox/fabien/igr/wst.cc (revision 4198) @@ -32,7 +32,7 @@ using value::int_u12; using value::label_8; using value::label_16; - typedef label_8 L; + typedef label_16 L; typedef int_u8 V; if (argc != 4) Index: trunk/milena/sandbox/fabien/mln/debug/int2rgb.hh =================================================================== --- trunk/milena/sandbox/fabien/mln/debug/int2rgb.hh (revision 4197) +++ trunk/milena/sandbox/fabien/mln/debug/int2rgb.hh (revision 4198) @@ -1,4 +1,36 @@ -#include <mln/core/image/image2d.hh> +// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE) +// +// This file is part of Olena. +// +// Olena is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free +// Software Foundation, version 2 of the License. +// +// Olena is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Olena. If not, see <http://www.gnu.org/licenses/>. +// +// As a special exception, you may use this file as part of a free +// software project without restriction. Specifically, if other files +// instantiate templates or use macros or inline functions from this +// file, or you compile this file and link it with other files to produce +// an executable, this file does not by itself cause the resulting +// executable to be covered by the GNU General Public License. This +// exception does not however invalidate any other reasons why the +// executable file might be covered by the GNU General Public License. + +#ifndef MLN_DEBUG_INT2RGB_HH +# define MLN_DEBUG_INT2RGB_HH + +/// \file +/// +/// FIXME + +#include <mln/core/concept/image.hh> #include <mln/value/rgb8.hh> @@ -8,16 +40,33 @@ namespace debug { - using value::rgb8; - - template <typename V> - image2d<rgb8> - int2rgb(const image2d<V>& input) + /// \brief FIXME + /// + /// \param[in] input The input image. + /// \return An image which values are cut into rgb channels. + /// It allows visualization of integer values superior to 256. + /// + template <typename I> + inline + mln_ch_value(I, value::rgb8) + int2rgb(const Image<I>& input); + + +#ifndef MLN_INCLUDE_ONLY + + template <typename I> + inline + mln_ch_value(I, value::rgb8) + int2rgb(const Image<I>& input_) { - image2d<rgb8> output; + trace::entering("debug::int2rgb"); + + const I& input = exact(input_); + + mln_ch_value(I, value::rgb8) output; initialize(output, input); - mln_piter(image2d<V>) p(input.domain()); + mln_piter(I) p(input.domain()); for_all(p) { unsigned value = input(p); @@ -28,9 +77,15 @@ output(p).red() = value % 256; } + trace::exiting("debug::int2rgb"); return output; } +#endif // ! MLN_INCLUDE_ONLY + + } // end of namespace mln::debug } // end of namespace mln + +#endif // ! MLN_DEBUG_INT2RGB_HH Index: trunk/milena/sandbox/fabien/mln/world/inter_pixel/display_region.hh =================================================================== --- trunk/milena/sandbox/fabien/mln/world/inter_pixel/display_region.hh (revision 4197) +++ trunk/milena/sandbox/fabien/mln/world/inter_pixel/display_region.hh (revision 4198) @@ -44,8 +44,6 @@ # include <mln/opt/at.hh> # include <mln/value/rgb8.hh> -#include <mln/literal/colors.hh> //DEBUG - namespace mln {
participants (1)
-
Fabien Freling