ITK  5.2.0
Insight Toolkit
itkSharedMorphologyUtilities.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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 #ifndef itkSharedMorphologyUtilities_h
19 #define itkSharedMorphologyUtilities_h
20 
21 #include <list>
22 #include <vector>
23 
24 namespace itk
25 {
26 template <typename TRegion, typename TLine>
27 bool
28 NeedToDoFace(const TRegion AllImage, const TRegion face, const TLine line);
29 
30 template <typename TImage, typename TBres, typename TLine>
31 int
32 ComputeStartEnd(const typename TImage::IndexType StartIndex,
33  const TLine line,
34  const float tol,
35  const typename TBres::OffsetArray LineOffsets,
36  const typename TImage::RegionType AllImage,
37  unsigned & start,
38  unsigned & end);
39 
40 template <typename TImage, typename TBres, typename TLine>
41 int
42 FillLineBuffer(typename TImage::ConstPointer input,
43  const typename TImage::IndexType StartIndex,
44  const TLine line,
45  const float tol,
46  const typename TBres::OffsetArray LineOffsets,
47  const typename TImage::RegionType AllImage,
48  std::vector<typename TImage::PixelType> & inbuffer,
49  unsigned int & start,
50  unsigned int & end);
51 
52 template <typename TImage, typename TBres>
53 void
54 CopyLineToImage(const typename TImage::Pointer output,
55  const typename TImage::IndexType StartIndex,
56  const typename TBres::OffsetArray LineOffsets,
57  std::vector<typename TImage::PixelType> & outbuffer,
58  const unsigned start,
59  const unsigned end);
60 
61 // This returns a face with a normal between +/- 45 degrees of the
62 // line. The face is enlarged so that AllImage is entirely filled by
63 // lines starting from every pixel in the face. This means that some
64 // of the region will not touch the image. This approach is necessary
65 // because we want to be able to sweep the lines in a fashion that
66 // does not have overlap between them.
67 template <typename TInputImage, typename TLine>
69 MakeEnlargedFace(const TInputImage * input, const typename TInputImage::RegionType AllImage, const TLine line);
70 
71 // figure out the correction factor for length->pixel count based on
72 // line angle
73 template <typename TLine>
74 unsigned int
75 GetLinePixels(const TLine line);
76 
77 } // namespace itk
78 
79 #ifndef ITK_MANUAL_INSTANTIATION
80 # include "itkSharedMorphologyUtilities.hxx"
81 #endif
82 
83 #endif
itk::MakeEnlargedFace
TInputImage::RegionType MakeEnlargedFace(const TInputImage *input, const typename TInputImage::RegionType AllImage, const TLine line)
itk::ComputeStartEnd
int ComputeStartEnd(const typename TImage::IndexType StartIndex, const TLine line, const float tol, const typename TBres::OffsetArray LineOffsets, const typename TImage::RegionType AllImage, unsigned &start, unsigned &end)
itk::CopyLineToImage
void CopyLineToImage(const typename TImage::Pointer output, const typename TImage::IndexType StartIndex, const typename TBres::OffsetArray LineOffsets, std::vector< typename TImage::PixelType > &outbuffer, const unsigned start, const unsigned end)
itk::NeedToDoFace
bool NeedToDoFace(const TRegion AllImage, const TRegion face, const TLine line)
itk::GetLinePixels
unsigned int GetLinePixels(const TLine line)
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::FillLineBuffer
int FillLineBuffer(typename TImage::ConstPointer input, const typename TImage::IndexType StartIndex, const TLine line, const float tol, const typename TBres::OffsetArray LineOffsets, const typename TImage::RegionType AllImage, std::vector< typename TImage::PixelType > &inbuffer, unsigned int &start, unsigned int &end)
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24