X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FmaracasVisuLib%2Fsrc%2Fkernel%2Fvolume.cxx;h=c70a31bb05ed673ff088e259bb90363b80792412;hb=e4ef2b5df5aac431ff3b806f83b7dd5e55e89d86;hp=7fbe85cc1276d06e2b598a3bb3a4cfdf977d50bf;hpb=66588eac91068d9b7f9d45bffc5e09c27511eaac;p=creaMaracasVisu.git diff --git a/lib/maracasVisuLib/src/kernel/volume.cxx b/lib/maracasVisuLib/src/kernel/volume.cxx index 7fbe85c..c70a31b 100644 --- a/lib/maracasVisuLib/src/kernel/volume.cxx +++ b/lib/maracasVisuLib/src/kernel/volume.cxx @@ -1,10 +1,35 @@ +/*# --------------------------------------------------------------------- +# +# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image +# pour la Sant�) +# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton +# Previous Authors : Laurent Guigues, Jean-Pierre Roux +# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil +# +# This software is governed by the CeCILL-B license under French law and +# abiding by the rules of distribution of free software. You can use, +# modify and/ or redistribute the software under the terms of the CeCILL-B +# license as circulated by CEA, CNRS and INRIA at the following URL +# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html +# or in the file LICENSE.txt. +# +# As a counterpart to the access to the source code and rights to copy, +# modify and redistribute granted by the license, users are provided only +# with a limited warranty and the software's author, the holder of the +# economic rights, and the successive licensors have only limited +# liability. +# +# The fact that you are presently reading this means that you have had +# knowledge of the CeCILL-B license and that you accept its terms. +# ------------------------------------------------------------------------ */ + /*========================================================================= Program: wxMaracas Module: $RCSfile: volume.cxx,v $ Language: C++ - Date: $Date: 2010/04/20 16:11:40 $ - Version: $Revision: 1.8 $ + Date: $Date: 2012/11/15 14:16:13 $ + Version: $Revision: 1.10 $ Copyright: (c) 2002, 2003 License: @@ -220,12 +245,12 @@ double kVolume::getPixel( uint32_t x, uint32_t y, uint32_t z ) const switch( _type ) { - case CHAR: p = ( double )( ( int8_t*** )_images )[ z ][ y ][ x ]; break; - case FLOAT: p = ( double )( ( float*** )_images )[ z ][ y ][ x ]; break; - case DOUBLE: p = ( double )( ( double*** )_images )[ z ][ y ][ x ]; break; - case INT: p = ( double )( ( int32_t*** )_images )[ z ][ y ][ x ]; break; - case SHORT: p = ( double )( ( int16_t*** )_images )[ z ][ y ][ x ]; break; - case UCHAR: p = ( double )( ( uint8_t*** )_images )[ z ][ y ][ x ]; break; + case CHAR: p = ( double )( ( int8_t*** )_images )[ z ][ y ][ x ]; break; + case FLOAT: p = ( double )( ( float*** )_images )[ z ][ y ][ x ]; break; + case DOUBLE: p = ( double )( ( double*** )_images )[ z ][ y ][ x ]; break; + case INT: p = ( double )( ( int32_t*** )_images )[ z ][ y ][ x ]; break; + case SHORT: p = ( double )( ( int16_t*** )_images )[ z ][ y ][ x ]; break; + case UCHAR: p = ( double )( ( uint8_t*** )_images )[ z ][ y ][ x ]; break; case UINT: p = ( double )( ( uint32_t*** )_images )[ z ][ y ][ x ]; break; case USHORT: p = ( double )( ( uint16_t*** )_images )[ z ][ y ][ x ]; break; default: p = 0.0; break; @@ -269,12 +294,12 @@ void kVolume::convertCast( Type type ) case CHAR: switch( type ) { - case SHORT: convertCastT( ( char* )_raw, ( int16_t* )buffer, size ); break; - case INT: convertCastT( ( char* )_raw, ( int32_t* )buffer, size ); break; + case SHORT: convertCastT( ( char* )_raw, ( int16_t* )buffer, size ); break; + case INT: convertCastT( ( char* )_raw, ( int32_t* )buffer, size ); break; case USHORT: convertCastT( ( char* )_raw, ( uint16_t* )buffer, size ); break; case UINT: convertCastT( ( char* )_raw, ( uint32_t* )buffer, size ); break; - case FLOAT: convertCastT( ( char* )_raw, ( float* )buffer, size ); break; - case DOUBLE: convertCastT( ( char* )_raw, ( double* )buffer, size ); break; + case FLOAT: convertCastT( ( char* )_raw, ( float* )buffer, size ); break; + case DOUBLE: convertCastT( ( char* )_raw, ( double* )buffer, size ); break; case UCHAR: convertCastT( ( char* )_raw, ( uint8_t* )buffer, size ); break; default : break; @@ -284,13 +309,13 @@ void kVolume::convertCast( Type type ) case SHORT: switch( type ) { - case CHAR: convertCastT( ( int16_t* )_raw, ( uint8_t* )buffer, size ); break; - case INT: convertCastT( ( int16_t* )_raw, ( int32_t* )buffer, size ); break; + case CHAR: convertCastT( ( int16_t* )_raw, ( uint8_t* )buffer, size ); break; + case INT: convertCastT( ( int16_t* )_raw, ( int32_t* )buffer, size ); break; case USHORT: convertCastT( ( int16_t* )_raw, ( uint16_t* )buffer, size ); break; case UINT: convertCastT( ( int16_t* )_raw, ( uint32_t* )buffer, size ); break; - case FLOAT: convertCastT( ( int16_t* )_raw, ( float* )buffer, size ); break; - case DOUBLE: convertCastT( ( int16_t* )_raw, ( double* )buffer, size ); break; - case UCHAR: convertCastT( ( int16_t* )_raw, ( uint8_t* )buffer, size ); break; + case FLOAT: convertCastT( ( int16_t* )_raw, ( float* )buffer, size ); break; + case DOUBLE: convertCastT( ( int16_t* )_raw, ( double* )buffer, size ); break; + case UCHAR: convertCastT( ( int16_t* )_raw, ( uint8_t* )buffer, size ); break; default : break; } // fswitch break;