X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=filters%2FclitkImageArithmGenericFilter.cxx;h=104b5d3bc23418c6eff20ab4286462668712ce81;hb=0bbf0c26e4e2b917143315bec9ce1c52a357a500;hp=2683a9352ba344330688e3eff114c4f7598e4c86;hpb=931a42358442f4ee4f314613c991c838d4b4e3b7;p=clitk.git diff --git a/filters/clitkImageArithmGenericFilter.cxx b/filters/clitkImageArithmGenericFilter.cxx index 2683a93..104b5d3 100644 --- a/filters/clitkImageArithmGenericFilter.cxx +++ b/filters/clitkImageArithmGenericFilter.cxx @@ -1,67 +1,32 @@ /*========================================================================= + Program: vv http://www.creatis.insa-lyon.fr/rio/vv - Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de - l'Image). All rights reserved. See Doc/License.txt or - http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + Authors belong to: + - University of LYON http://www.universite-lyon.fr/ + - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr + - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the copyright notices for more information. + + It is distributed under dual licence + + - BSD See included LICENSE.txt file + - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html +======================================================================-====*/ #ifndef CLITKIMAGEARITHMGENERICFILTER_CXX #define CLITKIMAGEARITHMGENERICFILTER_CXX - /** ------------------------------------------------------------------- * @file clitkImageArithmGenericFilter.cxx * @author David Sarrut * @date 23 Feb 2008 - * @brief + * @brief -------------------------------------------------------------------*/ #include "clitkImageArithmGenericFilter.h" -//-------------------------------------------------------------------- -clitk::ImageArithmGenericFilter::ImageArithmGenericFilter():mTypeOfOperation(0) { - mIsOperationUseASecondImage = false; -} -//-------------------------------------------------------------------- - -//-------------------------------------------------------------------- -void clitk::ImageArithmGenericFilter::Update () { - - // Load image header - itk::ImageIOBase::Pointer header = clitk::readImageHeader(mInputFilenames[0]); - - // Determine dim, pixel type, number of components - mDim = header->GetNumberOfDimensions(); - mPixelTypeName = header->GetComponentTypeAsString(header->GetComponentType()); - mNbOfComponents = header->GetNumberOfComponents(); - - if (mInputFilenames.size() == 0) { - std::cerr << "ERROR : please provide at least a input filename." << std::endl; - } - if (mInputFilenames.size() == 1) { - mIsOperationUseASecondImage = false; - } - if (mInputFilenames.size() == 2) { - mIsOperationUseASecondImage = true; - } - if (mInputFilenames.size() > 2) { - std::cerr << "ERROR : please provide only 1 or 2 input filenames." << std::endl; - } - - // Switch by dimension - if (mDim == 2) { Update_WithDim<2>(); return; } - if (mDim == 3) { Update_WithDim<3>(); return; } - if (mDim == 4) { Update_WithDim<4>(); return; } - - std::cerr << "Error, dimension of input image is " << mDim << ", but I only work with 2,3." << std::endl; - exit(0); -} -//-------------------------------------------------------------------- #endif //define CLITKIMAGEARITHMGENERICFILTER_CXX