X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=filters%2FclitkImageArithmGenericFilter.cxx;h=59f0bc0f2fcee4ba43509242b75e3d3df4b50c9d;hb=32def8dc2a3a571a7e34ac76355800c9e69c4f6a;hp=2683a9352ba344330688e3eff114c4f7598e4c86;hpb=931a42358442f4ee4f314613c991c838d4b4e3b7;p=clitk.git diff --git a/filters/clitkImageArithmGenericFilter.cxx b/filters/clitkImageArithmGenericFilter.cxx index 2683a93..59f0bc0 100644 --- a/filters/clitkImageArithmGenericFilter.cxx +++ b/filters/clitkImageArithmGenericFilter.cxx @@ -1,18 +1,22 @@ /*========================================================================= + 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 @@ -24,44 +28,5 @@ #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