ITK  6.0.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 * https://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
24namespace itk
25{
26template <typename TRegion, typename TLine>
27bool
28NeedToDoFace(const TRegion AllImage, const TRegion face, const TLine line);
29
30template <typename TImage, typename TBres, typename TLine>
31int
32ComputeStartEnd(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 int & start,
38 unsigned int & end);
39
40template <typename TImage, typename TBres, typename TLine>
41int
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
52template <typename TImage, typename TBres>
53void
54CopyLineToImage(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 int start,
59 const unsigned int 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.
67template <typename TInputImage, typename TLine>
69MakeEnlargedFace(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
73template <typename TLine>
74unsigned int
75GetLinePixels(const TLine line);
76
77} // namespace itk
78
79#ifndef ITK_MANUAL_INSTANTIATION
80# include "itkSharedMorphologyUtilities.hxx"
81#endif
82
83#endif
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
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)
int ComputeStartEnd(const typename TImage::IndexType StartIndex, const TLine line, const float tol, const typename TBres::OffsetArray LineOffsets, const typename TImage::RegionType AllImage, unsigned int &start, unsigned int &end)
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 int start, const unsigned int end)
unsigned int GetLinePixels(const TLine line)
TInputImage::RegionType MakeEnlargedFace(const TInputImage *input, const typename TInputImage::RegionType AllImage, const TLine line)
bool NeedToDoFace(const TRegion AllImage, const TRegion face, const TLine line)