1 /*=========================================================================
2 Program: vv http://www.creatis.insa-lyon.fr/rio/vv
5 - University of LYON http://www.universite-lyon.fr/
6 - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr
7 - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the copyright notices for more information.
13 It is distributed under dual licence
15 - BSD See included LICENSE.txt file
16 - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ======================================================================-====*/
18 #include "clitkImageToImageGenericFilter.h"
19 #include "clitkImageCommon.h"
21 // //--------------------------------------------------------------------
22 // clitk::ImageToImageGenericFilterBase::ImageToImageGenericFilterBase(std::string n)
23 // :mIOVerbose(false) {
25 // mFailOnImageTypeError = true;
27 // //--------------------------------------------------------------------
30 // //--------------------------------------------------------------------
31 // void clitk::ImageToImageGenericFilterBase::SetInputFilenames(const std::vector<std::string> & filenames) {
32 // mInputFilenames=filenames;
34 // //--------------------------------------------------------------------
37 // //--------------------------------------------------------------------
38 // void clitk::ImageToImageGenericFilterBase::SetInputFilename(const std::string & filename) {
39 // std::vector<std::string> f;
40 // f.push_back(filename);
41 // SetInputFilenames(f);
43 // //--------------------------------------------------------------------
46 // //--------------------------------------------------------------------
47 // void clitk::ImageToImageGenericFilterBase::AddInputFilename(const std::string & filename) {
48 // mInputFilenames.push_back(filename);
50 // //--------------------------------------------------------------------
53 // //--------------------------------------------------------------------
54 // void clitk::ImageToImageGenericFilterBase::SetOutputFilename(const std::string & filename) {
55 // mOutputFilenames.clear();
56 // mOutputFilenames.push_back(filename);
58 // //--------------------------------------------------------------------
61 // //--------------------------------------------------------------------
62 // void clitk::ImageToImageGenericFilterBase::AddOutputFilename(const std::string & filename)
64 // mOutputFilenames.push_back(filename);
66 // //--------------------------------------------------------------------
69 // //--------------------------------------------------------------------
70 // void clitk::ImageToImageGenericFilterBase::SetOutputFilenames(const std::vector<std::string> & filenames)
72 // mOutputFilenames.clear();
73 // std::copy(filenames.begin(),filenames.end(),mOutputFilenames.begin());
75 // //--------------------------------------------------------------------
78 // //--------------------------------------------------------------------
79 // std::string clitk::ImageToImageGenericFilterBase::GetOutputFilename()
81 // assert(mOutputFilenames.size() == 1);
82 // return mOutputFilenames.front();
84 // //--------------------------------------------------------------------
87 // //--------------------------------------------------------------------
88 // void clitk::ImageToImageGenericFilterBase::GetInputImageDimensionAndPixelType(unsigned int& dim, \
89 // std::string& pixeltype,unsigned int& components)
91 // if (mInputFilenames.size())
93 // int comp_temp,dim_temp; //clitkCommonImage takes ints
94 // ReadImageDimensionAndPixelType(mInputFilenames[0], dim_temp, pixeltype,comp_temp);
95 // components=comp_temp; dim=dim_temp;
97 // else if (mInputVVImages.size())
99 // pixeltype=mInputVVImages[0]->GetScalarTypeAsString();
100 // dim=mInputVVImages[0]->GetNumberOfDimensions();
101 // components=mInputVVImages[0]->GetNumberOfScalarComponents();
104 // assert(false); //No input image, shouldn't happen
107 // std::cout << "Input is " << mDim << "D " << mPixelTypeName << "." << std::endl;
110 // //--------------------------------------------------------------------
113 // //--------------------------------------------------------------------
114 // vvImage::Pointer clitk::ImageToImageGenericFilterBase::GetOutputVVImage ()
116 // assert(mOutputVVImages.size());
117 // return mOutputVVImages[0];
119 // //--------------------------------------------------------------------
122 // //--------------------------------------------------------------------
123 // std::vector<vvImage::Pointer> clitk::ImageToImageGenericFilterBase::GetOutputVVImages()
125 // return mOutputVVImages;
127 // //--------------------------------------------------------------------
130 // //--------------------------------------------------------------------
131 // void clitk::ImageToImageGenericFilterBase::SetInputVVImage (vvImage::Pointer input)
133 // mInputVVImages.clear();
134 // mInputVVImages.push_back(input);
136 // //--------------------------------------------------------------------
139 // //--------------------------------------------------------------------
140 // void clitk::ImageToImageGenericFilterBase::AddInputVVImage (vvImage::Pointer input)
142 // mInputVVImages.push_back(input);
144 // //--------------------------------------------------------------------
147 // //--------------------------------------------------------------------
148 // void clitk::ImageToImageGenericFilterBase::SetInputVVImages (std::vector<vvImage::Pointer> input)
150 // mInputVVImages=input;
152 // //--------------------------------------------------------------------
155 // //--------------------------------------------------------------------
156 // void clitk::ImageToImageGenericFilterBase::PrintAvailableImageTypes() {
157 // std::cout << GetAvailableImageTypes();
159 // //--------------------------------------------------------------------
163 // //--------------------------------------------------------------------
164 // void clitk::ImageToImageGenericFilterBase::ImageTypeError() {
165 // std::cerr << "**Error** The filter <" << mFilterName << "> is not available for "
166 // << mDim << "D images with pixel="
167 // << mPixelTypeName << " and "
168 // << mNbOfComponents << " component." << std::endl;
169 // std::cerr << GetAvailableImageTypes();
172 // //--------------------------------------------------------------------
175 // //--------------------------------------------------------------------
176 // void clitk::ImageToImageGenericFilterBase::SetImageTypeError() {
177 // std::cerr << "TODO ! " << std::endl;
180 // //--------------------------------------------------------------------