Commit 08d57c51 authored by Fabien Freling's avatar Fabien Freling
Browse files

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.

git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@4198 4aad255d-cdde-0310-9447-f3009e2ae8c0
parent c0582c29
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.
2009-06-19 Etienne FOLIO <folio@lrde.epita.fr>
Add tools for histogram projections and visualization.
......
#!/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
......@@ -32,7 +32,7 @@ int main(int argc, char *argv[])
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)
......
#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 mln
namespace debug
{
using value::rgb8;
/// \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 V>
image2d<rgb8>
int2rgb(const image2d<V>& input)
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 @@ namespace mln
output(p).red() = value % 256;
}
trace::exiting("debug::int2rgb");
return output;
}
} // end of namespace mln::debug
#endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln::debug
} // end of namespace mln
#endif // ! MLN_DEBUG_INT2RGB_HH
......@@ -44,8 +44,6 @@
# include <mln/opt/at.hh>
# include <mln/value/rgb8.hh>
#include <mln/literal/colors.hh> //DEBUG
namespace mln
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment