Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals

kernel-phase-acq.c

Go to the documentation of this file.
00001 /************************************************************************* 00002 * $Id: kernel-phase-acq.c,v 1.5 2005/09/09 08:22:19 bellet Exp $ 00003 ************************************************************************** 00004 This software is governed by the CeCILL license under French law and 00005 abiding by the rules of distribution of free software. You can use, 00006 modify and/ or redistribute the software under the terms of the CeCILL 00007 license as circulated by CEA, CNRS and INRIA at the following URL 00008 "http://www.cecill.info". 00009 00010 As a counterpart to the access to the source code and rights to copy, 00011 modify and redistribute granted by the license, users are provided only 00012 with a limited warranty and the software's author, the holder of the 00013 economic rights, and the successive licensors have only limited 00014 liability. 00015 00016 In this respect, the user's attention is drawn to the risks associated 00017 with loading, using, modifying and/or developing or reproducing the 00018 software by the user in light of its specific status of free software, 00019 that may mean that it is complicated to manipulate, and that also 00020 therefore means that it is reserved for developers and experienced 00021 professionals having in-depth computer knowledge. Users are therefore 00022 encouraged to load and test the software's suitability as regards their 00023 requirements in conditions enabling the security of their systems and/or 00024 data to be ensured and, more generally, to use and operate it in the 00025 same conditions as regards security. 00026 00027 The fact that you are presently reading this means that you have had 00028 knowledge of the CeCILL license and that you accept its terms. 00029 00030 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de 00031 l'Image). All rights reserved. See License.txt for details. 00032 00033 Version 1.0 05/09/2005 00034 *************************************************************************/ 00035 00036 #include "kernel-phase-acq.h" 00037 #ifdef HAVE_MPI 00038 #include <mpi.h> 00039 #include "seq-mpi.h" /* for MPI TAGS definition */ 00040 #endif 00041 00050 void KernelPhase(EXPERIENCE3D * expr, EVENT * event) 00051 { 00052 int ix, iy, iz; 00053 float sgn[3]; 00054 int xmin; 00055 int xmax; 00056 00057 #ifdef HAVE_MPI 00058 if (expr->mpi_slice_x0 == -1) { 00059 xmin = 0; 00060 xmax = expr->nfovx; 00061 } else { 00062 xmin=expr->mpi_slice_x0; 00063 xmax=xmin+mpi_get_slice_width(expr, xmin); 00064 } 00065 #else 00066 xmin = 0; 00067 xmax = expr->nfovx; 00068 #endif 00069 /* 00070 * Do a one point acquisition 00071 */ 00072 00073 sgn[0] = 0.; 00074 sgn[1] = 0.; 00075 sgn[2] = 0.; 00076 00077 if (event->op_flag == PLUS) 00078 for (ix = xmin; ix < xmax; ix++) 00079 for (iy = 0; iy < expr->nfovy; iy++) 00080 for (iz = 0; iz < expr->nfovz; iz++) { 00081 sgn[0] += (float) expr->magstate[0][ix][iy][iz]; 00082 sgn[1] += (float) expr->magstate[1][ix][iy][iz]; 00083 sgn[2] += (float) expr->magstate[2][ix][iy][iz]; 00084 } else 00085 for (ix = xmin; ix < xmax; ix++) 00086 for (iy = 0; iy < expr->nfovy; iy++) 00087 for (iz = 0; iz < expr->nfovz; iz++) { 00088 sgn[0] -= (float) expr->magstate[0][ix][iy][iz]; 00089 sgn[1] -= (float) expr->magstate[1][ix][iy][iz]; 00090 sgn[2] -= (float) expr->magstate[2][ix][iy][iz]; 00091 } 00092 expr->sgn[0][event->nu_pointx][event->nu_pointy][event->nu_pointz]+=sgn[0]; 00093 expr->sgn[1][event->nu_pointx][event->nu_pointy][event->nu_pointz]+=sgn[1]; 00094 expr->sgn[2][event->nu_pointx][event->nu_pointy][event->nu_pointz]+=sgn[2]; 00095 }

Generated on Wed Oct 19 09:28:34 2005 for SIMRI3D by doxygen 1.3.7