Commit 0e13f810 authored by Guillaume Lazzara's avatar Guillaume Lazzara
Browse files

Rename nslis to nslices.

	* mln/geom/nslis.hh,
	* tests/geom/nslis.cc: Rename as...

	* mln/geom/nslices.hh,
	* tests/geom/nslices.cc: ... this.

	* mln/core/image/image3d.hh,
	* mln/core/internal/box_impl.hh,
	* mln/core/site_set/box.hh,
	* mln/debug/slices_2d.hh,
	* mln/geom/all.hh,
	* mln/geom/size3d.hh,
	* mln/linear/gaussian.hh,
	* mln/linear/gaussian/impl.hh,
	* mln/make/box3d.hh,
	* mln/make/image.hh,
	* mln/registration/icp.hh,
	* tests/core/alias/box3d.cc,
	* tests/core/image/image3d.cc,
	* tests/geom/Makefile.am,
	* tests/io/pbms/load.cc,
	* tests/io/pgms/load.cc,
	* tests/io/ppms/load.cc,
	* tests/transform/bench_closest_point_geodesic.cc: Rename nslis to
	nslices.
parent aa0bdee5
2010-04-09 Guillaume Lazzara <z@lrde.epita.fr>
Rename nslis to nslices.
* mln/geom/nslis.hh,
* tests/geom/nslis.cc: Rename as...
* mln/geom/nslices.hh,
* tests/geom/nslices.cc: ... this.
* mln/core/image/image3d.hh,
* mln/core/internal/box_impl.hh,
* mln/core/site_set/box.hh,
* mln/debug/slices_2d.hh,
* mln/geom/all.hh,
* mln/geom/size3d.hh,
* mln/linear/gaussian.hh,
* mln/linear/gaussian/impl.hh,
* mln/make/box3d.hh,
* mln/make/image.hh,
* mln/registration/icp.hh,
* tests/core/alias/box3d.cc,
* tests/core/image/image3d.cc,
* tests/geom/Makefile.am,
* tests/io/pbms/load.cc,
* tests/io/pgms/load.cc,
* tests/io/ppms/load.cc,
* tests/transform/bench_closest_point_geodesic.cc: Rename nslis to
nslices.
2010-04-07 Guillaume Lazzara <z@lrde.epita.fr>
 
* img/picasso.ppm: Add a ppm version.
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
// Copyright (C) 2007, 2008, 2009, 2010 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
......@@ -165,7 +165,7 @@ namespace mln
/// Constructor with the numbers of indexes and the
/// border thickness.
image3d(int nslis, int nrows, int ncols, unsigned bdr = border::thickness);
image3d(int nslices, int nrows, int ncols, unsigned bdr = border::thickness);
/// Initialize an empty image.
......@@ -209,7 +209,7 @@ namespace mln
/// Give the number of slices.
unsigned nslis() const;
unsigned nslices() const;
/// Give the number of rows.
unsigned nrows() const;
......@@ -396,9 +396,9 @@ namespace mln
template <typename T>
inline
image3d<T>::image3d(int nslis, int nrows, int ncols, unsigned bdr)
image3d<T>::image3d(int nslices, int nrows, int ncols, unsigned bdr)
{
init_(make::box3d(nslis, nrows, ncols), bdr);
init_(make::box3d(nslices, nrows, ncols), bdr);
}
template <typename T>
......@@ -512,7 +512,7 @@ namespace mln
template <typename T>
inline
unsigned
image3d<T>::nslis() const
image3d<T>::nslices() const
{
mln_precondition(this->is_valid());
return this->data_->b_.len(0);
......
......@@ -57,7 +57,7 @@ namespace mln
struct box_impl_<3, C, E>
{
/// Give the number of slis.
unsigned nslis() const;
unsigned nslices() const;
/// Give the minimum sli.
C min_sli() const;
......@@ -144,7 +144,7 @@ namespace mln
template <typename C, typename E>
inline
unsigned box_impl_<3, C, E>::nslis() const
unsigned box_impl_<3, C, E>::nslices() const
{
return internal::force_exact<E>(*this).bbox().len(0);
}
......
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
// Copyright (C) 2007, 2008, 2009, 2010 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
//
......@@ -124,7 +125,7 @@ namespace mln
/// (sizes) w.r.t. the dimension.
explicit box(mln_coord(P) ninds);
box(mln_coord(P) nrows, mln_coord(P) ncols);
box(mln_coord(P) nslis, mln_coord(P) nrows, mln_coord(P) ncols);
box(mln_coord(P) nslices, mln_coord(P) nrows, mln_coord(P) ncols);
/// \}
/*! \brief Test if \p p belongs to the box.
......@@ -309,11 +310,11 @@ namespace mln
template <typename P>
inline
box<P>::box(mln_coord(P) nslis, mln_coord(P) nrows, mln_coord(P) ncols)
box<P>::box(mln_coord(P) nslices, mln_coord(P) nrows, mln_coord(P) ncols)
{
metal::bool_<(dim == 3)>::check();
pmin_ = literal::origin;
pmax_ = P(nslis - 1, nrows - 1, ncols - 1);
pmax_ = P(nslices - 1, nrows - 1, ncols - 1);
mln_postcondition(is_valid());
}
......
......@@ -87,11 +87,11 @@ namespace mln
mln_precondition(input.is_valid());
mln_precondition(n_horizontal > 0 && n_vertical > 0);
mln_precondition(input.nslis() <= n_horizontal * n_vertical);
mln_precondition(input.nslices() <= n_horizontal * n_vertical);
image2d<mln_value(I)> output(input.nrows() * n_vertical,
input.ncols() * n_horizontal);
if (input.nslis() != n_horizontal * n_vertical)
if (input.nslices() != n_horizontal * n_vertical)
data::fill(output, bg);
const point3d& p_min = input.domain().pmin();
......@@ -133,23 +133,23 @@ namespace mln
return n;
}
void slices2d_helper(float nslis, float nrows, float ncols,
void slices2d_helper(float nslices, float nrows, float ncols,
float ratio_hv,
unsigned& n_horizontal,
unsigned& n_vertical)
{
if (ratio_hv > 1.f)
{
float n_v = std::sqrt(nslis * ncols / ratio_hv / nrows);
float n_v = std::sqrt(nslices * ncols / ratio_hv / nrows);
n_vertical = internal::round_up(n_v);
float n_h = nslis / float(n_vertical);
float n_h = nslices / float(n_vertical);
n_horizontal = internal::round_up(n_h);
}
else
{
float n_h = std::sqrt(nrows * nslis * ratio_hv / ncols);
float n_h = std::sqrt(nrows * nslices * ratio_hv / ncols);
n_horizontal = internal::round_up(n_h);
float n_v = nslis / float(n_horizontal);
float n_v = nslices / float(n_horizontal);
n_vertical = internal::round_up(n_v);
}
}
......@@ -171,10 +171,10 @@ namespace mln
mln_precondition(ratio_hv > 0.f);
unsigned n_horizontal, n_vertical;
internal::slices2d_helper(input.nslis(), input.nrows(), input.ncols(),
internal::slices2d_helper(input.nslices(), input.nrows(), input.ncols(),
ratio_hv,
n_horizontal, n_vertical);
mln_assertion(n_horizontal * n_vertical >= input.nslis());
mln_assertion(n_horizontal * n_vertical >= input.nslices());
image2d<mln_value(I)> output = slices_2d(input, n_horizontal, n_vertical, bg);
......
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
// Copyright (C) 2007, 2008, 2009, 2010 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
......@@ -60,7 +60,7 @@ namespace mln
# include <mln/geom/ninds.hh>
# include <mln/geom/nrows.hh>
# include <mln/geom/nsites.hh>
# include <mln/geom/nslis.hh>
# include <mln/geom/nslices.hh>
# include <mln/geom/pmin_pmax.hh>
# include <mln/geom/rotate.hh>
# include <mln/geom/seeds2tiling.hh>
......
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
// Copyright (C) 2007, 2008, 2009, 2010 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
......@@ -24,8 +24,8 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
#ifndef MLN_GEOM_NSLIS_HH
# define MLN_GEOM_NSLIS_HH
#ifndef MLN_GEOM_NSLICES_HH
# define MLN_GEOM_NSLICES_HH
/// \file
///
......@@ -43,19 +43,19 @@ namespace mln
/// Give the number of slices of an image.
template <typename I>
unsigned nslis(const Image<I>& ima);
unsigned nslices(const Image<I>& ima);
# ifndef MLN_INCLUDE_ONLY
template <typename I>
inline
unsigned nslis(const Image<I>& ima)
unsigned nslices(const Image<I>& ima)
{
mln_precondition(exact(ima).is_valid());
unsigned nslis = geom::max_sli(ima) - geom::min_sli(ima) + 1;
unsigned nslices = geom::max_sli(ima) - geom::min_sli(ima) + 1;
return nslis;
return nslices;
}
# endif // ! MLN_INCLUDE_ONLY
......@@ -65,4 +65,4 @@ namespace mln
} // end of namespace mln
#endif // ! MLN_GEOM_NSLIS_HH
#endif // ! MLN_GEOM_NSLICES_HH
// Copyright (C) 2007, 2009 EPITA Research and Development Laboratory (LRDE)
// Copyright (C) 2007, 2009, 2010 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
//
......@@ -31,7 +32,7 @@
* \brief Facade to include 3D size access routines.
*/
# include <mln/geom/nslis.hh>
# include <mln/geom/nslices.hh>
# include <mln/geom/nrows.hh>
# include <mln/geom/ncols.hh>
......
// Copyright (C) 2001, 2002, 2003, 2004, 2007, 2008, 2009 EPITA
// Copyright (C) 2001, 2002, 2003, 2004, 2007, 2008, 2009, 2010 EPITA
// Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
......@@ -51,7 +51,7 @@
# include <mln/geom/min_sli.hh>
# include <mln/geom/max_sli.hh>
# include <mln/geom/ninds.hh>
# include <mln/geom/nslis.hh>
# include <mln/geom/nslices.hh>
# include <mln/data/paste.hh>
# include <mln/data/stretch.hh>
# include <mln/algebra/vec.hh>
......@@ -442,11 +442,11 @@ namespace mln
point3d(static_cast<def::coord>(-img.border()),
static_cast<def::coord>(j),
static_cast<def::coord>(k)),
point3d(static_cast<def::coord>(geom::nslis(img) - 1 +
point3d(static_cast<def::coord>(geom::nslices(img) - 1 +
img.border()),
static_cast<def::coord>(j),
static_cast<def::coord>(k)),
geom::nslis(img) + 2 *
geom::nslices(img) + 2 *
img.border(),
dpoint3d(1, 0, 0));
}
......
// Copyright (C) 2001, 2002, 2003, 2004, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
// Copyright (C) 2001, 2002, 2003, 2004, 2008, 2009, 2010 EPITA
// Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
//
......@@ -44,7 +45,7 @@
# include <mln/geom/ncols.hh>
# include <mln/geom/nrows.hh>
# include <mln/geom/ninds.hh>
# include <mln/geom/nslis.hh>
# include <mln/geom/nslices.hh>
# include <mln/data/paste.hh>
# include <mln/data/stretch.hh>
# include <mln/algebra/vec.hh>
......@@ -245,11 +246,11 @@ namespace mln
point3d(static_cast<def::coord>(-img.border()),
static_cast<def::coord>(j),
static_cast<def::coord>(k)),
point3d(static_cast<def::coord>(geom::nslis(img) - 1 +
point3d(static_cast<def::coord>(geom::nslices(img) - 1 +
img.border()),
static_cast<def::coord>(j),
static_cast<def::coord>(k)),
geom::nslis(img) + 2 *
geom::nslices(img) + 2 *
img.border(),
dpoint3d(1, 0, 0));
}
......@@ -258,7 +259,7 @@ namespace mln
if (dir == 1)
{
// Apply on rows.
for (unsigned i = 0; i < geom::nslis(img); ++i)
for (unsigned i = 0; i < geom::nslices(img); ++i)
for (unsigned k = 0; k < geom::ncols(img); ++k)
recursivefilter_<mln_value(I)>(img, coef,
point3d(static_cast<def::coord>(i),
......@@ -276,7 +277,7 @@ namespace mln
if (dir == 2)
{
// Apply on columns.
for (unsigned i = 0; i < geom::nslis(img); ++i)
for (unsigned i = 0; i < geom::nslices(img); ++i)
for (unsigned j = 0; j < geom::nrows(img); ++i)
recursivefilter_<mln_value(I)>(img, coef,
point3d(static_cast<def::coord>(i),
......
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
// Copyright (C) 2007, 2008, 2009, 2010 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
//
......@@ -41,15 +42,15 @@ namespace mln
/*! \brief Create an mln::box3d.
*
* \param[in] nslis Number of slices.
* \param[in] nslices Number of slices.
* \param[in] nrows Number of rows.
* \param[in] ncols Number of columns.
*
* \pre \p ninds != 0 and \p ncols != 0 and \p nslis != 0.
* \pre \p ninds != 0 and \p ncols != 0 and \p nslices != 0.
*
* \return A 3D box.
*/
mln::box3d box3d(unsigned nslis, unsigned nrows, unsigned ncols);
mln::box3d box3d(unsigned nslices, unsigned nrows, unsigned ncols);
/*! \brief Create an mln::box3d.
......@@ -76,11 +77,11 @@ namespace mln
# ifndef MLN_INCLUDE_ONLY
inline
mln::box3d box3d(unsigned nslis, unsigned nrows, unsigned ncols)
mln::box3d box3d(unsigned nslices, unsigned nrows, unsigned ncols)
{
mln_precondition(nrows != 0 && ncols != 0 && nslis != 0);
mln_precondition(nrows != 0 && ncols != 0 && nslices != 0);
mln::box3d tmp(point3d(0, 0, 0),
point3d(static_cast<def::coord>(nslis - 1),
point3d(static_cast<def::coord>(nslices - 1),
static_cast<def::coord>(nrows - 1),
static_cast<def::coord>(ncols - 1)));
return tmp;
......
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
// Copyright (C) 2007, 2008, 2009, 2010 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
//
......@@ -113,10 +114,10 @@ namespace mln
mlc_bool(S != 0 && R != 0 && C != 0)::check();
mln::image3d<V> tmp(S, R, C);
const def::coord
nslis = static_cast<def::coord>(S),
nslices = static_cast<def::coord>(S),
nrows = static_cast<def::coord>(R),
ncols = static_cast<def::coord>(C);
for (def::coord sli = 0; sli < nslis; ++sli)
for (def::coord sli = 0; sli < nslices; ++sli)
for (def::coord row = 0; row < nrows; ++row)
for (def::coord col = 0; col < ncols; ++col)
opt::at(tmp, sli, row, col) = values[sli][row][col];
......
// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory
// (LRDE)
// Copyright (C) 2008, 2009, 2010 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
//
......@@ -153,7 +153,7 @@ namespace mln
closest_point_with_map(const p_array<P>& X)
{
box3d box = geom::bbox(X);
box.enlarge(0, box.nslis());
box.enlarge(0, box.nslices());
box.enlarge(1, box.nrows());
box.enlarge(2, box.ncols());
......
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
// Copyright (C) 2007, 2008, 2009, 2010 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
//
......@@ -32,5 +33,5 @@ int main()
using namespace mln;
box3d b = make::box3d(2, 6, 3);
mln_assertion(b.nslis() == 2 && b.nrows() == 6 && b.ncols() == 3);
mln_assertion(b.nslices() == 2 && b.nrows() == 6 && b.ncols() == 3);
}
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
// Copyright (C) 2007, 2008, 2009, 2010 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
//
......@@ -31,15 +32,15 @@ int main()
{
using namespace mln;
const unsigned nslis = 3;
const unsigned nslices = 3;
const unsigned nrows = 4;
const unsigned ncols = 5;
const unsigned border = 4;
image3d<int> f(nslis, nrows, ncols, border);
image3d<int> f(nslices, nrows, ncols, border);
mln_assertion(f.nsites() == geom::nslis(f) * geom::nrows(f) * geom::ncols(f));
mln_assertion(f.nsites() == geom::nslices(f) * geom::nrows(f) * geom::ncols(f));
mln_assertion(f.nelements() == ((nrows + 2 * border)
* (ncols + 2 * border)
* (nslis + 2 * border)));
* (nslices + 2 * border)));
}
# Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE).
# Copyright (C) 2007, 2008, 2009, 2010 EPITA Research and Development
# Laboratory (LRDE).
#
# This file is part of Olena.
#
......@@ -34,7 +35,7 @@ ncols \
ninds \
nrows \
nsites \
nslis \
nslices \
pmin_pmax \
rotate \
seed2tiling \
......@@ -57,7 +58,7 @@ ncols_SOURCES = ncols.cc
ninds_SOURCES = ninds.cc
nrows_SOURCES = nrows.cc
nsites_SOURCES = nsites.cc
nslis_SOURCES = nslis.cc
nslices_SOURCES = nslices.cc
pmin_pmax_SOURCES = pmin_pmax.cc
rotate_SOURCES = rotate.cc
seed2tiling_SOURCES = seed2tiling.cc
......
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
// Copyright (C) 2007, 2008, 2009, 2010 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
//
......@@ -25,7 +26,7 @@
#include <mln/core/image/image3d.hh>
#include <mln/geom/nslis.hh>
#include <mln/geom/nslices.hh>
int main()
{
......@@ -33,5 +34,5 @@ int main()
image3d<int> ima(3,4,5);
mln_assertion(geom::nslis(ima) == 3);
mln_assertion(geom::nslices(ima) == 3);
}
// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory
// (LRDE)
//
// This file is part of Olena.
//
......@@ -54,7 +55,7 @@ int main()
image3d<bool> ima3d;
io::pbms::load(ima3d, files);
mln_assertion(ima3d.nslis() == 2);
mln_assertion(ima3d.nslices() == 2);
mln_assertion(slice(ima3d, 0) == pic);
mln_assertion(slice(ima3d, 1) == pic2);
......
// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory
// (LRDE)
//
// This file is part of Olena.
//
......@@ -61,7 +62,7 @@ int main()
image3d<int_u8> ima3d;
io::pgms::load(ima3d, files);
mln_assertion(ima3d.nslis() == 2);
mln_assertion(ima3d.nslices() == 2);
mln_assertion(slice(ima3d, 0) == lena);
mln_assertion(slice(ima3d, 1) == lena2);
}
......
// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory
// (LRDE)
//
// This file is part of Olena.
//
......@@ -63,7 +64,7 @@ int main()
image3d<rgb8> ima3d;
io::ppms::load(ima3d, files);
mln_assertion(ima3d.nslis() == 2);
mln_assertion(ima3d.nslices() == 2);
mln_assertion(slice(ima3d, 0) == ima);
mln_assertion(slice(ima3d, 1) == ima2);
}
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