Loading...
Searching...
No Matches
itkComputeImageExtremaFilter.h
Go to the documentation of this file.
/*=========================================================================
*
* 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 itkComputeImageExtremaFilter_h
#define itkComputeImageExtremaFilter_h
#include "itkImageSink.h"
#include "itkImageMaskSpatialObject.h"
namespace itk
{
template <typename TInputImage>
class ITK_TEMPLATE_EXPORT ComputeImageExtremaFilter : public ImageSink<TInputImage>
{
public:
ITK_DISALLOW_COPY_AND_MOVE(ComputeImageExtremaFilter);
using Self = ComputeImageExtremaFilter;
using Superclass = ImageSink<TInputImage>;
using Pointer = SmartPointer<Self>;
using ConstPointer = SmartPointer<const Self>;
itkNewMacro(Self);
itkTypeMacro(ComputeImageExtremaFilter, StatisticsImageFilter);
using InputImagePointer = typename TInputImage::Pointer;
using Superclass::InputImageDimension;
using typename Superclass::InputImageRegionType;
using PixelType = typename Superclass::InputImagePixelType;
itkStaticConstMacro(ImageDimension, unsigned int, TInputImage::ImageDimension);
using ImageSpatialMaskType = ImageMaskSpatialObject<Self::ImageDimension>;
using ImageSpatialMaskPointer = typename ImageSpatialMaskType::Pointer;
using ImageSpatialMaskConstPointer = typename ImageSpatialMaskType::ConstPointer;
itkSetConstObjectMacro(ImageSpatialMask, ImageSpatialMaskType);
itkGetConstObjectMacro(ImageSpatialMask, ImageSpatialMaskType);
PixelType
GetMinimum() const
{
return m_ThreadMin;
}
PixelType
GetMaximum() const
{
return m_ThreadMax;
}
protected:
ComputeImageExtremaFilter() = default;
~ComputeImageExtremaFilter() override = default;
void
BeforeStreamedGenerateData() override;
void
ThreadedStreamedGenerateData(const InputImageRegionType &) override;
private:
struct MinMaxResult
{
PixelType Min;
PixelType Max;
};
static MinMaxResult
RetrieveMinMax(const TInputImage &, const InputImageRegionType &, const ImageSpatialMaskType *, bool);
ImageSpatialMaskConstPointer m_ImageSpatialMask{};
bool m_SameGeometry{ false };
PixelType m_ThreadMin{ 1 };
PixelType m_ThreadMax{ 1 };
std::mutex m_Mutex{};
}; // end of class
} // end namespace itk
#ifndef ITK_MANUAL_INSTANTIATION
# include "itkComputeImageExtremaFilter.hxx"
#endif
#endif
ImageSink
itk::ComputeImageExtremaFilter::~ComputeImageExtremaFilter
~ComputeImageExtremaFilter() override=default
itk::ComputeImageExtremaFilter::itkStaticConstMacro
itkStaticConstMacro(ImageDimension, unsigned int, TInputImage::ImageDimension)
itk::ComputeImageExtremaFilter::GetMinimum
PixelType GetMinimum() const
Definition itkComputeImageExtremaFilter.h:67
itk::ComputeImageExtremaFilter::m_Mutex
std::mutex m_Mutex
Definition itkComputeImageExtremaFilter.h:106
itk::ComputeImageExtremaFilter::ImageSpatialMaskConstPointer
typename ImageSpatialMaskType::ConstPointer ImageSpatialMaskConstPointer
Definition itkComputeImageExtremaFilter.h:62
itk::ComputeImageExtremaFilter::InputImagePointer
typename TInputImage::Pointer InputImagePointer
Definition itkComputeImageExtremaFilter.h:51
itk::ComputeImageExtremaFilter::ConstPointer
SmartPointer< const Self > ConstPointer
Definition itkComputeImageExtremaFilter.h:42
itk::ComputeImageExtremaFilter::Self
ComputeImageExtremaFilter Self
Definition itkComputeImageExtremaFilter.h:39
itk::ComputeImageExtremaFilter::ImageSpatialMaskType
ImageMaskSpatialObject< Self::ImageDimension > ImageSpatialMaskType
Definition itkComputeImageExtremaFilter.h:60
itk::ComputeImageExtremaFilter::Pointer
SmartPointer< Self > Pointer
Definition itkComputeImageExtremaFilter.h:41
itk::ComputeImageExtremaFilter::m_SameGeometry
bool m_SameGeometry
Definition itkComputeImageExtremaFilter.h:101
itk::ComputeImageExtremaFilter::m_ThreadMin
PixelType m_ThreadMin
Definition itkComputeImageExtremaFilter.h:103
itk::ComputeImageExtremaFilter::m_ImageSpatialMask
ImageSpatialMaskConstPointer m_ImageSpatialMask
Definition itkComputeImageExtremaFilter.h:100
itk::ComputeImageExtremaFilter::ComputeImageExtremaFilter
ComputeImageExtremaFilter()=default
itk::ComputeImageExtremaFilter::m_ThreadMax
PixelType m_ThreadMax
Definition itkComputeImageExtremaFilter.h:104
itk::ComputeImageExtremaFilter::ImageSpatialMaskPointer
typename ImageSpatialMaskType::Pointer ImageSpatialMaskPointer
Definition itkComputeImageExtremaFilter.h:61
itk::ComputeImageExtremaFilter::ThreadedStreamedGenerateData
void ThreadedStreamedGenerateData(const InputImageRegionType &) override
itk::ComputeImageExtremaFilter::Superclass
ImageSink< TInputImage > Superclass
Definition itkComputeImageExtremaFilter.h:40
itk::ComputeImageExtremaFilter::RetrieveMinMax
static MinMaxResult RetrieveMinMax(const TInputImage &, const InputImageRegionType &, const ImageSpatialMaskType *, bool)
itk::ComputeImageExtremaFilter::BeforeStreamedGenerateData
void BeforeStreamedGenerateData() override
itk::ComputeImageExtremaFilter::ITK_DISALLOW_COPY_AND_MOVE
ITK_DISALLOW_COPY_AND_MOVE(ComputeImageExtremaFilter)
itk::ComputeImageExtremaFilter::GetMaximum
PixelType GetMaximum() const
Definition itkComputeImageExtremaFilter.h:73
itk
Definition itkAdvancedImageToImageMetric.h:43
itk::ComputeImageExtremaFilter::MinMaxResult
Definition itkComputeImageExtremaFilter.h:92
itk::ComputeImageExtremaFilter::MinMaxResult::Min
PixelType Min
Definition itkComputeImageExtremaFilter.h:93
itk::ComputeImageExtremaFilter::MinMaxResult::Max
PixelType Max
Definition itkComputeImageExtremaFilter.h:94

Generated on 1768596610 for elastix by 1.15.0 |