RTK  1.4.0
Reconstruction Toolkit
rtkEdfRawToAttenuationImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright RTK Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 
19 #ifndef rtkEdfRawToAttenuationImageFilter_h
20 #define rtkEdfRawToAttenuationImageFilter_h
21 
22 #include <itkImageToImageFilter.h>
23 #include <itkImageSeriesReader.h>
24 
25 #include "rtkConfiguration.h"
26 
27 namespace rtk
28 {
29 
38 template<class TInputImage, class TOutputImage=TInputImage>
39 class ITKIOImageBase_HIDDEN EdfRawToAttenuationImageFilter :
40  public itk::ImageToImageFilter<TInputImage, TOutputImage>
41 {
42 public:
48 
50  typedef TInputImage InputImageType;
51  typedef TOutputImage OutputImageType;
52  typedef typename TOutputImage::RegionType OutputImageRegionType;
53 
54  typedef std::vector<std::string> FileNamesContainer;
55 
57  itkNewMacro(Self);
58 
61 
64  void SetFileNames(const FileNamesContainer &name)
65  {
66  if ( m_FileNames != name)
67  {
68  m_FileNames = name;
69  this->Modified();
70  }
71  }
73 
74  const FileNamesContainer & GetFileNames() const
75  {
76  return m_FileNames;
77  }
78 
79 protected:
81  virtual ~EdfRawToAttenuationImageFilter() ITK_OVERRIDE {}
82 
83  void BeforeThreadedGenerateData() ITK_OVERRIDE;
84 
85 #if ITK_VERSION_MAJOR<5
86  void ThreadedGenerateData( const OutputImageRegionType& outputRegionForThread, ThreadIdType threadId ) ITK_OVERRIDE;
87 #else
88  void DynamicThreadedGenerateData( const OutputImageRegionType& outputRegionForThread) ITK_OVERRIDE;
89 #endif
90 
91 private:
92  //purposely not implemented
93  EdfRawToAttenuationImageFilter(const Self&);
94  void operator=(const Self&);
95 
99 
101  FileNamesContainer m_FileNames;
102 
104  std::vector<typename InputImageType::IndexValueType> m_ReferenceIndices;
105 }; // end of class
106 
107 } // end namespace rtk
108 
109 #ifndef ITK_MANUAL_INSTANTIATION
110 #include "rtkEdfRawToAttenuationImageFilter.hxx"
111 #endif
112 
113 #endif
itk::ImageToImageFilter< TInputImage, TOutputImage > Superclass
void SetFileNames(const FileNamesContainer &name)
std::vector< typename InputImageType::IndexValueType > m_ReferenceIndices
Convert raw ESRF data to attenuation images.
const FileNamesContainer & GetFileNames() const
unsigned int ThreadIdType
itk::ImageSeriesReader< InputImageType > EdfImageSeries