]> Creatis software - clitk.git/blob - common/clitkImageToImageGenericFilter.cxx
4b702f46646ef8bc62b157db9c6ad6457d2b8094
[clitk.git] / common / clitkImageToImageGenericFilter.cxx
1 /*=========================================================================
2   Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
3
4   Authors belong to: 
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
8
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.
12
13   It is distributed under dual licence
14
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"
20
21 // //--------------------------------------------------------------------
22 // clitk::ImageToImageGenericFilterBase::ImageToImageGenericFilterBase(std::string n)
23 //   :mIOVerbose(false) {
24 //   mFilterName = n;
25 //   mFailOnImageTypeError = true;
26 // }
27 // //--------------------------------------------------------------------
28
29
30 // //--------------------------------------------------------------------
31 // void clitk::ImageToImageGenericFilterBase::SetInputFilenames(const std::vector<std::string> & filenames) {
32 //     mInputFilenames=filenames;
33 // }
34 // //--------------------------------------------------------------------
35
36
37 // //--------------------------------------------------------------------
38 // void clitk::ImageToImageGenericFilterBase::SetInputFilename(const std::string & filename) {
39 //   std::vector<std::string> f;
40 //   f.push_back(filename);
41 //   SetInputFilenames(f);
42 // }
43 // //--------------------------------------------------------------------
44
45
46 // //--------------------------------------------------------------------
47 // void clitk::ImageToImageGenericFilterBase::AddInputFilename(const std::string & filename) {
48 //   mInputFilenames.push_back(filename);
49 // }
50 // //--------------------------------------------------------------------
51
52
53 // //--------------------------------------------------------------------
54 // void clitk::ImageToImageGenericFilterBase::SetOutputFilename(const std::string & filename) {
55 //   mOutputFilenames.clear();
56 //   mOutputFilenames.push_back(filename);
57 // }
58 // //--------------------------------------------------------------------
59
60
61 // //--------------------------------------------------------------------
62 // void clitk::ImageToImageGenericFilterBase::AddOutputFilename(const std::string & filename)
63 // {
64 //   mOutputFilenames.push_back(filename);
65 // }
66 // //--------------------------------------------------------------------
67
68
69 // //--------------------------------------------------------------------
70 // void clitk::ImageToImageGenericFilterBase::SetOutputFilenames(const std::vector<std::string> & filenames)
71 // {
72 //     mOutputFilenames.clear();
73 //     std::copy(filenames.begin(),filenames.end(),mOutputFilenames.begin());
74 // }
75 // //--------------------------------------------------------------------
76
77
78 // //--------------------------------------------------------------------
79 // std::string clitk::ImageToImageGenericFilterBase::GetOutputFilename()
80 // {
81 //     assert(mOutputFilenames.size() == 1);
82 //     return mOutputFilenames.front();
83 // }
84 // //--------------------------------------------------------------------
85
86
87 // //--------------------------------------------------------------------
88 // void clitk::ImageToImageGenericFilterBase::GetInputImageDimensionAndPixelType(unsigned int& dim, \
89 //         std::string& pixeltype,unsigned int& components)
90 // {
91 //   if (mInputFilenames.size())
92 //     {
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;
96 //     }
97 //   else if (mInputVVImages.size())
98 //     {
99 //       pixeltype=mInputVVImages[0]->GetScalarTypeAsString();
100 //       dim=mInputVVImages[0]->GetNumberOfDimensions();
101 //       components=mInputVVImages[0]->GetNumberOfScalarComponents();
102 //     }
103 //   else
104 //     assert(false); //No input image, shouldn't happen
105   
106 //   if (mIOVerbose) {
107 //     std::cout << "Input is " << mDim << "D " << mPixelTypeName << "." << std::endl;
108 //   }
109 // }
110 // //--------------------------------------------------------------------
111
112
113 // //--------------------------------------------------------------------
114 // vvImage::Pointer clitk::ImageToImageGenericFilterBase::GetOutputVVImage ()
115 // {
116 //     assert(mOutputVVImages.size());
117 //     return mOutputVVImages[0];
118 // }
119 // //--------------------------------------------------------------------
120
121
122 // //--------------------------------------------------------------------
123 // std::vector<vvImage::Pointer> clitk::ImageToImageGenericFilterBase::GetOutputVVImages()
124 // {
125 //     return mOutputVVImages;
126 // }
127 // //--------------------------------------------------------------------
128
129
130 // //--------------------------------------------------------------------
131 // void clitk::ImageToImageGenericFilterBase::SetInputVVImage (vvImage::Pointer input)
132 // {
133 //     mInputVVImages.clear();
134 //     mInputVVImages.push_back(input);
135 // }
136 // //--------------------------------------------------------------------
137
138
139 // //--------------------------------------------------------------------
140 // void clitk::ImageToImageGenericFilterBase::AddInputVVImage (vvImage::Pointer input)
141 // {
142 //     mInputVVImages.push_back(input);
143 // }
144 // //--------------------------------------------------------------------
145
146
147 // //--------------------------------------------------------------------
148 // void clitk::ImageToImageGenericFilterBase::SetInputVVImages (std::vector<vvImage::Pointer> input)
149 // {
150 //     mInputVVImages=input;
151 // }
152 // //--------------------------------------------------------------------
153
154
155 // //--------------------------------------------------------------------
156 // void clitk::ImageToImageGenericFilterBase::PrintAvailableImageTypes() {
157 //   std::cout << GetAvailableImageTypes();
158 // }
159 // //--------------------------------------------------------------------
160
161
162
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();
170 //   exit(0);
171 // }
172 // //--------------------------------------------------------------------
173
174
175 // //--------------------------------------------------------------------
176 // void clitk::ImageToImageGenericFilterBase::SetImageTypeError() {
177 //   std::cerr << "TODO ! " << std::endl;
178 //   exit(0);
179 // }
180 // //--------------------------------------------------------------------