/usr/include/ITK-4.9/itkWatershedEquivalenceRelabeler.h is in libinsighttoolkit4-dev 4.9.0-4ubuntu1.
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 | /*=========================================================================
*
* 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 itkWatershedEquivalenceRelabeler_h
#define itkWatershedEquivalenceRelabeler_h
#include "itkWatershedSegmenter.h"
namespace itk
{
namespace watershed
{
/** \class EquivalenceRelabeler
*
* This class is part of the set of watershed segmentation component objects.
* It is an image-to-image filter that relabels its input according to a set of
* equivalencies defined in a table. The filter is used in
* itk::WatershedImageFilter, for example, to relabel a segmented image
* at different hierarchies in the merge tree (see itk::WatershedImageFilter
* for documentation on terminology). It simply takes its input and changes
* any values found in the equivalency table.
*
* \par Inputs
* There are two inputs to this filter, an IdentifierType itk::Image of
* arbitrary dimension, and an itk::EquivalencyTable. The input
* image is the image to be relabeled and copied to the output, and the
* EquivalencyTable identifies how to relabel the values.
*
* \par Output
* The output of this filter is the relabeled IdentifierType itk::Image of same
* dimension and size as the input.
*
* \ingroup WatershedSegmentation
* \sa itk::WatershedImageFilter
* \sa EquivalencyTable
* \ingroup ITKWatersheds
*/
template< typename TScalar, unsigned int TImageDimension >
class EquivalenceRelabeler:
public ProcessObject
{
public:
/** Expose templated image dimension parameter at run time */
itkStaticConstMacro(ImageDimension, unsigned int, TImageDimension);
/** Some convenient typedefs. */
typedef Image< IdentifierType, TImageDimension > ImageType;
typedef EquivalenceRelabeler Self;
typedef ProcessObject Superclass;
typedef TScalar ScalarType;
typedef EquivalencyTable EquivalencyTableType;
typedef Segmenter< Image< ScalarType, TImageDimension > > SegmenterType;
typedef DataObject::Pointer DataObjectPointer;
/** Define smart pointers for this object. */
typedef SmartPointer< Self > Pointer;
typedef SmartPointer< const Self > ConstPointer;
itkNewMacro(Self);
itkTypeMacro(WatershedEquivalenceRelabeler, ProcessObject);
/** Set/Get the image to relabel. */
void SetInputImage(ImageType *img)
{ this->ProcessObject::SetNthInput(0, img); }
const ImageType * GetInputImage(void)
{
return static_cast< ImageType * >
( this->ProcessObject::GetInput(0) );
}
/** Set/Get the output image */
void SetOutputImage(ImageType *img)
{
this->ProcessObject::SetNthOutput(0, img);
}
typename ImageType::Pointer GetOutputImage()
{
return static_cast< ImageType * >
( this->ProcessObject::GetOutput(0) );
}
/** Set/Get the table to use in relabeling the input image. */
void SetEquivalencyTable(EquivalencyTableType *et)
{
this->ProcessObject::SetNthInput(1, et);
}
EquivalencyTableType::Pointer GetEquivalencyTable()
{
return static_cast< EquivalencyTableType * >
( this->ProcessObject::GetInput(1) );
}
/** Standard non-threaded pipeline method */
virtual void GenerateData() ITK_OVERRIDE;
/** Standard itk::ProcessObject subclass method. */
typedef ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType;
using Superclass::MakeOutput;
virtual DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) ITK_OVERRIDE;
protected:
EquivalenceRelabeler()
{
typename ImageType::Pointer img =
static_cast< ImageType * >( this->MakeOutput(0).GetPointer() );
this->SetNumberOfRequiredOutputs(1);
this->ProcessObject::SetNthOutput( 0, img.GetPointer() );
}
virtual ~EquivalenceRelabeler() {}
EquivalenceRelabeler(const Self &) {}
void operator=(const Self &) {}
virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
virtual void GenerateOutputRequestedRegion(DataObject *output) ITK_OVERRIDE;
virtual void GenerateInputRequestedRegion() ITK_OVERRIDE;
};
} // end namespace watershed
} // end namespace itk
#ifndef ITK_MANUAL_INSTANTIATION
#include "itkWatershedEquivalenceRelabeler.hxx"
#endif
#endif
|