/usr/include/ITK-4.5/itkFastMarchingImageToNodePairContainerAdaptor.h is in libinsighttoolkit4-dev 4.5.0-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | /*=========================================================================
*
* Copyright Insight Software Consortium
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*=========================================================================*/
#ifndef __itkFastMarchingImageToNodePairContainerAdaptor_h
#define __itkFastMarchingImageToNodePairContainerAdaptor_h
#include "itkObject.h"
#include "itkFastMarchingTraits.h"
namespace itk
{
/**
* \class FastMarchingImageToNodePairContainerAdaptor
* \brief Convenient adaptor class which converts Image into
* FastMarching::NodePairContainerType used for initializing the FastMarching.
*
* One provides images by means of SetAliveImage, SetTrialImage, SetForbiddenImage
* and get corresponding containers by means of GetAlivePoints, GetTrialPoints,
* GetForbiddenPoints.
*
* One can globally set the associated value for all FastMarchingTraitsBase::Alive
* points by means of SetAliveValue; and for all FastMarchingTraitsBase::Trial
* points by means of SetTrialValue.
*
* To restrict the evolution of the front in certain area, one can use
* SetForbiddenImage and SetIsForbiddenImageBinaryMask depending on the input
* image.
*
* \sa FastMarchingTraitsBase
* \sa FastMarchingBase
*
* \ingroup ITKFastMarching
*/
template< typename TInput, typename TOutput, typename TImage >
class FastMarchingImageToNodePairContainerAdaptor :
public Object
{
public:
typedef FastMarchingImageToNodePairContainerAdaptor Self;
typedef LightObject Superclass;
typedef SmartPointer< Self > Pointer;
typedef SmartPointer< const Self > ConstPointer;
/** Method for creation through the object factory. */
itkNewMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(FastMarchingImageToNodePairContainerAdaptor, LightObject);
typedef FastMarchingTraits< TInput, TOutput > Traits;
typedef typename Traits::NodePairType NodePairType;
typedef typename Traits::NodePairContainerType NodePairContainerType;
typedef typename Traits::NodePairContainerPointer NodePairContainerPointer;
typedef typename Traits::LabelType LabelType;
typedef typename Traits::OutputPixelType OutputPixelType;
typedef TImage ImageType;
typedef typename ImageType::Pointer ImagePointer;
typedef typename ImageType::ConstPointer ImageConstPointer;
typedef typename ImageType::PixelType ImagePixelType;
itkStaticConstMacro( ImageDimension, unsigned int,
Traits::ImageDimension );
/** \brief Set one Alive Image.
\note Only pixels with non null values are considered as
FastMarchingTraitsBase::Alive points.*/
void SetAliveImage( const ImageType* iImage );
/** \brief Set one Trial Image.
\note Only pixels with non null values are considered as
FastMarchingTraitsBase::Trialpoints.*/
void SetTrialImage( const ImageType* iImage );
/** \brief Set one Forbidden Image.
There are two possible behaviors here depending on
m_IsForbiddenImageBinaryMask:
\li if m_IsForbiddenImageBinaryMask is \c true, then the input image
is a binary mask; thus null values are considered as
FastMarchingTraitsBase::Forbidden points
\li else (m_IsForbiddenImageBinaryMask is \c fasle) non null values
represents FastMarchingTraitsBase::Forbidden points*/
void SetForbiddenImage( const ImageType* iImage );
itkSetMacro( IsForbiddenImageBinaryMask, bool );
itkBooleanMacro( IsForbiddenImageBinaryMask );
/** \brief Get resulting Alive Points container*/
NodePairContainerType* GetAlivePoints();
/** \brief Get resulting Trial Points container*/
NodePairContainerType* GetTrialPoints();
/** \brief Get resulting Forbidden Points container*/
NodePairContainerType* GetForbiddenPoints();
itkSetMacro( AliveValue, OutputPixelType );
itkSetMacro( TrialValue, OutputPixelType );
/** \brief Perform the conversion. */
void Update();
protected:
/** \brief Constructor */
FastMarchingImageToNodePairContainerAdaptor();
/** \brief Destructor */
virtual ~FastMarchingImageToNodePairContainerAdaptor() {}
ImageConstPointer m_AliveImage;
ImageConstPointer m_TrialImage;
ImageConstPointer m_ForbiddenImage;
NodePairContainerPointer m_AlivePoints;
NodePairContainerPointer m_TrialPoints;
NodePairContainerPointer m_ForbiddenPoints;
OutputPixelType m_AliveValue;
OutputPixelType m_TrialValue;
bool m_IsForbiddenImageBinaryMask;
virtual void GenerateData();
/** */
void
SetPointsFromImage( const ImageType* image, const LabelType& iLabel,
const OutputPixelType& iValue );
private:
FastMarchingImageToNodePairContainerAdaptor( const Self& );
void operator = ( const Self& );
};
}
#include "itkFastMarchingImageToNodePairContainerAdaptor.hxx"
#endif // __itkFastMarchingImageToNodePairContainerAdaptor_h
|