RTK  2.0.1
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:
43  ITK_DISALLOW_COPY_AND_ASSIGN(EdfRawToAttenuationImageFilter);
44 
50 
52  using InputImageType = TInputImage;
53  using OutputImageType = TOutputImage;
54  using OutputImageRegionType = typename TOutputImage::RegionType;
55 
56  using FileNamesContainer = std::vector<std::string>;
57 
59  itkNewMacro(Self);
60 
63 
66  void SetFileNames(const FileNamesContainer &name)
67  {
68  if ( m_FileNames != name)
69  {
70  m_FileNames = name;
71  this->Modified();
72  }
73  }
75 
77  {
78  return m_FileNames;
79  }
80 
81 protected:
83  ~EdfRawToAttenuationImageFilter() override = default;
84 
85  void BeforeThreadedGenerateData() override;
86 
87 #if ITK_VERSION_MAJOR<5
88  void ThreadedGenerateData( const OutputImageRegionType& outputRegionForThread, ThreadIdType threadId ) override;
89 #else
90  void DynamicThreadedGenerateData( const OutputImageRegionType& outputRegionForThread) override;
91 #endif
92 
93 private:
97 
100 
102  std::vector<typename InputImageType::IndexValueType> m_ReferenceIndices;
103 }; // end of class
104 
105 } // end namespace rtk
106 
107 #ifndef ITK_MANUAL_INSTANTIATION
108 #include "rtkEdfRawToAttenuationImageFilter.hxx"
109 #endif
110 
111 #endif
typename TOutputImage::RegionType OutputImageRegionType
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