Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

ImageAs1DVector.hxx

Go to the documentation of this file.
00001 /* ImLib3D
00002  * Copyright (c) 2001, ULP-IPB Strasbourg.
00003  *
00004  * This program is free software; you can redistribute it and/or modify
00005  * it under the terms of the GNU General Public License as published by
00006  * the Free Software Foundation; either version 2 of the License, or (at
00007  * your option) any later version.
00008  * 
00009  * This program is distributed in the hope that it will be useful, but
00010  * WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * General Public License for more details.
00013  * 
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00017  */
00020 #ifndef _ImageAs1DVector_hxx
00021 #define _ImageAs1DVector_hxx
00022 
00023 
00024 template <class ImageType>
00025 void
00026 IP3D::ScalarProduct(const ImageType& im1, const ImageType& im2, double & retValue)
00027 {
00028     ImageProcessorArgs<ImageType> args;
00029     args.AddSrc(im1);
00030     args.AddSrc(im2);
00031     args.SameSize();
00032     
00033     typename ImageType::const_iteratorFast p1;
00034     typename ImageType::const_iteratorFast p2;  
00035 
00036     retValue = 0;
00037     for (p1 = im1.begin(), p2 = im2.begin(); p1 != im1.end(); p1++, p2++)
00038     {
00039         retValue += (*p1) * (*p2);
00040     }
00041 }
00042 #ifdef DEPRECATED
00043 
00044 namespace IP3D
00045 {
00046 template <class ImageType>
00047 void
00048 ForAllVoxels(Function1D<typename ImageType::value_type, typename ImageType::value_type>& fnc, const ImageType& im1, ImageType& res)
00049 {
00050     ImageProcessorArgs<ImageType> args;
00051     args.AddSrc(im1);
00052     args.AddDest(res);
00053     args.SameSize();
00054     
00055     typename ImageType::const_iteratorFast p1;
00056     typename ImageType::iteratorFast p2;    
00057 
00058     for (p1 = im1.begin(), p2 = res.begin(); p1 != im1.end(); p1++, p2++)
00059     {
00060         (*p2) = fnc(*p1);
00061     }
00062 }
00063 #endif// DEPRECATED
00064 
00065 #endif// _ImageAs1DVector_hxx

Generated on Fri Jun 17 13:36:04 2005 for ImLib3D by  doxygen 1.4.2