<commit_before>/*=========================================================================
 *
 *  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 __itkBinShrinkImageFilter_h
#define __itkBinShrinkImageFilter_h

#include "itkShrinkImageFilter.h"

namespace itk
{

/** \class BinShrinkImageFilter
 * \brief Reduce the size of an image by an integer factor in each
 * dimension while performing averaging of an input neighborhood.
 *
 *
 * The output image size in each dimension is given by:
 *
 * outputSize[j] = max( vcl_floor(inputSize[j]/shrinkFactor[j]), 1 );
 *
 * The algorithm implemented can be describe with the following
 * equation for 2D:
 * \f[
 *  \mathsf{I}_{out}(x_o,x_1) =
 *    \frac{\sum_{i=0}^{f_0}\sum_{j=0}^{f_1}\mathsf{I}_{in}(f_0 x_o+i,f_1 x_1+j)}{f_0 f_1}
 * \f]
 *
 * This filter is implemented so that the starting extent of the first
 * pixel of the output matches that of the input.
 *
 * \image html BinShrinkGrid.png ["The change in image geometry from a 5x5 image
 *   binned by a factor of 2x2. The green dotted lines are the input
 *   image. The yellow grid is the result of the filter. The points
 *   represent the respective origins."]
 *
 * This code was contributed in the Insight Journal paper:<commit_msg>DOC: Fixing BinShrink image caption<commit_after>/*=========================================================================
 *
 *  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 __itkBinShrinkImageFilter_h
#define __itkBinShrinkImageFilter_h

#include "itkShrinkImageFilter.h"

namespace itk
{

/** \class BinShrinkImageFilter
 * \brief Reduce the size of an image by an integer factor in each
 * dimension while performing averaging of an input neighborhood.
 *
 *
 * The output image size in each dimension is given by:
 *
 * outputSize[j] = max( vcl_floor(inputSize[j]/shrinkFactor[j]), 1 );
 *
 * The algorithm implemented can be describe with the following
 * equation for 2D:
 * \f[
 *  \mathsf{I}_{out}(x_o,x_1) =
 *    \frac{\sum_{i=0}^{f_0}\sum_{j=0}^{f_1}\mathsf{I}_{in}(f_0 x_o+i,f_1 x_1+j)}{f_0 f_1}
 * \f]
 *
 * This filter is implemented so that the starting extent of the first
 * pixel of the output matches that of the input.
 *
 * \image html BinShrinkGrid.png "The change in image geometry from a 5x5 image binned by a factor of 2x2."
 *
 * This code was contributed in the Insight Journal paper:
{'fraction_non_alphanumeric': 0.16216952848187516, 'fraction_numerical': 0.010902153175252113, 'mean_word_length': 4.235378031383737, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1086227', 'n_tokens_mistral': 1060, 'n_tokens_neox': 1031, 'n_words': 416}