/* ImLib3D
 * Copyright (c) 2001, ULP-IPB Strasbourg.
 *
 * This program 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; either version 2 of the License, or (at
 * your option) any later version.
 * 
 * This program 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 this program; if not, write to the Free Software
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
#ifndef _VisualizationAids_hpp
#define _VisualizationAids_hpp
/*!
  \file   VisualizationAids.hpp
  \brief Contains classes for aiding at visualizing complex images, structures, fields etc.

  <long description> Contains classes for aiding at visualizing complex images, structures, fields etc.

  See AUTHORS and COPYING files for more information
  \date   2001-10-15
*/

#define WANT_STREAM
#define WANT_MATH  
#include<ImLib3D/Transformation.hpp>



//! Forward transformation of a grid
/*! The intersection points of the grid are all forward transformed (using the field vectors) and then lines are drawn between the points. You can use this to get some idea of how a transformation field transforms an image.

  Masksize defines the grid structure.

  When bAverageField is true, an intersection point is transformed taking the average of the vectors around the point(defined by masksize). When false, there will be no such averaging
 */
namespace IP3D
{
/*! #&TransformRectangularGrid&#     Forward transformation of a rectangular grid.
        Grid points are forward transformed and lines are drawn between them. It 
        takes quite some time...
     <UL>Args:
      <LI>Source image          type:Image3Df
      <LI>Source field          type:Image3Dlinear<Vect3Df>
      <LI>masksize              type:Size3D
      <LI>average vector field  type:bool
     </UL>
~*/
		void TransformRectangularGrid(Image3Df& image, const Field3Df& field, const Size3D masksize, 
					  bool bAverageField=true
		);
};

//! Applies increasing magnitudes of a transformations to an image
/*! When animated afterwards, images gives an impression of how the field transforms the image. 
  
 */
namespace IP3D
{
/*! #&AnimateField&#     Apply a field weighted by linear weight factors to an image.
        No long description
     <UL>Args:
      <LI>Source image     type:ImageType
      <LI>Source field     type:Image3Dlinear<Vect3Df>
      <LI>Save prefix      type:string
      <LI>Number of Steps  type:int
     </UL>
~*/
	template <class ImageType>
	void AnimateField(const ImageType& imSrc, const Field3Df& field, Image3DSet<ImageType>& resImages, int nSteps=5);
};

#include<ImLib3D/VisualizationAids.hxx>

#endif //_VisualizationAids_hpp
