X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=common%2FclitkImageToImageGenericFilter.txx;h=0ecaf50a0618f6ae825c9fbdb867ec71b5f3042e;hb=0083c3fb2c66812489631c7551709d121de51625;hp=6febe19f9440d515c27f2e527eee2e82b3d781b8;hpb=98bdb72d057c122863776f8c3fb74659e8c87beb;p=clitk.git diff --git a/common/clitkImageToImageGenericFilter.txx b/common/clitkImageToImageGenericFilter.txx index 6febe19..0ecaf50 100644 --- a/common/clitkImageToImageGenericFilter.txx +++ b/common/clitkImageToImageGenericFilter.txx @@ -1,63 +1,3 @@ -/*========================================================================= - - Program: vv - Module: $RCSfile: clitkImageToImageGenericFilter.txx,v $ - Language: C++ - Date: $Date: 2010/03/01 15:37:41 $ - Version: $Revision: 1.7 $ - Author : Joel Schaerer - David Sarrut - - Copyright (C) 2008 - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr - CREATIS-LRMN http://www.creatis.insa-lyon.fr - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, version 3 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - - =========================================================================*/ - -//-------------------------------------------------------------------- -template -void clitk::ImageToImageGenericFilterBase::SetNextOutput(typename ImageType::Pointer output) { - if (mOutputFilenames.size()) - { - clitk::writeImage(output, mOutputFilenames.front(), mIOVerbose); - mOutputFilenames.pop_front(); - } - if (mInputVVImages.size()) //We assume that if a vv image is set as input, we want one as the output - mOutputVVImages.push_back(vvImageFromITK(output)); -} -//-------------------------------------------------------------------- - - -//-------------------------------------------------------------------- -template -typename ImageType::Pointer clitk::ImageToImageGenericFilterBase::GetInput(unsigned int n) { - if (mInputFilenames.size() > n) { - return clitk::readImage(mInputFilenames[n], mIOVerbose); - } - else if (mInputVVImages.size() > n) - return typename ImageType::Pointer(const_cast(vvImageToITK(mInputVVImages[n]).GetPointer())); - else - { - assert(false); //No input, this shouldn't happen - return typename ImageType::Pointer(NULL); - } -} -//-------------------------------------------------------------------- - - -//-------------------------------------------------------------------- template clitk::ImageToImageGenericFilter::ImageToImageGenericFilter(std::string filterName) : ImageToImageGenericFilterBase(filterName), @@ -117,9 +57,9 @@ std::string clitk::ImageToImageGenericFilter::GetAvailableImageTypes i++) { for (MCompItType j=(*i).second.begin(); j!= (*i).second.end(); j++) { for (MPixelItType k=(*j).second.begin(); k!= (*j).second.end(); k++) { - oss << "Dim: " << (*i).first - << ", Components: " << (*j).first - << ", Type: " << (*k).first << std::endl; + oss << "Dim: " << (*i).first; + if ((*j).first != 1) oss << ", Components: " << (*j).first; + oss << ", Type: " << (*k).first << std::endl; } } }